messages/MMonObserve.h\
messages/MMonObserveNotify.h\
messages/MMonPaxos.h\
- messages/MMonAdd.h\
messages/MMonSubscribe.h\
messages/MMonSubscribeAck.h\
messages/MOSDAlive.h\
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2009 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software
- * Foundation. See file COPYING.
- *
- */
-
-#ifndef __MMONADD_H
-#define __MMONADD_H
-
-#include "msg/Message.h"
-#include "include/types.h"
-
-#include "mon/MonMap.h"
-#include "config.h"
-
-class MMonAdd : public Message {
- public:
- entity_addr_t address;
-
- MMonAdd() : Message(MSG_MON_ADD) {}
- MMonAdd(const char *ip) : Message(MSG_MON_ADD) {
- parse_ip_port(ip, address);}
- MMonAdd(const struct entity_addr_t& addr) :
- Message(MSG_MON_ADD), address(addr) {}
-
- const char* get_type_name() { return "mon_add"; }
- void print (ostream& o) { o << "mon_add(" << address << ")"; }
-
- void decode_payload() {
- bufferlist::iterator p = payload.begin();
- ::decode(address, p);
- }
-
- void encode_payload() {
- ::encode(address, payload);
- }
-};
-
-#endif
clientmon()->dispatch(m);
return;
}
+ if (m->cmd[0] == "mon") {
+ monmon()->dispatch(m);
+ return;
+ }
if (m->cmd[0] == "stop") {
shutdown();
reply_command(m, 0, "stopping", 0);
#include "Monitor.h"
#include "MonitorStore.h"
-#include "messages/MMonAdd.h"
+#include "messages/MMonCommand.h"
#include "common/Timer.h"
#include <sstream>
bool MonmapMonitor::prepare_update(PaxosServiceMessage *message)
{
- MMonAdd *m = (MMonAdd *) message;
- pending_map.add(m->address);
+ MMonCommand *m = (MMonCommand *) message;
+ if (m->cmd[1] != "add") {
+ dout(0) << "Unrecognized MonmapMonitor command!" << dendl;
+ delete message;
+ return false;
+ }
+ entity_addr_t addr;
+ parse_ip_port(m->cmd[2].c_str(), addr);
+ pending_map.add(addr);
pending_map.last_changed = g_clock.now();
delete message;
return true;
#include "messages/MMonCommand.h"
#include "messages/MMonCommandAck.h"
#include "messages/MMonPaxos.h"
-#include "messages/MMonAdd.h"
#include "messages/MMonObserve.h"
#include "messages/MMonObserveNotify.h"
case MSG_MON_PAXOS:
m = new MMonPaxos;
break;
- case MSG_MON_ADD:
- m = new MMonAdd;
- break;
case MSG_MON_ELECTION:
m = new MMonElection;
// monitor internal
#define MSG_MON_ELECTION 60
#define MSG_MON_PAXOS 61
-#define MSG_MON_ADD 62
/* monitor <-> mon admin tool */
#define MSG_MON_COMMAND 50
#define MSG_MON_COMMAND_ACK 51