]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_service.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
4 #ifndef CEPH_RGW_SERVICE_H
5 #define CEPH_RGW_SERVICE_H
12 #include "common/async/yield_context.h"
14 #include "rgw/rgw_common.h"
16 struct RGWServices_Def
;
18 class RGWServiceInstance
20 friend struct RGWServices_Def
;
29 } start_state
{StateInit
};
31 virtual void shutdown() {}
32 virtual int do_start(optional_yield
, const DoutPrefixProvider
*dpp
) {
36 RGWServiceInstance(CephContext
*_cct
) : cct(_cct
) {}
37 virtual ~RGWServiceInstance();
39 int start(optional_yield y
, const DoutPrefixProvider
*dpp
);
41 return (start_state
== StateStarted
);
51 class RGWSI_Bucket_SObj
;
52 class RGWSI_Bucket_Sync
;
53 class RGWSI_Bucket_Sync_SObj
;
54 class RGWSI_BucketIndex
;
55 class RGWSI_BucketIndex_RADOS
;
56 class RGWSI_BILog_RADOS
;
58 class RGWSI_ConfigKey
;
59 class RGWSI_ConfigKey_RADOS
;
62 class RGWSI_MetaBackend
;
63 class RGWSI_MetaBackend_SObj
;
64 class RGWSI_MetaBackend_OTP
;
69 class RGWSI_ZoneUtils
;
71 class RGWSI_SyncModules
;
73 class RGWSI_SysObj_Core
;
74 class RGWSI_SysObj_Cache
;
76 class RGWSI_User_RADOS
;
77 class RGWDataChangesLog
;
78 class RGWSI_Role_RADOS
;
80 struct RGWServices_Def
82 bool can_shutdown
{false};
83 bool has_shutdown
{false};
85 std::unique_ptr
<RGWSI_Finisher
> finisher
;
86 std::unique_ptr
<RGWSI_Bucket_SObj
> bucket_sobj
;
87 std::unique_ptr
<RGWSI_Bucket_Sync_SObj
> bucket_sync_sobj
;
88 std::unique_ptr
<RGWSI_BucketIndex_RADOS
> bi_rados
;
89 std::unique_ptr
<RGWSI_BILog_RADOS
> bilog_rados
;
90 std::unique_ptr
<RGWSI_Cls
> cls
;
91 std::unique_ptr
<RGWSI_ConfigKey_RADOS
> config_key_rados
;
92 std::unique_ptr
<RGWSI_MDLog
> mdlog
;
93 std::unique_ptr
<RGWSI_Meta
> meta
;
94 std::unique_ptr
<RGWSI_MetaBackend_SObj
> meta_be_sobj
;
95 std::unique_ptr
<RGWSI_MetaBackend_OTP
> meta_be_otp
;
96 std::unique_ptr
<RGWSI_Notify
> notify
;
97 std::unique_ptr
<RGWSI_OTP
> otp
;
98 std::unique_ptr
<RGWSI_RADOS
> rados
;
99 std::unique_ptr
<RGWSI_Zone
> zone
;
100 std::unique_ptr
<RGWSI_ZoneUtils
> zone_utils
;
101 std::unique_ptr
<RGWSI_Quota
> quota
;
102 std::unique_ptr
<RGWSI_SyncModules
> sync_modules
;
103 std::unique_ptr
<RGWSI_SysObj
> sysobj
;
104 std::unique_ptr
<RGWSI_SysObj_Core
> sysobj_core
;
105 std::unique_ptr
<RGWSI_SysObj_Cache
> sysobj_cache
;
106 std::unique_ptr
<RGWSI_User_RADOS
> user_rados
;
107 std::unique_ptr
<RGWDataChangesLog
> datalog_rados
;
108 std::unique_ptr
<RGWSI_Role_RADOS
> role_rados
;
113 int init(CephContext
*cct
, bool have_cache
, bool raw_storage
, bool run_sync
, optional_yield y
, const DoutPrefixProvider
*dpp
);
120 RGWServices_Def _svc
;
124 RGWSI_Finisher
*finisher
{nullptr};
125 RGWSI_Bucket
*bucket
{nullptr};
126 RGWSI_Bucket_SObj
*bucket_sobj
{nullptr};
127 RGWSI_Bucket_Sync
*bucket_sync
{nullptr};
128 RGWSI_Bucket_Sync_SObj
*bucket_sync_sobj
{nullptr};
129 RGWSI_BucketIndex
*bi
{nullptr};
130 RGWSI_BucketIndex_RADOS
*bi_rados
{nullptr};
131 RGWSI_BILog_RADOS
*bilog_rados
{nullptr};
132 RGWSI_Cls
*cls
{nullptr};
133 RGWSI_ConfigKey_RADOS
*config_key_rados
{nullptr};
134 RGWSI_ConfigKey
*config_key
{nullptr};
135 RGWDataChangesLog
*datalog_rados
{nullptr};
136 RGWSI_MDLog
*mdlog
{nullptr};
137 RGWSI_Meta
*meta
{nullptr};
138 RGWSI_MetaBackend
*meta_be_sobj
{nullptr};
139 RGWSI_MetaBackend
*meta_be_otp
{nullptr};
140 RGWSI_Notify
*notify
{nullptr};
141 RGWSI_OTP
*otp
{nullptr};
142 RGWSI_RADOS
*rados
{nullptr};
143 RGWSI_Zone
*zone
{nullptr};
144 RGWSI_ZoneUtils
*zone_utils
{nullptr};
145 RGWSI_Quota
*quota
{nullptr};
146 RGWSI_SyncModules
*sync_modules
{nullptr};
147 RGWSI_SysObj
*sysobj
{nullptr};
148 RGWSI_SysObj_Cache
*cache
{nullptr};
149 RGWSI_SysObj_Core
*core
{nullptr};
150 RGWSI_User
*user
{nullptr};
151 RGWSI_Role_RADOS
*role
{nullptr};
153 int do_init(CephContext
*cct
, bool have_cache
, bool raw_storage
, bool run_sync
, optional_yield y
, const DoutPrefixProvider
*dpp
);
155 int init(CephContext
*cct
, bool have_cache
, bool run_sync
, optional_yield y
, const DoutPrefixProvider
*dpp
) {
156 return do_init(cct
, have_cache
, false, run_sync
, y
, dpp
);
159 int init_raw(CephContext
*cct
, bool have_cache
, optional_yield y
, const DoutPrefixProvider
*dpp
) {
160 return do_init(cct
, have_cache
, true, false, y
, dpp
);
167 class RGWMetadataManager
;
168 class RGWMetadataHandler
;
175 std::unique_ptr
<RGWMetadataManager
> mgr
;
176 std::unique_ptr
<RGWMetadataHandler
> bucket
;
177 std::unique_ptr
<RGWMetadataHandler
> bucket_instance
;
178 std::unique_ptr
<RGWMetadataHandler
> user
;
179 std::unique_ptr
<RGWMetadataHandler
> otp
;
180 std::unique_ptr
<RGWMetadataHandler
> role
;
186 std::unique_ptr
<RGWUserCtl
> user
;
187 std::unique_ptr
<RGWBucketCtl
> bucket
;
188 std::unique_ptr
<RGWOTPCtl
> otp
;
193 int init(RGWServices
& svc
, rgw::sal::Store
* store
, const DoutPrefixProvider
*dpp
);
197 CephContext
*cct
{nullptr};
198 RGWServices
*svc
{nullptr};
203 RGWMetadataManager
*mgr
{nullptr};
205 RGWMetadataHandler
*bucket
{nullptr};
206 RGWMetadataHandler
*bucket_instance
{nullptr};
207 RGWMetadataHandler
*user
{nullptr};
208 RGWMetadataHandler
*otp
{nullptr};
209 RGWMetadataHandler
*role
{nullptr};
212 RGWUserCtl
*user
{nullptr};
213 RGWBucketCtl
*bucket
{nullptr};
214 RGWOTPCtl
*otp
{nullptr};
216 int init(RGWServices
*_svc
, rgw::sal::Store
* store
, const DoutPrefixProvider
*dpp
);