]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Messenger: add per-type connect_to_* and send_to_*
authorSage Weil <sage@redhat.com>
Wed, 30 May 2018 15:57:00 +0000 (10:57 -0500)
committerSage Weil <sage@redhat.com>
Thu, 31 May 2018 11:49:56 +0000 (06:49 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/Messenger.h

index 07807435e02a77eb19fbdc3cc0be8b391d4d2461..ebb84566ffb578e629d2cdf596252103eda154e6 100644 (file)
@@ -504,6 +504,22 @@ public:
     return send_message(m, entity_inst_t(entity_name_t(type, -1),
                                         addr.legacy_addr()));
   }
+  int send_to_mon(
+    Message *m, const entity_addrvec_t& addrs) {
+    return send_to(m, CEPH_ENTITY_TYPE_MON, addrs);
+  }
+  int send_to_mds(
+    Message *m, const entity_addrvec_t& addrs) {
+    return send_to(m, CEPH_ENTITY_TYPE_MDS, addrs);
+  }
+  int send_to_osd(
+    Message *m, const entity_addrvec_t& addrs) {
+    return send_to(m, CEPH_ENTITY_TYPE_OSD, addrs);
+  }
+  int send_to_mgr(
+    Message *m, const entity_addrvec_t& addrs) {
+    return send_to(m, CEPH_ENTITY_TYPE_MGR, addrs);
+  }
 
   /**
    * @} // Messaging
@@ -528,6 +544,18 @@ public:
     return get_connection(entity_inst_t(entity_name_t(type, -1),
                                        dest.legacy_addr()));
   }
+  ConnectionRef connect_to_mon(const entity_addrvec_t& dest) {
+    return connect_to(CEPH_ENTITY_TYPE_MON, dest);
+  }
+  ConnectionRef connect_to_mds(const entity_addrvec_t& dest) {
+    return connect_to(CEPH_ENTITY_TYPE_MDS, dest);
+  }
+  ConnectionRef connect_to_osd(const entity_addrvec_t& dest) {
+    return connect_to(CEPH_ENTITY_TYPE_OSD, dest);
+  }
+  ConnectionRef connect_to_mgr(const entity_addrvec_t& dest) {
+    return connect_to(CEPH_ENTITY_TYPE_MGR, dest);
+  }
 
   /**
    * Get the Connection object associated with ourselves.
@@ -551,6 +579,9 @@ public:
    * @param a The address to mark down.
    */
   virtual void mark_down(const entity_addr_t& a) = 0;
+  virtual void mark_down_addrs(const entity_addrvec_t& a) {
+    mark_down(a.legacy_addr());
+  }
   /**
    * Mark all the existing Connections down. This is equivalent
    * to iterating over all Connections and calling mark_down()