| 102 | } |
| 103 | |
| 104 | Dispatcher::dispatch_result_t MgrClient::ms_dispatch2(const ref_t<Message>& m) |
| 105 | { |
| 106 | std::lock_guard l(lock); |
| 107 | |
| 108 | switch(m->get_type()) { |
| 109 | case MSG_MGR_MAP: |
| 110 | return handle_mgr_map(ref_cast<MMgrMap>(m)); |
| 111 | case MSG_MGR_CONFIGURE: |
| 112 | return handle_mgr_configure(ref_cast<MMgrConfigure>(m)); |
| 113 | case MSG_MGR_CLOSE: |
| 114 | return handle_mgr_close(ref_cast<MMgrClose>(m)); |
| 115 | case MSG_COMMAND_REPLY: |
| 116 | if (m->get_source().type() == CEPH_ENTITY_TYPE_MGR) { |
| 117 | MCommandReply *c = static_cast<MCommandReply*>(m.get()); |
| 118 | handle_command_reply(c->get_tid(), c->get_data(), c->rs, c->r); |
| 119 | return true; |
| 120 | } else { |
| 121 | return false; |
| 122 | } |
| 123 | case MSG_MGR_COMMAND_REPLY: |
| 124 | if (m->get_source().type() == CEPH_ENTITY_TYPE_MGR) { |
| 125 | MMgrCommandReply *c = static_cast<MMgrCommandReply*>(m.get()); |
| 126 | handle_command_reply(c->get_tid(), c->get_data(), c->rs, c->r); |
| 127 | return true; |
| 128 | } else { |
| 129 | return false; |
| 130 | } |
| 131 | default: |
| 132 | ldout(cct, 30) << "Not handling " << *m << dendl; |
| 133 | return false; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | void MgrClient::reconnect() |
| 138 | { |