]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgwlc: return std::string_view from sal::Zone::get_tier_type() 54873/head
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 15 Jul 2022 15:01:15 +0000 (11:01 -0400)
committerMykola Golub <mgolub@suse.com>
Tue, 12 Dec 2023 10:24:40 +0000 (12:24 +0200)
Valid values are all small strings, often static.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit ff10064ab878e58afb1d2538b2086a2d4a41c017)

Conflicts:
src/rgw/rgw_sal_dbstore.h (trivial)
src/rgw/rgw_sal_motr.h (not exist)
src/rgw/rgw_sal_rados.cc (trivial)
src/rgw/rgw_sal_rados.h (trivial)

src/rgw/rgw_sal.h
src/rgw/rgw_sal_dbstore.h
src/rgw/rgw_sal_rados.cc
src/rgw/rgw_sal_rados.h

index b3bdd98fa1d7c3a55e2fbc45f57a65343dc65c81..aab82b3a671da48c55e24d749c49d4062226fc64 100644 (file)
@@ -1424,7 +1424,7 @@ class Zone {
     /** Get the current period ID for this zone */
     virtual const std::string& get_current_period_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;
 };
 
 /**
index 80656991f2dcdce77d28b0e1fc41ec03c3934bff..6788487d60aa0acae66bcc00f3531d9b71f2c8b4 100644 (file)
@@ -270,7 +270,7 @@ protected:
       virtual bool get_redirect_endpoint(std::string* endpoint) override;
       virtual bool has_zonegroup_api(const std::string& api) const override;
       virtual const std::string& get_current_period_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 LuaScriptManager {
index b6b1416d1f73e384169dae76bf80996a99a2fff7..d3d6c2f88326f179fa7aa0bcde6426723f82dadc 100644 (file)
@@ -2817,7 +2817,7 @@ const std::string& RadosZone::get_current_period_id()
   return store->svc()->zone->get_current_period_id();
 }
 
-const std::string& RadosZone::get_tier_type()
+const std::string_view RadosZone::get_tier_type()
 {
   return store->svc()->zone->get_zone().tier_type;
 }
index 37bc2baf9a6c1e71d54d79f791c479461e5fd79d..57ea7dc0b3aed7d8ebaffb1a4cd6eea79738c1dc 100644 (file)
@@ -358,7 +358,7 @@ class RadosZone : public Zone {
     virtual bool get_redirect_endpoint(std::string* endpoint) override;
     virtual bool has_zonegroup_api(const std::string& api) const override;
     virtual const std::string& get_current_period_id() override;
-    virtual const std::string& get_tier_type() override;
+    virtual const std::string_view get_tier_type() override;
 };
 
 class RadosStore : public Store {