#include "messages/MMDSMap.h"
#include "messages/MMDSGetMap.h"
#include "messages/MMDSBeacon.h"
+#include "messages/MMDSLoadTargets.h"
#include "messages/MMonCommand.h"
#include "messages/MGenericMessage.h"
return preprocess_command((MMonCommand*)m);
case MSG_MDS_OFFLOAD_TARGETS:
- return true;
-
- case MSG_MDS_OFFLOAD_COMPLETE:
- return true;
+ return preprocess_offload_targets((MMDSLoadTargets*)m);
default:
assert(0);
return true;
}
+bool MDSMonitor::preprocess_offload_targets(MMDSLoadTargets* m)
+{
+ return (m->targets ==
+ pending_mdsmap.get_mds_info(m->get_orig_source_addr()).export_targets);
+}
+
bool MDSMonitor::prepare_update(PaxosServiceMessage *m)
{
case MSG_MON_COMMAND:
return prepare_command((MMonCommand*)m);
+
+ case MSG_MDS_OFFLOAD_TARGETS:
+ return prepare_offload_targets((MMDSLoadTargets*)m);
default:
assert(0);
return true;
}
+bool MDSMonitor::prepare_offload_targets(MMDSLoadTargets *m)
+{
+ pending_mdsmap.mds_info[m->get_orig_source_addr()].
+ export_targets = m->targets;
+ return true;
+}
+
bool MDSMonitor::should_propose(double& delay)
{
delay = 0.0;
class MMDSBeacon;
class MMDSGetMap;
class MMonCommand;
+class MMDSLoadTargets;
class MDSMonitor : public PaxosService {
public:
bool prepare_beacon(class MMDSBeacon *m);
void handle_mds_getmap(MMDSGetMap *m);
+ bool preprocess_offload_targets(MMDSLoadTargets *m);
+ bool prepare_offload_targets(MMDSLoadTargets *m);
+
bool preprocess_command(MMonCommand *m);
bool prepare_command(MMonCommand *m);