]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgwlc: return std::string_view from sal::Zone::get_tier_type()
authorMatt Benjamin <mbenjamin@redhat.com>
Fri, 15 Jul 2022 15:01:15 +0000 (11:01 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Sun, 17 Jul 2022 22:38:30 +0000 (18:38 -0400)
Valid values are all small strings, often static.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_sal.h
src/rgw/rgw_sal_dbstore.h
src/rgw/rgw_sal_motr.h
src/rgw/rgw_sal_rados.cc
src/rgw/rgw_sal_rados.h

index b2542772a6df29daa5ef8b850db9d0ea4a37d4ff..799af26367db6d64799fa24714f0bdef9d56a22e 100644 (file)
@@ -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;
 };
 
 /**
index a5074d9a67bef57d2669a63cfb29fee3d04f085a..239211de6c851c767cd7b16b1f4b2c9128f3133c 100644 (file)
@@ -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 {
index 130bcfbc9ec81995e9870cacd15a4e2d18568c74..e2684637ca24c2432d6981177b81dd95cd97b74d 100644 (file)
@@ -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;
 };
 
index 22ae73d3a63ca87009ec91eb96b769c83c4602e9..e39b03f2511a13955267e767385fac8816fb7728 100644 (file)
@@ -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;
 }
index 693c0569b7e0d13004c7505c30f21f5a7dfad284..47fcb12797f66583bfcf4c280895efc4254b7155 100644 (file)
@@ -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 {