# include "include/libcephsqlite.h"
#endif
-#include "mgr/MgrContext.h"
-
-#include "DaemonServer.h"
-#include "messages/MMgrDigest.h"
+#include "mds/FSMap.h"
#include "messages/MCommand.h"
#include "messages/MCommandReply.h"
+#include "messages/MFSMap.h"
+#include "messages/MKVData.h"
#include "messages/MLog.h"
+#include "messages/MMgrDigest.h"
#include "messages/MServiceMap.h"
-#include "messages/MKVData.h"
+
+#include "MgrContext.h"
+#include "DaemonServer.h"
#include "PyModule.h"
#include "Mgr.h"
daemon_state.cull("mon", names_exist);
}
-bool Mgr::ms_dispatch2(const ref_t<Message>& m)
+Dispatcher::dispatch_result_t Mgr::ms_dispatch2(const ref_t<Message>& m)
{
dout(10) << *m << dendl;
std::lock_guard l(lock);
switch (m->get_type()) {
case MSG_MGR_DIGEST:
handle_mgr_digest(ref_cast<MMgrDigest>(m));
- break;
+ return Dispatcher::HANDLED();
case CEPH_MSG_MON_MAP:
/* MonClient passthrough of MonMap to us */
handle_mon_map(); /* use monc's monmap */
py_module_registry->notify_all("mon_map", "");
- break;
+ return Dispatcher::ACKNOWLEDGED();
case CEPH_MSG_FS_MAP:
handle_fs_map(ref_cast<MFSMap>(m));
py_module_registry->notify_all("fs_map", "");
- return false; // I shall let this pass through for Client
+ return Dispatcher::ACKNOWLEDGED();
case CEPH_MSG_OSD_MAP:
handle_osd_map();
py_module_registry->notify_all("osd_map", "");
// Continuous subscribe, so that we can generate notifications
// for our MgrPyModules
objecter->maybe_request_map();
- break;
+ return Dispatcher::ACKNOWLEDGED();
case MSG_SERVICE_MAP:
handle_service_map(ref_cast<MServiceMap>(m));
//no users: py_module_registry->notify_all("service_map", "");
- break;
+ return Dispatcher::ACKNOWLEDGED();
case MSG_LOG:
handle_log(ref_cast<MLog>(m));
- break;
+ return Dispatcher::HANDLED();
case MSG_KV_DATA:
{
auto msg = ref_cast<MKVData>(m);
}
}
}
- break;
-
+ return Dispatcher::HANDLED();
default:
- return false;
+ return Dispatcher::UNHANDLED();
}
- return true;
}
// Python.h comes first because otherwise it clobbers ceph's assert
#include <Python.h>
-#include "mds/FSMap.h"
-#include "messages/MFSMap.h"
-#include "msg/Messenger.h"
#include "auth/Auth.h"
#include "common/Finisher.h"
#include "mon/MgrMap.h"
+#include "msg/Dispatcher.h"
+#include "msg/Messenger.h"
+#include "ClusterState.h"
#include "DaemonServer.h"
-#include "PyModuleRegistry.h"
-
#include "DaemonState.h"
-#include "ClusterState.h"
+#include "PyModuleRegistry.h"
class MCommand;
class MMgrDigest;
class MLog;
class MServiceMap;
class Objecter;
+class MFSMap;
class Mgr : public AdminSocketHook {
protected:
bool got_mgr_map(const MgrMap& m);
- bool ms_dispatch2(const ceph::ref_t<Message>& m);
+ Dispatcher::dispatch_result_t ms_dispatch2(const ceph::ref_t<Message>& m);
void background_init(Context *completion);
std::lock_guard l(lock);
dout(10) << state_str() << " " << *m << dendl;
+ Dispatcher::dispatch_result_t r;
+
if (m->get_type() == MSG_MGR_MAP) {
handle_mgr_map(ref_cast<MMgrMap>(m));
+ r = Dispatcher::ACKNOWLEDGED();
}
- bool handled = false;
if (active_mgr) {
auto am = active_mgr;
lock.unlock();
- handled = am->ms_dispatch2(m);
+ r = am->ms_dispatch2(m);
lock.lock();
}
- if (m->get_type() == MSG_MGR_MAP) {
- // let this pass through for mgrc
- handled = false;
- }
- return handled;
+ return r;
}