]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librgw: re-derive RGWLibRequest
authorMatt Benjamin <mbenjamin@redhat.com>
Thu, 1 Oct 2015 22:26:37 +0000 (18:26 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Fri, 12 Feb 2016 17:04:32 +0000 (12:04 -0500)
commit259be80cac4f9d9c85c463af4180bb575e21c2a0
tree271b7e1f797901d9608e8105e63cf915b3dbe35f
parentd1d4535d46282b83a76225ca33de40ec81d499e4
librgw: re-derive RGWLibRequest

Derive RGWLibRequest from RGWRequest, RGWHandler.

This strategy defines the dialect of ops following the derivation
pattern for RGWLib actions to be their handler.

On the negative side, RGWLibRequest has struct req_state* s from two
ancestors.  Since we don't use virtal inheritance, the only overhead is
the extra copy, and need for disambiguation in the direct descendants
(this is only 1 method in 1 file, atm).

The motivation is as follows.  RGWHandler currently has 3 responsibilities:
1) op-chasing; 2) to hold authorize() and read_permissions() methods
3) to initialize req_state

RGWLib actions have no use for the op-chasing behavior, and authorize()
and read_permissions() methods are arguably more naturally expressed as
methods on the actions.  Meanwhile struct req_state appears to be a
candidate for refactoring into the RGWRequest class hierarchy, which would
mean that initalization probably should move from hanlder to request, as
well.  Refactoring req_state is would be quite intrusive, so this change
defers that for later, but keeps the 1-1 mappings from request to
handler at 0 cost.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/librgw.cc
src/rgw/rgw_file.h
src/rgw/rgw_lib.h
src/rgw/rgw_rest_lib.h