]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/NVMeofGwMon.h: tabbing, line length, formatting
authorSamuel Just <sjust@redhat.com>
Sat, 13 Jul 2024 02:16:02 +0000 (02:16 +0000)
committerAlexander Indenbaum <aindenba@redhat.com>
Wed, 19 Nov 2025 18:41:52 +0000 (20:41 +0200)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 1f470f0388b40bd58eef4191fb825a241f7f076f)

src/mon/NVMeofGwMon.h

index 960a8960ed6c698a399a8fdbede96383b7da9021..acd72dfe0c42d0335d4f26f894d21c25e76ffc47 100644 (file)
 #include "NVMeofGwMap.h"
 
 struct LastBeacon {
-    NvmeGwId gw_id;
-    NvmeGroupKey group_key;
-
-    // Comparison operators to allow usage as a map key
-    bool operator<(const LastBeacon& other) const {
-        if (gw_id != other.gw_id) return gw_id < other.gw_id;
-        return group_key < other.group_key;
-    }
-
-    bool operator==(const LastBeacon& other) const {
-        return gw_id == other.gw_id &&
-               group_key == other.group_key;
-    }
+  NvmeGwId gw_id;
+  NvmeGroupKey group_key;
+
+  // Comparison operators to allow usage as a map key
+  bool operator<(const LastBeacon& other) const {
+    if (gw_id != other.gw_id) return gw_id < other.gw_id;
+    return group_key < other.group_key;
+  }
+
+  bool operator==(const LastBeacon& other) const {
+    return gw_id == other.gw_id &&
+      group_key == other.group_key;
+  }
 };
 
 class NVMeofGwMon: public PaxosService,
                    public md_config_obs_t
 {
-    NVMeofGwMap map;  //NVMeGWMap
-    NVMeofGwMap pending_map;
-    std::map<LastBeacon, ceph::coarse_mono_clock::time_point> last_beacon;
-    ceph::coarse_mono_clock::time_point last_tick;
+  NVMeofGwMap map;  //NVMeGWMap
+  NVMeofGwMap pending_map;
+  std::map<LastBeacon, ceph::coarse_mono_clock::time_point> last_beacon;
+  ceph::coarse_mono_clock::time_point last_tick;
 
 public:
-    NVMeofGwMon(Monitor &mn, Paxos &p, const std::string& service_name): PaxosService(mn, p, service_name) {map.mon = &mn;}
-    ~NVMeofGwMon() override {}
+  NVMeofGwMon(Monitor &mn, Paxos &p, const std::string& service_name)
+    : PaxosService(mn, p, service_name) {
+    map.mon = &mn;
+  }
+  ~NVMeofGwMon() override {}
 
+  // config observer
+  const char** get_tracked_conf_keys() const override;
+  void handle_conf_change(
+    const ConfigProxy& conf, const std::set<std::string> &changed) override {};
 
-    // config observer
-    const char** get_tracked_conf_keys() const override;
-    void handle_conf_change(const ConfigProxy& conf, const std::set<std::string> &changed) override {};
+  // 3 pure virtual methods of the paxosService
+  void create_initial() override {};
+  void create_pending() override;
+  void encode_pending(MonitorDBStore::TransactionRef t) override;
 
-    // 3 pure virtual methods of the paxosService
-    void create_initial() override {};
-    void create_pending() override;
-    void encode_pending(MonitorDBStore::TransactionRef t) override;
+  void init() override;
+  void on_shutdown() override;
+  void on_restart() override;
+  void update_from_paxos(bool *need_bootstrap) override;
 
-    void init() override;
-    void on_shutdown() override;
-    void on_restart() override;
-    void update_from_paxos(bool *need_bootstrap) override;
+  version_t get_trim_to() const override;
 
-    version_t get_trim_to() const override;
+  bool preprocess_query(MonOpRequestRef op) override;
+  bool prepare_update(MonOpRequestRef op) override;
 
-    bool preprocess_query(MonOpRequestRef op) override;
-    bool prepare_update(MonOpRequestRef op) override;
+  bool preprocess_command(MonOpRequestRef op);
+  bool prepare_command(MonOpRequestRef op);
 
-    bool preprocess_command(MonOpRequestRef op);
-    bool prepare_command(MonOpRequestRef op);
+  void encode_full(MonitorDBStore::TransactionRef t) override {}
 
-    void encode_full(MonitorDBStore::TransactionRef t) override { }
+  bool preprocess_beacon(MonOpRequestRef op);
+  bool prepare_beacon(MonOpRequestRef op);
 
-    bool preprocess_beacon(MonOpRequestRef op);
-    bool prepare_beacon(MonOpRequestRef op);
+  void tick() override;
+  void print_summary(ceph::Formatter *f, std::ostream *ss) const;
 
-    void tick() override;
-    void print_summary(ceph::Formatter *f, std::ostream *ss) const;
-
-    void check_subs(bool type);
-    void check_sub(Subscription *sub);
+  void check_subs(bool type);
+  void check_sub(Subscription *sub);
 
 private:
-    void synchronize_last_beacon();
+  void synchronize_last_beacon();
 
 };