]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/ConfigKeyService: remove unused bits
authorKefu Chai <kchai@redhat.com>
Sat, 28 Nov 2020 13:23:38 +0000 (21:23 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 6 Dec 2020 15:15:40 +0000 (23:15 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/ConfigKeyService.cc
src/mon/ConfigKeyService.h

index 4f5c937001fe326d2c26fa583c35d37421daad72..3e713833edf9647dce538d2a1e9c877cfa2833d4 100644 (file)
@@ -59,36 +59,19 @@ using ceph::parse_timespan;
 using ceph::timespan_str;
 
 static ostream& _prefix(std::ostream *_dout, const Monitor &mon,
-                        const ConfigKeyService *service) {
+                        const ConfigKeyService *service)
+{
   return *_dout << "mon." << mon.name << "@" << mon.rank
-               << "(" << mon.get_state_name() << ")." << service->get_name()
-                << "(" << service->get_epoch() << ") ";
+               << "(" << mon.get_state_name() << ")." << service->get_name();
 }
 
 const string CONFIG_PREFIX = "mon_config_key";
 
 ConfigKeyService::ConfigKeyService(Monitor &m, Paxos &p)
   : mon(m),
-    paxos(p),
-    tick_period(g_conf()->mon_tick_interval)
+    paxos(p)
 {}
 
-void ConfigKeyService::start(epoch_t new_epoch)
-{
-  epoch = new_epoch;
-  start_epoch();
-}
-
-void ConfigKeyService::finish()
-{
-  generic_dout(20) << "ConfigKeyService::finish" << dendl;
-  finish_epoch();
-}
-
-epoch_t ConfigKeyService::get_epoch() const {
-  return epoch;
-}
-
 bool ConfigKeyService::dispatch(MonOpRequestRef op) {
   return service_dispatch(op);
 }
@@ -98,48 +81,6 @@ bool ConfigKeyService::in_quorum() const
   return (mon.is_leader() || mon.is_peon());
 }
 
-void ConfigKeyService::start_tick()
-{
-  generic_dout(10) << __func__ << dendl;
-
-  cancel_tick();
-  if (tick_period <= 0)
-    return;
-
-  tick_event = new C_MonContext{&mon, [this](int r) {
-    if (r < 0) {
-      return;
-    }
-    tick();
-  }};
-  mon.timer.add_event_after(tick_period, tick_event);
-}
-
-void ConfigKeyService::set_update_period(double t)
-{
-  tick_period = t;
-}
-
-void ConfigKeyService::cancel_tick()
-{
-  if (tick_event)
-    mon.timer.cancel_event(tick_event);
-  tick_event = nullptr;
-}
-
-void ConfigKeyService::tick()
-{
-  service_tick();
-  start_tick();
-}
-
-void ConfigKeyService::shutdown()
-{
-  generic_dout(0) << "quorum service shutdown" << dendl;
-  cancel_tick();
-  service_shutdown();
-}
-
 int ConfigKeyService::store_get(const string &key, bufferlist &bl)
 {
   return mon.store->get(CONFIG_PREFIX, key, bl);
index 3d0dfebe3bf44a8c840a6558d4d0a5b759c78cf6..412ae424f0dc895a8f6849c0ab9822c9c326a70b 100644 (file)
@@ -24,28 +24,12 @@ class Monitor;
 class ConfigKeyService
 {
 public:
-  enum {
-    SERVICE_HEALTH     = 0x01,
-    SERVICE_TIMECHECK  = 0x02,
-    SERVICE_CONFIG_KEY = 0x03,
-  };
   ConfigKeyService(Monitor &m, Paxos &p);
   ~ConfigKeyService() {}
 
-  void start(epoch_t new_epoch);
-  void finish();
-  void shutdown();
-
-  void init() { }
   bool dispatch(MonOpRequestRef op);
   bool service_dispatch(MonOpRequestRef op);
 
-  void start_epoch() { }
-  void finish_epoch() { }
-  epoch_t get_epoch() const;
-  void cleanup() { }
-  void service_tick() { }
-
   int validate_osd_destroy(const int32_t id, const uuid_d& uuid);
   void do_osd_destroy(int32_t id, uuid_d& uuid);
   int validate_osd_new(
@@ -54,33 +38,17 @@ public:
       std::stringstream& ss);
   void do_osd_new(const uuid_d& uuid, const std::string& dmcrypt_key);
 
-  int get_type() {
-    return SERVICE_CONFIG_KEY;
-  }
-
   std::string get_name() const {
     return "config_key";
   }
   void get_store_prefixes(std::set<std::string>& s) const;
 
-protected:
-  void service_shutdown() { }
-
 private:
   Monitor &mon;
   Paxos &paxos;
-  epoch_t epoch = 0;
 
   bool in_quorum() const;
 
-  void start_tick();
-  void cancel_tick();
-  void tick();
-  void set_update_period(double t);
-
-  Context *tick_event = nullptr;
-  double tick_period;
-
   int store_get(const std::string &key, ceph::buffer::list &bl);
   void store_put(const std::string &key, ceph::buffer::list &bl, Context *cb = NULL);
   void store_delete(MonitorDBStore::TransactionRef t, const std::string &key);