]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: replace get_mon_{addr,inst} with get_mon_addrs
authorSage Weil <sage@redhat.com>
Tue, 10 Jul 2018 18:21:44 +0000 (13:21 -0500)
committerSage Weil <sage@redhat.com>
Mon, 30 Jul 2018 21:00:27 +0000 (16:00 -0500)
Only one user.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonClient.h
src/test/testmsgr.cc

index 7413fcc4037a10f5e4ba9fe659092425f50f774e..2c0f21805934873bcc4297c1e952da8ec99a7666 100644 (file)
@@ -409,17 +409,11 @@ public:
     return monmap.fsid;
   }
 
-  entity_addr_t get_mon_addr(unsigned i) const {
+  entity_addrvec_t get_mon_addrs(unsigned i) const {
     Mutex::Locker l(monc_lock);
     if (i < monmap.size())
-      return monmap.get_addr(i);
-    return entity_addr_t();
-  }
-  entity_inst_t get_mon_inst(unsigned i) const {
-    Mutex::Locker l(monc_lock);
-    if (i < monmap.size())
-      return monmap.get_inst(i);
-    return entity_inst_t();
+      return monmap.get_addrs(i);
+    return entity_addrvec_t();
   }
   int get_num_mon() const {
     Mutex::Locker l(monc_lock);
index 4765757c8e719526b45f848911cf1e272bf04c41..6fb8c85409e7aabe796e72c9d32b0b9ae8d3f92a 100644 (file)
@@ -128,11 +128,11 @@ int main(int argc, const char **argv, const char *envp[]) {
     if (rand() % 10 == 0) {
       //cerr << "mark_down " << t << std::endl;
       dout(0) << "mark_down " << t << dendl;
-      messenger->mark_down(mc.get_mon_addr(t));
+      messenger->mark_down_addrs(mc.get_mon_addrs(t));
     } 
     //cerr << "pinging " << t << std::endl;
     dout(0) << "pinging " << t << dendl;
-    messenger->send_message(new MPing, mc.get_mon_inst(t));
+    messenger->send_to_mon(new MPing, mc.get_mon_addrs(t));
     cerr << isend << "\t" << ++sent << "\t" << received << "\r";
   }
   test_lock.Unlock();