]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: meta search rest handler can access es module
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 21 Mar 2017 18:47:17 +0000 (11:47 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 30 May 2017 20:24:39 +0000 (13:24 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_sync_module_es_rest.cc

index f0c9d3062a4ea5acf8022c6210704841e04f904b..fa6764cd9b3e20c14f2dc8c4775b0431491bfabe 100644 (file)
@@ -8,12 +8,13 @@
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
-class RGWMetadataSearch : public RGWOp {
+class RGWMetadataSearchOp : public RGWOp {
+  RGWElasticSyncModuleInstance *es_module;
 protected:
   string expression;
 
 public:
-  RGWMetadataSearch() {}
+  RGWMetadataSearchOp(RGWElasticSyncModuleInstance *_es_module) : es_module(_es_module) {}
 
   int verify_permission() {
     return 0;
@@ -49,11 +50,13 @@ void RGWMetadataSearch::execute()
     return;
   }
 
+  RGWRESTConn *conn = es_module->get_rest_conn();
+  // conn->
 }
 
 class RGWMetadataSearch_ObjStore_S3 : public RGWMetadataSearch {
 public:
-  RGWMetadataSearch_ObjStore_S3() {}
+  RGWMetadataSearch_ObjStore_S3(RGWElasticSyncModuleInstance *_es_module) : RGWMetadataSearch(_es_module) {}
 
   int get_params() override {
     expression = s->info.args.get("query");
@@ -75,6 +78,7 @@ public:
 };
 
 class RGWHandler_REST_MDSearch_S3 : public RGWHandler_REST_S3 {
+  RGWElasticSyncModuleInstance *es_module;
 protected:
   RGWOp *op_get() {
     if (!s->info.args.exists("query")) {
@@ -89,7 +93,8 @@ protected:
     return nullptr;
   }
 public:
-  RGWHandler_REST_MDSearch_S3() {}
+  RGWHandler_REST_MDSearch_S3(const rgw::auth::StrategyRegistry& auth_registry,
+                              RGWElasticSyncModuleInstance *_es_module) : RGWHandler_REST_S3(auth_registry), es_module(_es_module) {}
   virtual ~RGWHandler_REST_MDSearch_S3() {}
 };
 
@@ -109,7 +114,7 @@ RGWHandler_REST* RGWRESTMgr_MDSearch_S3::get_handler(struct req_state* const s,
     return nullptr;
   }
 
-  RGWHandler_REST *handler = new RGWHandler_REST_MDSearch_S3;
+  RGWHandler_REST *handler = new RGWHandler_REST_MDSearch_S3(auth_registry, es_module);
 
   ldout(s->cct, 20) << __func__ << " handler=" << typeid(*handler).name()
                    << dendl;