if (dialect != RGW_REST_S3) {
return orig;
}
- return new RGWRESTMgr_MDSearch_S3(this);
+ return new RGWRESTMgr_MDSearch_S3();
}
int RGWElasticSyncModule::create_instance(CephContext *cct, map<string, string, ltstr_nocase>& config, RGWSyncModuleInstanceRef *instance) {
};
class RGWMetadataSearchOp : public RGWOp {
+ RGWSyncModuleInstanceRef sync_module_ref;
RGWElasticSyncModuleInstance *es_module;
protected:
string expression;
es_search_response response;
public:
- RGWMetadataSearchOp(RGWElasticSyncModuleInstance *_es_module) : es_module(_es_module) {}
+ RGWMetadataSearchOp(const RGWSyncModuleInstanceRef& sync_module) : sync_module_ref(sync_module) {
+ es_module = static_cast<RGWElasticSyncModuleInstance *>(sync_module_ref.get());
+ }
int verify_permission() {
return 0;
class RGWMetadataSearch_ObjStore_S3 : public RGWMetadataSearchOp {
public:
- RGWMetadataSearch_ObjStore_S3(RGWElasticSyncModuleInstance *_es_module) : RGWMetadataSearchOp(_es_module) {
+ RGWMetadataSearch_ObjStore_S3(const RGWSyncModuleInstanceRef& _sync_module) : RGWMetadataSearchOp(_sync_module) {
custom_prefix = "x-amz-meta-";
}
};
class RGWHandler_REST_MDSearch_S3 : public RGWHandler_REST_S3 {
- RGWElasticSyncModuleInstance *es_module;
protected:
RGWOp *op_get() {
if (s->info.args.exists("query")) {
- return new RGWMetadataSearch_ObjStore_S3(es_module);
+ return new RGWMetadataSearch_ObjStore_S3(store->get_sync_module());
}
if (!s->init_state.url_bucket.empty() &&
s->info.args.exists("mdsearch")) {
return nullptr;
}
public:
- RGWHandler_REST_MDSearch_S3(const rgw::auth::StrategyRegistry& auth_registry,
- RGWElasticSyncModuleInstance *_es_module) : RGWHandler_REST_S3(auth_registry), es_module(_es_module) {}
+ RGWHandler_REST_MDSearch_S3(const rgw::auth::StrategyRegistry& auth_registry) : RGWHandler_REST_S3(auth_registry) {}
virtual ~RGWHandler_REST_MDSearch_S3() {}
};
return nullptr;
}
- RGWHandler_REST *handler = new RGWHandler_REST_MDSearch_S3(auth_registry, es_module);
+ RGWHandler_REST *handler = new RGWHandler_REST_MDSearch_S3(auth_registry);
ldout(s->cct, 20) << __func__ << " handler=" << typeid(*handler).name()
<< dendl;
class RGWElasticSyncModuleInstance;
class RGWRESTMgr_MDSearch_S3 : public RGWRESTMgr {
- RGWElasticSyncModuleInstance *es_module;
public:
- explicit RGWRESTMgr_MDSearch_S3(RGWElasticSyncModuleInstance *_es_module) : es_module(_es_module) {}
+ explicit RGWRESTMgr_MDSearch_S3() {}
RGWHandler_REST *get_handler(struct req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,