]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Messenger: add send_to() and connect_to() addrvec-base variants
authorSage Weil <sage@redhat.com>
Tue, 29 May 2018 21:27:30 +0000 (16:27 -0500)
committerSage Weil <sage@redhat.com>
Thu, 31 May 2018 11:49:56 +0000 (06:49 -0500)
For now, just wrap the existing methods and assume all addrs are legacy
addrs.  (That will change soon.)

Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/Messenger.h

index eb3541780364b4e240662c55eb4cf1e3918957f0..07807435e02a77eb19fbdc3cc0be8b391d4d2461 100644 (file)
@@ -496,6 +496,15 @@ public:
    */
   virtual int send_message(Message *m, const entity_inst_t& dest) = 0;
 
+  virtual int send_to(
+    Message *m,
+    int type,
+    const entity_addrvec_t& addr) {
+    // temporary
+    return send_message(m, entity_inst_t(entity_name_t(type, -1),
+                                        addr.legacy_addr()));
+  }
+
   /**
    * @} // Messaging
    */
@@ -512,6 +521,14 @@ public:
    * @param dest The entity to get a connection for.
    */
   virtual ConnectionRef get_connection(const entity_inst_t& dest) = 0;
+
+  virtual ConnectionRef connect_to(
+    int type, const entity_addrvec_t& dest) {
+    // temporary
+    return get_connection(entity_inst_t(entity_name_t(type, -1),
+                                       dest.legacy_addr()));
+  }
+
   /**
    * Get the Connection object associated with ourselves.
    */