]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: es: add a configurable to override index path
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 4 Apr 2017 19:02:41 +0000 (12:02 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 30 May 2017 20:26:52 +0000 (13:26 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_sync_module_es.cc

index e81c61ba5b964fd59ca9c19e63b961806929a0fa..0ab7ad40293bcf573a1f51a6ddd925c8b3ed9a6e 100644 (file)
@@ -103,12 +103,18 @@ struct ElasticConfig {
   string index_path;
   RGWRESTConn *conn{nullptr};
   bool explicit_custom_meta{true};
+  string override_index_path;
   ItemList index_buckets;
   ItemList allow_owners;
 
   void init_instance(RGWRealm& realm, uint64_t instance_id) {
     sync_instance = instance_id;
 
+    if (!override_index_path.empty()) {
+      index_path = override_index_path;
+      return;
+    }
+
     char buf[32];
     snprintf(buf, sizeof(buf), "-%08x", (uint32_t)(sync_instance & 0xFFFFFFFF));
 
@@ -452,6 +458,7 @@ public:
     conf->explicit_custom_meta = rgw_conf_get_bool(config, "explicit_custom_meta", true);
     conf->index_buckets.init(rgw_conf_get(config, "index_buckets_list", ""), true); /* approve all buckets by default */
     conf->allow_owners.init(rgw_conf_get(config, "approved_owners_list", ""), true); /* approve all bucket owners by default */
+    conf->override_index_path = rgw_conf_get(config, "override_index_path", "");
   }
   ~RGWElasticDataSyncModule() override {
     delete conf->conn;