diff options
author | kchheda3 <kchheda3@bloomberg.net> | 2023-12-21 23:23:05 +0100 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2024-03-05 18:55:24 +0100 |
commit | df668e9f65cec50227f671eb2e624c0ee02f2c37 (patch) | |
tree | 12970531027990361f7030bd7d91b6833d84aa39 /src/rgw/services | |
parent | rgw/multisite-notification: Add support to replicate bucket notifications in ... (diff) | |
download | ceph-df668e9f65cec50227f671eb2e624c0ee02f2c37.tar.xz ceph-df668e9f65cec50227f671eb2e624c0ee02f2c37.zip |
rgw/multisite-notification: Add omap object to store the mapping between bucket and topics.
Signed-off-by: kchheda3 <kchheda3@bloomberg.net>
Diffstat (limited to 'src/rgw/services')
-rw-r--r-- | src/rgw/services/svc_topic_rados.cc | 8 | ||||
-rw-r--r-- | src/rgw/services/svc_topic_rados.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/rgw/services/svc_topic_rados.cc b/src/rgw/services/svc_topic_rados.cc index 64c9106776c..9e0b75d4664 100644 --- a/src/rgw/services/svc_topic_rados.cc +++ b/src/rgw/services/svc_topic_rados.cc @@ -10,6 +10,7 @@ static std::string topic_oid_prefix = "topic."; static constexpr char topic_tenant_delim[] = ":"; +static std::string bucket_topic_oid_prefix = "buckets."; std::string get_topic_key(const std::string& topic_name, const std::string& tenant) { @@ -32,6 +33,11 @@ void parse_topic_entry(const std::string& topic_entry, *topic_name = topic_entry; } } + +std::string get_bucket_topic_mapping_oid(const rgw_pubsub_topic& topic) { + return bucket_topic_oid_prefix + get_topic_key(topic.name, topic.user.tenant); +} + class RGWSI_Topic_Module : public RGWSI_MBSObj_Handler_Module { RGWSI_Topic_RADOS::Svc& svc; const std::string prefix; @@ -131,7 +137,7 @@ int RGWTopicMetadataHandler::do_get(RGWSI_MetaBackend_Handler::Op* op, parse_topic_entry(entry, &tenant, &topic_name); RGWPubSub ps(driver, tenant, &topic_svc->svc.zone->get_current_period().get_map().zonegroups); - int ret = ps.get_topic(dpp, topic_name, result, y); + int ret = ps.get_topic(dpp, topic_name, result, y, nullptr); if (ret < 0) { return ret; } diff --git a/src/rgw/services/svc_topic_rados.h b/src/rgw/services/svc_topic_rados.h index e630a610e97..bc4e3537345 100644 --- a/src/rgw/services/svc_topic_rados.h +++ b/src/rgw/services/svc_topic_rados.h @@ -94,3 +94,5 @@ std::string get_topic_key(const std::string& topic_name, void parse_topic_entry(const std::string& topic_entry, std::string* tenant_name, std::string* topic_name); + +std::string get_bucket_topic_mapping_oid(const rgw_pubsub_topic& topic);
\ No newline at end of file |