From: Yehuda Sadeh Date: Mon, 29 Aug 2016 18:18:43 +0000 (-0700) Subject: rgw: index metadata in elasticsearch using realm name for path X-Git-Tag: v11.1.0~681^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F10731%2Fhead;p=ceph.git rgw: index metadata in elasticsearch using realm name for path Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 7cb8f667db3..b2092a160ac 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -2024,6 +2024,10 @@ public: return ret; } + RGWRealm& get_realm() { + return realm; + } + RGWZoneParams& get_zone_params() { return zone_params; } RGWZoneGroup& get_zonegroup() { return zonegroup; diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index 7e7708b22c6..afecf7224f5 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -14,9 +14,9 @@ struct ElasticConfig { RGWRESTConn *conn{nullptr}; }; -static string es_get_obj_path(const RGWBucketInfo& bucket_info, const rgw_obj_key& key) +static string es_get_obj_path(const RGWRealm& realm, const RGWBucketInfo& bucket_info, const rgw_obj_key& key) { - string path = "/rgw/object/" + bucket_info.bucket.bucket_id + ":" + key.name + ":" + key.instance; + string path = "/rgw-" + realm.get_name() + "/object/" + bucket_info.bucket.bucket_id + ":" + key.name + ":" + key.instance; return path; } @@ -123,7 +123,7 @@ public: << " b=" << bucket_info.bucket << " k=" << key << " size=" << size << " mtime=" << mtime << " attrs=" << attrs << dendl; yield { - string path = es_get_obj_path(bucket_info, key); + string path = es_get_obj_path(sync_env->store->get_realm(), bucket_info, key); es_obj_metadata doc(sync_env->cct, bucket_info, key, mtime, size, attrs); call(new RGWPutRESTResourceCR(sync_env->cct, conf.conn, @@ -175,7 +175,7 @@ public: ldout(sync_env->cct, 0) << ": remove remote obj: z=" << sync_env->source_zone << " b=" << bucket_info.bucket << " k=" << key << " mtime=" << mtime << dendl; yield { - string path = es_get_obj_path(bucket_info, key); + string path = es_get_obj_path(sync_env->store->get_realm(), bucket_info, key); call(new RGWDeleteRESTResourceCR(sync_env->cct, conf.conn, sync_env->http_manager,