From: Matt Benjamin Date: Fri, 15 Jul 2022 15:01:15 +0000 (-0400) Subject: rgwlc: return std::string_view from sal::Zone::get_tier_type() X-Git-Tag: v18.0.0~475^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ff10064ab878e58afb1d2538b2086a2d4a41c017;p=ceph-ci.git rgwlc: return std::string_view from sal::Zone::get_tier_type() Valid values are all small strings, often static. Signed-off-by: Matt Benjamin --- diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index b2542772a6d..799af26367d 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -1496,7 +1496,7 @@ class Zone { /** Get the ID of the realm containing this zone */ virtual const std::string& get_realm_id() = 0; /** Get the tier type for the zone */ - virtual const std::string& get_tier_type() = 0; + virtual const std::string_view get_tier_type() = 0; }; /** diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index a5074d9a67b..239211de6c8 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -335,7 +335,7 @@ protected: virtual const RGWAccessKey& get_system_key() override; virtual const std::string& get_realm_name() override; virtual const std::string& get_realm_id() override; - virtual const std::string& get_tier_type() override { return "rgw"; } + virtual const std::string_view get_tier_type() override { return "rgw"; } }; class DBLuaScriptManager : public StoreLuaScriptManager { diff --git a/src/rgw/rgw_sal_motr.h b/src/rgw/rgw_sal_motr.h index 130bcfbc9ec..e2684637ca2 100644 --- a/src/rgw/rgw_sal_motr.h +++ b/src/rgw/rgw_sal_motr.h @@ -457,7 +457,7 @@ class MotrZone : public StoreZone { virtual const RGWAccessKey& get_system_key() { return zone_params->system_key; } virtual const std::string& get_realm_name() { return realm->get_name(); } virtual const std::string& get_realm_id() { return realm->get_id(); } - virtual const std::string& get_tier_type() { return "rgw"; } + virtual const std::string_view get_tier_type() { return "rgw"; } friend class MotrStore; }; diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index 22ae73d3a63..e39b03f2511 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -3008,7 +3008,7 @@ const std::string& RadosZone::get_realm_id() return store->svc()->zone->get_realm().get_id(); } -const std::string& RadosZone::get_tier_type() +const std::string_view RadosZone::get_tier_type() { return store->svc()->zone->get_zone().tier_type; } diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index 693c0569b7e..47fcb12797f 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -107,7 +107,7 @@ class RadosZone : public StoreZone { virtual const RGWAccessKey& get_system_key() override; virtual const std::string& get_realm_name() override; virtual const std::string& get_realm_id() override; - virtual const std::string& get_tier_type() override; + virtual const std::string_view get_tier_type() override; }; class RadosStore : public StoreStore {