]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
messages: Add an MMDSLoadTargets message for mds->monitor info.
authorGreg Farnum <gregf@hq.newdream.net>
Tue, 29 Sep 2009 23:37:28 +0000 (16:37 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Fri, 2 Oct 2009 22:22:09 +0000 (15:22 -0700)
src/Makefile.am
src/messages/MMDSLoadTargets.h [new file with mode: 0644]

index 832b71a3c9153d712b2a06f69b815189cb9ef1f5..becebea52c188c8bb6980c9090d174c372bc57c5 100644 (file)
@@ -603,6 +603,7 @@ noinst_HEADERS = \
         messages/MMDSBeacon.h\
         messages/MMDSBoot.h\
         messages/MMDSCacheRejoin.h\
+       messages/MMDSLoadTargets.h\
         messages/MMDSFragmentNotify.h\
         messages/MMDSGetMap.h\
         messages/MMDSMap.h\
diff --git a/src/messages/MMDSLoadTargets.h b/src/messages/MMDSLoadTargets.h
new file mode 100644 (file)
index 0000000..14f5632
--- /dev/null
@@ -0,0 +1,46 @@
+// -*- 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 __MMDSLoadTargets_H
+#define __MMDSLoadTargets_H
+
+#include "msg/Message.h"
+#include "include/types.h"
+
+#include <map>
+using std::map;
+
+class MMDSLoadTargets : public Message {
+ public:
+  map<int, double> targets;
+
+  MMDSLoadTargets() : Message(MSG_MDS_OFFLOAD_TARGETS) {}
+
+  MMDSLoadTargets(map<int, double>& mds_targets) :
+    Message(MSG_MDS_OFFLOAD_TARGETS),
+    targets(mds_targets) {}
+
+  const char* get_type_name() { return "mds_load_targets"; }
+
+  void decode_payload() {
+    bufferlist::iterator p = payload.begin();
+    ::decode(targets, p);
+  }
+
+  void encode_payload() {
+    ::encode(targets, payload);
+  }
+};
+
+#endif