From 4964511adef28729e54e9cf361d6684a3ac20e01 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 9 Dec 2008 14:20:44 -0800 Subject: [PATCH] kclient: missing files --- src/messages/MMonObserve.h | 58 ++++++++++++++++++++++++++++++++ src/messages/MMonObserveNotify.h | 53 +++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 src/messages/MMonObserve.h create mode 100644 src/messages/MMonObserveNotify.h diff --git a/src/messages/MMonObserve.h b/src/messages/MMonObserve.h new file mode 100644 index 0000000000000..d3a4e682ad219 --- /dev/null +++ b/src/messages/MMonObserve.h @@ -0,0 +1,58 @@ +// -*- 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) 2004-2006 Sage Weil + * + * 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 __MMONOBSERVE_H +#define __MMONOBSERVE_H + +#include "msg/Message.h" + +#include +using std::vector; + +class MMonObserve : public Message { + public: + ceph_fsid fsid; + vector cmd; + uint32_t monitor_id; + version_t ver; + + MMonObserve() : Message(MSG_MON_OBSERVE) {} + MMonObserve(ceph_fsid &f, int mon_id, version_t v) : + Message(MSG_MON_OBSERVE), + fsid(f), monitor_id(mon_id), ver(v) { } + + const char *get_type_name() { return "mon_observe"; } + void print(ostream& o) { + o << "observe("; + for (unsigned i=0; i + * + * 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 __MMONOBSERVENOTIFY_H +#define __MMONOBSERVENOTIFY_H + +#include "msg/Message.h" + +class MMonObserveNotify : public Message { + public: + int32_t machine_id; + bufferlist bl; + version_t ver; + int8_t is_incremental; + + MMonObserveNotify() : Message(MSG_MON_OBSERVE_NOTIFY), + ver(0), is_incremental(false) {} + MMonObserveNotify(int id, bufferlist& b, version_t v, bool incremental) : + Message(MSG_MON_OBSERVE_NOTIFY), machine_id(id), bl(b), ver(v), is_incremental(incremental) {} + + + const char *get_type_name() { return "mon_observe_notify"; } + void print(ostream& o) { + o << "mon_observe_notify() ver=" << ver; + } + + void encode_payload() { + ::encode(machine_id, payload); + ::encode(bl, payload); + ::encode(ver, payload); + ::encode(is_incremental, payload); + } + void decode_payload() { + bufferlist::iterator p = payload.begin(); + ::decode(machine_id, p); + ::decode(bl, p); + ::decode(ver, p); + ::decode(is_incremental, p); + } +}; + +#endif -- 2.39.5