From: Casey Bodley Date: Tue, 11 Jul 2023 14:00:24 +0000 (-0400) Subject: rgw/sal: add ZoneGroup::supports() X-Git-Tag: v18.1.3~40^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=697e1c58220174db39ad214f5b98d069d0ca5c1a;p=ceph.git rgw/sal: add ZoneGroup::supports() Signed-off-by: Casey Bodley --- diff --git a/src/rgw/driver/rados/rgw_sal_rados.h b/src/rgw/driver/rados/rgw_sal_rados.h index 7f8a7e7b5722..d2ba6300e814 100644 --- a/src/rgw/driver/rados/rgw_sal_rados.h +++ b/src/rgw/driver/rados/rgw_sal_rados.h @@ -88,6 +88,9 @@ public: virtual int get_zone_by_id(const std::string& id, std::unique_ptr* zone) override; virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) override; virtual int list_zones(std::list& zone_ids) override; + bool supports(std::string_view feature) const override { + return group.supports(feature); + } virtual std::unique_ptr clone() override { return std::make_unique(store, group); } diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 9d2efccc70a3..9b379572d8c2 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -1500,6 +1500,8 @@ public: virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) = 0; /** List zones in zone group by ID */ virtual int list_zones(std::list& zone_ids) = 0; + /// Return true if the given feature is enabled in the zonegroup. + virtual bool supports(std::string_view feature) const = 0; /** Clone a copy of this zonegroup. */ virtual std::unique_ptr clone() = 0; }; diff --git a/src/rgw/rgw_sal_daos.h b/src/rgw/rgw_sal_daos.h index 3403b30a488f..b381156f9931 100644 --- a/src/rgw/rgw_sal_daos.h +++ b/src/rgw/rgw_sal_daos.h @@ -431,6 +431,9 @@ class DaosZoneGroup : public StoreZoneGroup { virtual int get_zone_count() const override { return group.zones.size(); } virtual int get_placement_tier(const rgw_placement_rule& rule, std::unique_ptr* tier); + bool supports(std::string_view feature) const override { + return group.supports(feature); + } virtual std::unique_ptr clone() override { return std::make_unique(store, group); } diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index b2dd3d71e93e..7fefd20afbdf 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -300,6 +300,9 @@ protected: zone_ids.clear(); return 0; } + bool supports(std::string_view feature) const override { + return group->supports(feature); + } virtual std::unique_ptr clone() override { std::unique_ptrzg = std::make_unique(*group.get()); return std::make_unique(store, std::move(zg)); diff --git a/src/rgw/rgw_sal_filter.h b/src/rgw/rgw_sal_filter.h index b1a4ecbd9234..a01c1e56c6ed 100644 --- a/src/rgw/rgw_sal_filter.h +++ b/src/rgw/rgw_sal_filter.h @@ -83,6 +83,9 @@ public: virtual int get_zone_by_name(const std::string& name, std::unique_ptr* zone) override; virtual int list_zones(std::list& zone_ids) override { return next->list_zones(zone_ids); } + bool supports(std::string_view feature) const override { + return next->supports(feature); + } virtual std::unique_ptr clone() override { std::unique_ptr nzg = next->clone(); return std::make_unique(std::move(nzg)); diff --git a/src/rgw/rgw_sal_motr.h b/src/rgw/rgw_sal_motr.h index 91f67a20b638..f2dfda2c510c 100644 --- a/src/rgw/rgw_sal_motr.h +++ b/src/rgw/rgw_sal_motr.h @@ -471,6 +471,9 @@ public: return 0; } const RGWZoneGroup& get_group() { return group; } + bool supports(std::string_view feature) const override { + return group.supports(features); + } virtual std::unique_ptr clone() override { return std::make_unique(store, group); }