Skip to content

Commit 1f470f0

Browse files
committed
mon/NVMeofGwMon.h: tabbing, line length, formatting
Signed-off-by: Samuel Just <[email protected]>
1 parent 58d16c7 commit 1f470f0

File tree

1 file changed

+47
-44
lines changed

1 file changed

+47
-44
lines changed

src/mon/NVMeofGwMon.h

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -18,69 +18,72 @@
1818
#include "NVMeofGwMap.h"
1919

2020
struct LastBeacon {
21-
NvmeGwId gw_id;
22-
NvmeGroupKey group_key;
23-
24-
// Comparison operators to allow usage as a map key
25-
bool operator<(const LastBeacon& other) const {
26-
if (gw_id != other.gw_id) return gw_id < other.gw_id;
27-
return group_key < other.group_key;
28-
}
29-
30-
bool operator==(const LastBeacon& other) const {
31-
return gw_id == other.gw_id &&
32-
group_key == other.group_key;
33-
}
21+
NvmeGwId gw_id;
22+
NvmeGroupKey group_key;
23+
24+
// Comparison operators to allow usage as a map key
25+
bool operator<(const LastBeacon& other) const {
26+
if (gw_id != other.gw_id) return gw_id < other.gw_id;
27+
return group_key < other.group_key;
28+
}
29+
30+
bool operator==(const LastBeacon& other) const {
31+
return gw_id == other.gw_id &&
32+
group_key == other.group_key;
33+
}
3434
};
3535

3636
class NVMeofGwMon: public PaxosService,
3737
public md_config_obs_t
3838
{
39-
NVMeofGwMap map; //NVMeGWMap
40-
NVMeofGwMap pending_map;
41-
std::map<LastBeacon, ceph::coarse_mono_clock::time_point> last_beacon;
42-
ceph::coarse_mono_clock::time_point last_tick;
39+
NVMeofGwMap map; //NVMeGWMap
40+
NVMeofGwMap pending_map;
41+
std::map<LastBeacon, ceph::coarse_mono_clock::time_point> last_beacon;
42+
ceph::coarse_mono_clock::time_point last_tick;
4343

4444
public:
45-
NVMeofGwMon(Monitor &mn, Paxos &p, const std::string& service_name): PaxosService(mn, p, service_name) {map.mon = &mn;}
46-
~NVMeofGwMon() override {}
45+
NVMeofGwMon(Monitor &mn, Paxos &p, const std::string& service_name)
46+
: PaxosService(mn, p, service_name) {
47+
map.mon = &mn;
48+
}
49+
~NVMeofGwMon() override {}
4750

51+
// config observer
52+
const char** get_tracked_conf_keys() const override;
53+
void handle_conf_change(
54+
const ConfigProxy& conf, const std::set<std::string> &changed) override {};
4855

49-
// config observer
50-
const char** get_tracked_conf_keys() const override;
51-
void handle_conf_change(const ConfigProxy& conf, const std::set<std::string> &changed) override {};
56+
// 3 pure virtual methods of the paxosService
57+
void create_initial() override {};
58+
void create_pending() override;
59+
void encode_pending(MonitorDBStore::TransactionRef t) override;
5260

53-
// 3 pure virtual methods of the paxosService
54-
void create_initial() override {};
55-
void create_pending() override;
56-
void encode_pending(MonitorDBStore::TransactionRef t) override;
61+
void init() override;
62+
void on_shutdown() override;
63+
void on_restart() override;
64+
void update_from_paxos(bool *need_bootstrap) override;
5765

58-
void init() override;
59-
void on_shutdown() override;
60-
void on_restart() override;
61-
void update_from_paxos(bool *need_bootstrap) override;
66+
version_t get_trim_to() const override;
6267

63-
version_t get_trim_to() const override;
68+
bool preprocess_query(MonOpRequestRef op) override;
69+
bool prepare_update(MonOpRequestRef op) override;
6470

65-
bool preprocess_query(MonOpRequestRef op) override;
66-
bool prepare_update(MonOpRequestRef op) override;
71+
bool preprocess_command(MonOpRequestRef op);
72+
bool prepare_command(MonOpRequestRef op);
6773

68-
bool preprocess_command(MonOpRequestRef op);
69-
bool prepare_command(MonOpRequestRef op);
74+
void encode_full(MonitorDBStore::TransactionRef t) override {}
7075

71-
void encode_full(MonitorDBStore::TransactionRef t) override { }
76+
bool preprocess_beacon(MonOpRequestRef op);
77+
bool prepare_beacon(MonOpRequestRef op);
7278

73-
bool preprocess_beacon(MonOpRequestRef op);
74-
bool prepare_beacon(MonOpRequestRef op);
79+
void tick() override;
80+
void print_summary(ceph::Formatter *f, std::ostream *ss) const;
7581

76-
void tick() override;
77-
void print_summary(ceph::Formatter *f, std::ostream *ss) const;
78-
79-
void check_subs(bool type);
80-
void check_sub(Subscription *sub);
82+
void check_subs(bool type);
83+
void check_sub(Subscription *sub);
8184

8285
private:
83-
void synchronize_last_beacon();
86+
void synchronize_last_beacon();
8487

8588
};
8689

0 commit comments

Comments
 (0)