#include "messages/PaxosServiceMessage.h"
-struct MAuth : public PaxosServiceMessage {
+class MAuth : public PaxosServiceMessage {
+public:
+ typedef boost::intrusive_ptr<MAuth> ref;
+ typedef boost::intrusive_ptr<MAuth const> const_ref;
+ using factory = MessageFactory<MAuth>;
+ friend factory;
+
__u32 protocol;
bufferlist auth_payload;
epoch_t monmap_epoch;
#include "msg/Message.h"
#include "common/errno.h"
-struct MAuthReply : public Message {
+class MAuthReply : public Message {
+public:
+ typedef boost::intrusive_ptr<MAuthReply> ref;
+ typedef boost::intrusive_ptr<MAuthReply const> const_ref;
+ using factory = MessageFactory<MAuthReply>;
+ friend factory;
+
__u32 protocol;
errorcode32_t result;
uint64_t global_id; // if zero, meaningless
#include "messages/MOSDPeeringOp.h"
class MBackfillReserve : public MOSDPeeringOp {
+public:
+ typedef boost::intrusive_ptr<MBackfillReserve> ref;
+ typedef boost::intrusive_ptr<MBackfillReserve const> const_ref;
+ using factory = MessageFactory<MBackfillReserve>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 4;
public:
#include "mds/mdstypes.h"
class MCacheExpire : public Message {
- __s32 from;
-
public:
typedef boost::intrusive_ptr<MCacheExpire> ref;
typedef boost::intrusive_ptr<MCacheExpire const> const_ref;
+ using factory = MessageFactory<MCacheExpire>;
+ friend factory;
+private:
+ __s32 from;
+
+public:
/*
group things by realm (auth delgation root), since that's how auth is determined.
that makes it less work to process when exports are in progress.
class MClientCapRelease : public Message {
+public:
+ typedef boost::intrusive_ptr<MClientCapRelease> ref;
+ typedef boost::intrusive_ptr<MClientCapRelease const> const_ref;
+ using factory = MessageFactory<MClientCapRelease>;
+ friend factory;
+
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
public:
- typedef boost::intrusive_ptr<MClientCapRelease> ref;
- typedef boost::intrusive_ptr<MClientCapRelease const> const_ref;
struct ceph_mds_cap_release head;
vector<ceph_mds_cap_item> caps;
#include "include/ceph_features.h"
class MClientCaps : public Message {
+public:
+ typedef boost::intrusive_ptr<MClientCaps> ref;
+ typedef boost::intrusive_ptr<MClientCaps const> const_ref;
+ using factory = MessageFactory<MClientCaps>;
+ friend factory;
+private:
+
static const int HEAD_VERSION = 11;
static const int COMPAT_VERSION = 1;
public:
- typedef boost::intrusive_ptr<MClientCaps> ref;
- typedef boost::intrusive_ptr<MClientCaps const> const_ref;
-
static const unsigned FLAG_SYNC = (1<<0);
static const unsigned FLAG_NO_CAPSNAP = (1<<1); // unused
static const unsigned FLAG_PENDING_CAPSNAP = (1<<2);
public:
typedef boost::intrusive_ptr<MClientLease> ref;
typedef boost::intrusive_ptr<MClientLease const> const_ref;
+ using factory = MessageFactory<MClientLease>;
+ friend factory;
struct ceph_mds_lease h;
std::string dname;
#include "msg/Message.h"
-struct MClientQuota : public Message {
+class MClientQuota : public Message {
+public:
+ typedef boost::intrusive_ptr<MClientQuota> ref;
+ typedef boost::intrusive_ptr<MClientQuota const> const_ref;
+ using factory = MessageFactory<MClientQuota>;
+ friend factory;
+
inodeno_t ino;
nest_info_t rstat;
quota_info_t quota;
class MClientReconnect : public Message {
-
- const static int HEAD_VERSION = 3;
-
public:
typedef boost::intrusive_ptr<MClientReconnect> ref;
typedef boost::intrusive_ptr<MClientReconnect const> const_ref;
+ using factory = MessageFactory<MClientReconnect>;
+ friend factory;
+private:
+ const static int HEAD_VERSION = 3;
+
+public:
map<inodeno_t, cap_reconnect_t> caps; // only head inodes
vector<ceph_mds_snaprealm_reconnect> realms;
class MClientReply : public Message {
- // reply data
public:
typedef boost::intrusive_ptr<MClientReply> ref;
typedef boost::intrusive_ptr<MClientReply const> const_ref;
+ using factory = MessageFactory<MClientReply>;
+ friend factory;
+
+ // reply data
struct ceph_mds_reply_head head {};
bufferlist trace_bl;
bufferlist extra_bl;
bufferlist snapbl;
- public:
int get_op() const { return head.op; }
void set_mdsmap_epoch(epoch_t e) { head.mdsmap_epoch = e; }
// metadata ops.
class MClientRequest : public Message {
+public:
+ typedef boost::intrusive_ptr<MClientRequest> ref;
+ typedef boost::intrusive_ptr<MClientRequest const> const_ref;
+ using factory = MessageFactory<MClientRequest>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 1;
public:
- typedef boost::intrusive_ptr<MClientRequest> ref;
- typedef boost::intrusive_ptr<MClientRequest const> const_ref;
mutable struct ceph_mds_request_head head; /* XXX HACK! */
utime_t stamp;
#include "msg/Message.h"
class MClientRequestForward : public Message {
+public:
+ typedef boost::intrusive_ptr<MClientRequestForward> ref;
+ typedef boost::intrusive_ptr<MClientRequestForward const> const_ref;
+ using factory = MessageFactory<MClientRequestForward>;
+ friend factory;
+private:
int32_t dest_mds;
int32_t num_fwd;
bool client_must_resend;
#include "mds/mdstypes.h"
class MClientSession : public Message {
+public:
+ typedef boost::intrusive_ptr<MClientSession> ref;
+ typedef boost::intrusive_ptr<MClientSession const> const_ref;
+ using factory = MessageFactory<MClientSession>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
public:
- typedef boost::intrusive_ptr<MClientSession> ref;
- typedef boost::intrusive_ptr<MClientSession const> const_ref;
ceph_mds_session_head head;
std::map<std::string, std::string> metadata;
#include "msg/Message.h"
-struct MClientSnap : public Message {
+class MClientSnap : public Message {
+public:
typedef boost::intrusive_ptr<MClientSnap> ref;
typedef boost::intrusive_ptr<MClientSnap const> const_ref;
+ using factory = MessageFactory<MClientSnap>;
+ friend factory;
ceph_mds_snap_head head;
bufferlist bl;
#include "msg/Message.h"
class MCommand : public Message {
- public:
+public:
typedef boost::intrusive_ptr<MCommand> ref;
typedef boost::intrusive_ptr<MCommand const> const_ref;
+ using factory = MessageFactory<MCommand>;
+ friend factory;
uuid_d fsid;
std::vector<string> cmd;
#include "MCommand.h"
class MCommandReply : public Message {
- public:
+public:
+ typedef boost::intrusive_ptr<MCommandReply> ref;
+ typedef boost::intrusive_ptr<MCommandReply const> const_ref;
+ using factory = MessageFactory<MCommandReply>;
+ friend factory;
+
errorcode32_t r;
string rs;
#include "msg/Message.h"
-struct MConfig : public Message {
+class MConfig : public Message {
+public:
+ typedef boost::intrusive_ptr<MConfig> ref;
+ typedef boost::intrusive_ptr<MConfig const> const_ref;
+ using factory = MessageFactory<MConfig>;
+ friend factory;
+
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
typedef void (*mdata_hook_func)(struct xio_reg_mem *mp);
class MDataPing : public Message {
-
- public:
+public:
+ typedef boost::intrusive_ptr<MDataPing> ref;
+ typedef boost::intrusive_ptr<MDataPing const> const_ref;
+ using factory = MessageFactory<MDataPing>;
+ friend factory;
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
#include "msg/Message.h"
class MDentryLink : public Message {
+public:
+ typedef boost::intrusive_ptr<MDentryLink> ref;
+ typedef boost::intrusive_ptr<MDentryLink const> const_ref;
+ using factory = MessageFactory<MDentryLink>;
+ friend factory;
+private:
dirfrag_t subtree;
dirfrag_t dirfrag;
string dn;
bool is_primary = false;
public:
- typedef boost::intrusive_ptr<MDentryLink> ref;
- typedef boost::intrusive_ptr<MDentryLink const> const_ref;
dirfrag_t get_subtree() const { return subtree; }
dirfrag_t get_dirfrag() const { return dirfrag; }
const string& get_dn() const { return dn; }
#include "msg/Message.h"
class MDentryUnlink : public Message {
+public:
+ typedef boost::intrusive_ptr<MDentryUnlink> ref;
+ typedef boost::intrusive_ptr<MDentryUnlink const> const_ref;
+ using factory = MessageFactory<MDentryUnlink>;
+ friend factory;
+private:
+
dirfrag_t dirfrag;
string dn;
public:
- typedef boost::intrusive_ptr<MDentryUnlink> ref;
- typedef boost::intrusive_ptr<MDentryUnlink const> const_ref;
dirfrag_t get_dirfrag() const { return dirfrag; }
const string& get_dn() const { return dn; }
public:
typedef boost::intrusive_ptr<MDirUpdate> ref;
typedef boost::intrusive_ptr<MDirUpdate const> const_ref;
+ using factory = MessageFactory<MDirUpdate>;
+ friend factory;
+
MDirUpdate() : Message(MSG_MDS_DIRUPDATE) {}
MDirUpdate(mds_rank_t f,
dirfrag_t dirfrag,
class MDiscover : public Message {
+public:
+ typedef boost::intrusive_ptr<MDiscover> ref;
+ typedef boost::intrusive_ptr<MDiscover const> const_ref;
+ using factory = MessageFactory<MDiscover>;
+ friend factory;
+private:
+
inodeno_t base_ino; // 1 -> root
frag_t base_dir_frag;
bool want_xlocked = false;
public:
- typedef boost::intrusive_ptr<MDiscover> ref;
- typedef boost::intrusive_ptr<MDiscover const> const_ref;
inodeno_t get_base_ino() const { return base_ino; }
frag_t get_base_dir_frag() const { return base_dir_frag; }
snapid_t get_snapid() const { return snapid; }
*/
class MDiscoverReply : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MDiscoverReply> ref;
+ typedef boost::intrusive_ptr<MDiscoverReply const> const_ref;
+ using factory = MessageFactory<MDiscoverReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
// info about original request
mds_rank_t dir_auth_hint = 0;
public:
- typedef boost::intrusive_ptr<MDiscoverReply> ref;
- typedef boost::intrusive_ptr<MDiscoverReply const> const_ref;
__u8 starts_with = 0;
bufferlist trace;
class MExportCaps : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportCaps> ref;
+ typedef boost::intrusive_ptr<MExportCaps const> const_ref;
+ using factory = MessageFactory<MExportCaps>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
public:
- typedef boost::intrusive_ptr<MExportCaps> ref;
- typedef boost::intrusive_ptr<MExportCaps const> const_ref;
inodeno_t ino;
bufferlist cap_bl;
map<client_t,entity_inst_t> client_map;
class MExportCapsAck : public Message {
- public:
+public:
typedef boost::intrusive_ptr<MExportCapsAck> ref;
typedef boost::intrusive_ptr<MExportCapsAck const> const_ref;
+ using factory = MessageFactory<MExportCapsAck>;
+ friend factory;
+
inodeno_t ino;
bufferlist cap_bl;
class MExportDir : public Message {
- public:
+public:
typedef boost::intrusive_ptr<MExportDir>ref;
typedef boost::intrusive_ptr<MExportDir const> const_ref;
+ using factory = MessageFactory<MExportDir>;
+ friend factory;
dirfrag_t dirfrag;
bufferlist export_data;
vector<dirfrag_t> bounds;
public:
typedef boost::intrusive_ptr<MExportDirAck> ref;
typedef boost::intrusive_ptr<MExportDirAck const> const_ref;
+ using factory = MessageFactory<MExportDirAck>;
+ friend factory;
+
dirfrag_t dirfrag;
bufferlist imported_caps;
#include "include/types.h"
class MExportDirCancel : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportDirCancel> ref;
+ typedef boost::intrusive_ptr<MExportDirCancel const> const_ref;
+ using factory = MessageFactory<MExportDirCancel>;
+ friend factory;
+private:
dirfrag_t dirfrag;
public:
- typedef boost::intrusive_ptr<MExportDirCancel> ref;
- typedef boost::intrusive_ptr<MExportDirCancel const> const_ref;
dirfrag_t get_dirfrag() const { return dirfrag; }
MExportDirCancel() : Message(MSG_MDS_EXPORTDIRCANCEL) {}
#include "include/types.h"
class MExportDirDiscover : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportDirDiscover> ref;
+ typedef boost::intrusive_ptr<MExportDirDiscover const> const_ref;
+ using factory = MessageFactory<MExportDirDiscover>;
+ friend factory;
+private:
mds_rank_t from = -1;
dirfrag_t dirfrag;
filepath path;
public:
- typedef boost::intrusive_ptr<MExportDirDiscover> ref;
- typedef boost::intrusive_ptr<MExportDirDiscover const> const_ref;
mds_rank_t get_source_mds() const { return from; }
inodeno_t get_ino() const { return dirfrag.ino; }
dirfrag_t get_dirfrag() const { return dirfrag; }
#include "include/types.h"
class MExportDirDiscoverAck : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportDirDiscoverAck> ref;
+ typedef boost::intrusive_ptr<MExportDirDiscoverAck const> const_ref;
+ using factory = MessageFactory<MExportDirDiscoverAck>;
+ friend factory;
+private:
dirfrag_t dirfrag;
bool success;
public:
- typedef boost::intrusive_ptr<MExportDirDiscoverAck> ref;
- typedef boost::intrusive_ptr<MExportDirDiscoverAck const> const_ref;
inodeno_t get_ino() const { return dirfrag.ino; }
dirfrag_t get_dirfrag() const { return dirfrag; }
bool is_success() const { return success; }
#include "msg/Message.h"
class MExportDirFinish : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportDirFinish> ref;
+ typedef boost::intrusive_ptr<MExportDirFinish const> const_ref;
+ using factory = MessageFactory<MExportDirFinish>;
+ friend factory;
+private:
dirfrag_t dirfrag;
bool last;
public:
- typedef boost::intrusive_ptr<MExportDirFinish> ref;
- typedef boost::intrusive_ptr<MExportDirFinish const> const_ref;
dirfrag_t get_dirfrag() const { return dirfrag; }
bool is_last() const { return last; }
#include "msg/Message.h"
class MExportDirNotify : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportDirNotify> ref;
+ typedef boost::intrusive_ptr<MExportDirNotify const> const_ref;
+ using factory = MessageFactory<MExportDirNotify>;
+ friend factory;
+private:
dirfrag_t base;
bool ack;
pair<__s32,__s32> old_auth, new_auth;
list<dirfrag_t> bounds; // bounds; these dirs are _not_ included (tho the dirfragdes are)
public:
- typedef boost::intrusive_ptr<MExportDirNotify> ref;
- typedef boost::intrusive_ptr<MExportDirNotify const> const_ref;
dirfrag_t get_dirfrag() const { return base; }
pair<__s32,__s32> get_old_auth() const { return old_auth; }
pair<__s32,__s32> get_new_auth() const { return new_auth; }
#include "msg/Message.h"
class MExportDirNotifyAck : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportDirNotifyAck>ref;
+ typedef boost::intrusive_ptr<MExportDirNotifyAck const> const_ref;
+ using factory = MessageFactory<MExportDirNotifyAck>;
+ friend factory;
+private:
dirfrag_t dirfrag;
pair<__s32,__s32> new_auth;
public:
- typedef boost::intrusive_ptr<MExportDirNotifyAck>ref;
- typedef boost::intrusive_ptr<MExportDirNotifyAck const> const_ref;
dirfrag_t get_dirfrag() const { return dirfrag; }
pair<__s32,__s32> get_new_auth() const { return new_auth; }
#include "include/types.h"
class MExportDirPrep : public Message {
- dirfrag_t dirfrag;
- public:
+public:
typedef boost::intrusive_ptr<MExportDirPrep> ref;
typedef boost::intrusive_ptr<MExportDirPrep const> const_ref;
+ using factory = MessageFactory<MExportDirPrep>;
+ friend factory;
+private:
+ dirfrag_t dirfrag;
+ public:
bufferlist basedir;
list<dirfrag_t> bounds;
list<bufferlist> traces;
#include "include/types.h"
class MExportDirPrepAck : public Message {
+public:
+ typedef boost::intrusive_ptr<MExportDirPrepAck> ref;
+ typedef boost::intrusive_ptr<MExportDirPrepAck const> const_ref;
+ using factory = MessageFactory<MExportDirPrepAck>;
+ friend factory;
+private:
dirfrag_t dirfrag;
bool success = false;
public:
- typedef boost::intrusive_ptr<MExportDirPrepAck> ref;
- typedef boost::intrusive_ptr<MExportDirPrepAck const> const_ref;
dirfrag_t get_dirfrag() const { return dirfrag; }
MExportDirPrepAck() {}
#include "include/ceph_features.h"
class MFSMap : public Message {
- public:
+public:
+ typedef boost::intrusive_ptr<MFSMap> ref;
+ typedef boost::intrusive_ptr<MFSMap const> const_ref;
+ using factory = MessageFactory<MFSMap>;
+ friend factory;
+
epoch_t epoch;
bufferlist encoded;
#include "include/ceph_features.h"
class MFSMapUser : public Message {
- public:
+public:
+ typedef boost::intrusive_ptr<MFSMapUser> ref;
+ typedef boost::intrusive_ptr<MFSMapUser const> const_ref;
+ using factory = MessageFactory<MFSMapUser>;
+ friend factory;
+
epoch_t epoch;
version_t get_epoch() const { return epoch; }
#include "include/encoding.h"
#include "include/stringify.h"
-struct MForward : public Message {
+class MForward : public Message {
+public:
+ typedef boost::intrusive_ptr<MForward> ref;
+ typedef boost::intrusive_ptr<MForward const> const_ref;
+ using factory = MessageFactory<MForward>;
+ friend factory;
+
uint64_t tid;
uint8_t client_type;
entity_addrvec_t client_addrs;
public:
typedef boost::intrusive_ptr<MGatherCaps> ref;
typedef boost::intrusive_ptr<MGatherCaps const> const_ref;
+ using factory = MessageFactory<MGatherCaps>;
+ friend factory;
+
inodeno_t ino;
#include "msg/Message.h"
class MGenericMessage : public Message {
+public:
+ typedef boost::intrusive_ptr<MGenericMessage> ref;
+ typedef boost::intrusive_ptr<MGenericMessage const> const_ref;
+ using factory = MessageFactory<MGenericMessage>;
+ friend factory;
+private:
char tname[20];
//long pcid;
#include "msg/Message.h"
-struct MGetConfig : public Message {
+class MGetConfig : public Message {
+public:
+ typedef boost::intrusive_ptr<MGetConfig> ref;
+ typedef boost::intrusive_ptr<MGetConfig const> const_ref;
+ using factory = MessageFactory<MGetConfig>;
+ friend factory;
+
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
class MGetPoolStats : public PaxosServiceMessage {
public:
+ typedef boost::intrusive_ptr<MGetPoolStats> ref;
+ typedef boost::intrusive_ptr<MGetPoolStats const> const_ref;
+ using factory = MessageFactory<MGetPoolStats>;
+ friend factory;
+
uuid_d fsid;
list<string> pools;
class MGetPoolStatsReply : public PaxosServiceMessage {
public:
+ typedef boost::intrusive_ptr<MGetPoolStatsReply> ref;
+ typedef boost::intrusive_ptr<MGetPoolStatsReply const> const_ref;
+ using factory = MessageFactory<MGetPoolStatsReply>;
+ friend factory;
+
uuid_d fsid;
map<string,pool_stat_t> pool_stats;
#include "common/DecayCounter.h"
class MHeartbeat : public Message {
+public:
+ typedef boost::intrusive_ptr<MHeartbeat> ref;
+ typedef boost::intrusive_ptr<MHeartbeat const> const_ref;
+ using factory = MessageFactory<MHeartbeat>;
+ friend factory;
+private:
mds_load_t load;
__s32 beat = 0;
map<mds_rank_t, float> import_map;
public:
- typedef boost::intrusive_ptr<MHeartbeat> ref;
- typedef boost::intrusive_ptr<MHeartbeat const> const_ref;
const mds_load_t& get_load() const { return load; }
int get_beat() const { return beat; }
#include "msg/Message.h"
class MInodeFileCaps : public Message {
+public:
+ typedef boost::intrusive_ptr<MInodeFileCaps> ref;
+ typedef boost::intrusive_ptr<MInodeFileCaps const> const_ref;
+ using factory = MessageFactory<MInodeFileCaps>;
+ friend factory;
+private:
inodeno_t ino;
__u32 caps = 0;
public:
- typedef boost::intrusive_ptr<MInodeFileCaps> ref;
- typedef boost::intrusive_ptr<MInodeFileCaps const> const_ref;
inodeno_t get_ino() const { return ino; }
int get_caps() const { return caps; }
#include "mds/SimpleLock.h"
class MLock : public Message {
+public:
+ typedef boost::intrusive_ptr<MLock> ref;
+ typedef boost::intrusive_ptr<MLock const> const_ref;
+ using factory = MessageFactory<MLock>;
+ friend factory;
+private:
int32_t action = 0; // action type
mds_rank_t asker = 0; // who is initiating this request
metareqid_t reqid; // for remote lock requests
bufferlist lockdata; // and possibly some data
public:
- typedef boost::intrusive_ptr<MLock> ref;
- typedef boost::intrusive_ptr<MLock const> const_ref;
-
bufferlist& get_data() { return lockdata; }
const bufferlist& get_data() const { return lockdata; }
int get_asker() const { return asker; }
int get_lock_type() const { return lock_type; }
const MDSCacheObjectInfo &get_object_info() const { return object_info; }
MDSCacheObjectInfo &get_object_info() { return object_info; }
-
+
MLock() : Message(MSG_MDS_LOCK) {}
MLock(int ac, mds_rank_t as) :
Message(MSG_MDS_LOCK),
class MLog : public PaxosServiceMessage {
public:
+ typedef boost::intrusive_ptr<MLog> ref;
+ typedef boost::intrusive_ptr<MLog const> const_ref;
+ using factory = MessageFactory<MLog>;
+ friend factory;
+
uuid_d fsid;
std::deque<LogEntry> entries;
class MLogAck : public Message {
public:
+ typedef boost::intrusive_ptr<MLogAck> ref;
+ typedef boost::intrusive_ptr<MLogAck const> const_ref;
+ using factory = MessageFactory<MLogAck>;
+ friend factory;
+
uuid_d fsid;
version_t last = 0;
std::string channel;
class MMDSBeacon : public PaxosServiceMessage {
+public:
+ typedef boost::intrusive_ptr<MMDSBeacon> ref;
+ typedef boost::intrusive_ptr<MMDSBeacon const> const_ref;
+ using factory = MessageFactory<MMDSBeacon>;
+ friend factory;
+private:
static const int HEAD_VERSION = 7;
static const int COMPAT_VERSION = 6;
uint64_t mds_features;
public:
- typedef boost::intrusive_ptr<MMDSBeacon> ref;
- typedef boost::intrusive_ptr<MMDSBeacon const> const_ref;
-
MMDSBeacon()
: PaxosServiceMessage(MSG_MDS_BEACON, 0, HEAD_VERSION, COMPAT_VERSION),
global_id(0), state(MDSMap::STATE_NULL), standby_for_rank(MDS_RANK_NONE),
// sent from replica to auth
class MMDSCacheRejoin : public Message {
+public:
+ typedef boost::intrusive_ptr<MMDSCacheRejoin> ref;
+ typedef boost::intrusive_ptr<MMDSCacheRejoin const> const_ref;
+ using factory = MessageFactory<MMDSCacheRejoin>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
public:
- typedef boost::intrusive_ptr<MMDSCacheRejoin> ref;
- typedef boost::intrusive_ptr<MMDSCacheRejoin const> const_ref;
-
static const int OP_WEAK = 1; // replica -> auth, i exist, + maybe open files.
static const int OP_STRONG = 2; // replica -> auth, i exist, + open files and lock state.
static const int OP_ACK = 3; // auth -> replica, here is your lock state.
public:
typedef boost::intrusive_ptr<MMDSFindIno> ref;
typedef boost::intrusive_ptr<MMDSFindIno const> const_ref;
+ using factory = MessageFactory<MMDSFindIno>;
+ friend factory;
+
ceph_tid_t tid {0};
inodeno_t ino;
public:
typedef boost::intrusive_ptr<MMDSFindInoReply> ref;
typedef boost::intrusive_ptr<MMDSFindInoReply const> const_ref;
+ using factory = MessageFactory<MMDSFindInoReply>;
+ friend factory;
+
ceph_tid_t tid = 0;
filepath path;
#include "msg/Message.h"
class MMDSFragmentNotify : public Message {
+public:
+ typedef boost::intrusive_ptr<MMDSFragmentNotify> ref;
+ typedef boost::intrusive_ptr<MMDSFragmentNotify const> const_ref;
+ using factory = MessageFactory<MMDSFragmentNotify>;
+ friend factory;
+private:
inodeno_t ino;
frag_t basefrag;
int8_t bits = 0;
public:
- typedef boost::intrusive_ptr<MMDSFragmentNotify> ref;
- typedef boost::intrusive_ptr<MMDSFragmentNotify const> const_ref;
inodeno_t get_ino() const { return ino; }
frag_t get_basefrag() const { return basefrag; }
int get_bits() const { return bits; }
using std::map;
class MMDSLoadTargets : public PaxosServiceMessage {
- public:
+public:
+ typedef boost::intrusive_ptr<MMDSLoadTargets> ref;
+ typedef boost::intrusive_ptr<MMDSLoadTargets const> const_ref;
+ using factory = MessageFactory<MMDSLoadTargets>;
+ friend factory;
+
mds_gid_t global_id;
set<mds_rank_t> targets;
#include "include/ceph_features.h"
class MMDSMap : public Message {
- static const int HEAD_VERSION = 1;
- static const int COMPAT_VERSION = 1;
public:
typedef boost::intrusive_ptr<MMDSMap> ref;
typedef boost::intrusive_ptr<MMDSMap const> const_ref;
+ using factory = MessageFactory<MMDSMap>;
+ friend factory;
+private:
+ static const int HEAD_VERSION = 1;
+ static const int COMPAT_VERSION = 1;
+public:
uuid_d fsid;
epoch_t epoch = 0;
bufferlist encoded;
#include "msg/Message.h"
-struct MMDSOpenIno : public Message {
+class MMDSOpenIno : public Message {
public:
typedef boost::intrusive_ptr<MMDSOpenIno> ref;
typedef boost::intrusive_ptr<MMDSOpenIno const> const_ref;
+ using factory = MessageFactory<MMDSOpenIno>;
+ friend factory;
+
inodeno_t ino;
vector<inode_backpointer_t> ancestors;
public:
typedef boost::intrusive_ptr<MMDSOpenInoReply> ref;
typedef boost::intrusive_ptr<MMDSOpenInoReply const> const_ref;
+ using factory = MessageFactory<MMDSOpenInoReply>;
+ friend factory;
inodeno_t ino;
vector<inode_backpointer_t> ancestors;
public:
typedef boost::intrusive_ptr<MMDSResolve> ref;
typedef boost::intrusive_ptr<MMDSResolve const> const_ref;
+ using factory = MessageFactory<MMDSResolve>;
+ friend factory;
+
map<dirfrag_t, vector<dirfrag_t> > subtrees;
map<dirfrag_t, vector<dirfrag_t> > ambiguous_imports;
class MMDSResolveAck : public Message {
- public:
+public:
typedef boost::intrusive_ptr<MMDSResolveAck> ref;
typedef boost::intrusive_ptr<MMDSResolveAck const> const_ref;
+ using factory = MessageFactory<MMDSResolveAck>;
+ friend factory;
+
map<metareqid_t, bufferlist> commit;
vector<metareqid_t> abort;
#include "mds/mdstypes.h"
class MMDSSlaveRequest : public Message {
- public:
+public:
typedef boost::intrusive_ptr<MMDSSlaveRequest> ref;
typedef boost::intrusive_ptr<MMDSSlaveRequest const> const_ref;
+ using factory = MessageFactory<MMDSSlaveRequest>;
+ friend factory;
+
static const int OP_XLOCK = 1;
static const int OP_XLOCKACK = -1;
static const int OP_UNXLOCK = 2;
#include "msg/Message.h"
class MMDSSnapUpdate : public Message {
+public:
+ typedef boost::intrusive_ptr<MMDSSnapUpdate> ref;
+ typedef boost::intrusive_ptr<MMDSSnapUpdate const> const_ref;
+ using factory = MessageFactory<MMDSSnapUpdate>;
+ friend factory;
+private:
+
inodeno_t ino;
__s16 snap_op;
public:
- typedef boost::intrusive_ptr<MMDSSnapUpdate> ref;
- typedef boost::intrusive_ptr<MMDSSnapUpdate const> const_ref;
inodeno_t get_ino() const { return ino; }
int get_snap_op() const { return snap_op; }
#include "mds/mds_table_types.h"
class MMDSTableRequest : public Message {
- public:
+public:
typedef boost::intrusive_ptr<MMDSTableRequest> ref;
typedef boost::intrusive_ptr<MMDSTableRequest const> const_ref;
+ using factory = MessageFactory<MMDSTableRequest>;
+ friend factory;
__u16 table = 0;
__s16 op = 0;
class MMgrBeacon : public PaxosServiceMessage {
+public:
+ typedef boost::intrusive_ptr<MMgrBeacon> ref;
+ typedef boost::intrusive_ptr<MMgrBeacon const> const_ref;
+ using factory = MessageFactory<MMgrBeacon>;
+ friend factory;
+private:
static const int HEAD_VERSION = 8;
static const int COMPAT_VERSION = 8;
class MMgrClose : public Message
{
+public:
+ typedef boost::intrusive_ptr<MMgrClose> ref;
+ typedef boost::intrusive_ptr<MMgrClose const> const_ref;
+ using factory = MessageFactory<MMgrClose>;
+ friend factory;
+private:
+
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
*/
class MMgrConfigure : public Message
{
+public:
+ typedef boost::intrusive_ptr<MMgrConfigure> ref;
+ typedef boost::intrusive_ptr<MMgrConfigure const> const_ref;
+ using factory = MessageFactory<MMgrConfigure>;
+ friend factory;
+private:
+
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
*/
class MMgrDigest : public Message {
public:
+ typedef boost::intrusive_ptr<MMgrDigest> ref;
+ typedef boost::intrusive_ptr<MMgrDigest const> const_ref;
+ using factory = MessageFactory<MMgrDigest>;
+ friend factory;
+
bufferlist mon_status_json;
bufferlist health_json;
#include "mon/MgrMap.h"
class MMgrMap : public Message {
+public:
+ typedef boost::intrusive_ptr<MMgrMap> ref;
+ typedef boost::intrusive_ptr<MMgrMap const> const_ref;
+ using factory = MessageFactory<MMgrMap>;
+ friend factory;
+
protected:
MgrMap map;
class MMgrOpen : public Message
{
+public:
+ typedef boost::intrusive_ptr<MMgrOpen> ref;
+ typedef boost::intrusive_ptr<MMgrOpen const> const_ref;
+ using factory = MessageFactory<MMgrOpen>;
+ friend factory;
+private:
+
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
class MMgrReport : public Message
{
+public:
+ typedef boost::intrusive_ptr<MMgrReport> ref;
+ typedef boost::intrusive_ptr<MMgrReport const> const_ref;
+ using factory = MessageFactory<MMgrReport>;
+ friend factory;
+private:
+
static const int HEAD_VERSION = 6;
static const int COMPAT_VERSION = 1;
#include <string>
class MMonCommand : public PaxosServiceMessage {
- public:
+public:
+ typedef boost::intrusive_ptr<MMonCommand> ref;
+ typedef boost::intrusive_ptr<MMonCommand const> const_ref;
+ using factory = MessageFactory<MMonCommand>;
+ friend factory;
+
uuid_d fsid;
std::vector<std::string> cmd;
#include "messages/PaxosServiceMessage.h"
class MMonCommandAck : public PaxosServiceMessage {
- public:
+public:
+ typedef boost::intrusive_ptr<MMonCommandAck> ref;
+ typedef boost::intrusive_ptr<MMonCommandAck const> const_ref;
+ using factory = MessageFactory<MMonCommandAck>;
+ friend factory;
+
vector<string> cmd;
errorcode32_t r;
string rs;
#include "mon/mon_types.h"
class MMonElection : public Message {
+public:
+ typedef boost::intrusive_ptr<MMonElection> ref;
+ typedef boost::intrusive_ptr<MMonElection const> const_ref;
+ using factory = MessageFactory<MMonElection>;
+ friend factory;
+private:
static const int HEAD_VERSION = 7;
static const int COMPAT_VERSION = 5;
#include "include/types.h"
class MMonGetMap : public Message {
- public:
+public:
+ typedef boost::intrusive_ptr<MMonGetMap> ref;
+ typedef boost::intrusive_ptr<MMonGetMap const> const_ref;
+ using factory = MessageFactory<MMonGetMap>;
+ friend factory;
+
MMonGetMap() : Message(CEPH_MSG_MON_GET_MAP) { }
private:
~MMonGetMap() override {}
#include "include/types.h"
class MMonGetOSDMap : public PaxosServiceMessage {
+public:
+ typedef boost::intrusive_ptr<MMonGetOSDMap> ref;
+ typedef boost::intrusive_ptr<MMonGetOSDMap const> const_ref;
+ using factory = MessageFactory<MMonGetOSDMap>;
+ friend factory;
+private:
+
epoch_t full_first, full_last;
epoch_t inc_first, inc_last;
*/
class MMonGetVersion : public Message {
public:
+ typedef boost::intrusive_ptr<MMonGetVersion> ref;
+ typedef boost::intrusive_ptr<MMonGetVersion const> const_ref;
+ using factory = MessageFactory<MMonGetVersion>;
+ friend factory;
+
MMonGetVersion() : Message(CEPH_MSG_MON_GET_VERSION) {}
const char *get_type_name() const override {
* back.
*/
class MMonGetVersionReply : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MMonGetVersionReply> ref;
+ typedef boost::intrusive_ptr<MMonGetVersionReply const> const_ref;
+ using factory = MessageFactory<MMonGetVersionReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
public:
#include "messages/PaxosServiceMessage.h"
-struct MMonGlobalID : public PaxosServiceMessage {
+class MMonGlobalID : public PaxosServiceMessage {
+public:
+ typedef boost::intrusive_ptr<MMonGlobalID> ref;
+ typedef boost::intrusive_ptr<MMonGlobalID const> const_ref;
+ using factory = MessageFactory<MMonGlobalID>;
+ friend factory;
+
uint64_t old_max_id;
MMonGlobalID() : PaxosServiceMessage(MSG_MON_GLOBAL_ID, 0), old_max_id(0) { }
private:
#include "messages/MMonQuorumService.h"
#include "mon/mon_types.h"
-struct MMonHealth : public MMonQuorumService
-{
+class MMonHealth : public MMonQuorumService {
+public:
+ typedef boost::intrusive_ptr<MMonHealth> ref;
+ typedef boost::intrusive_ptr<MMonHealth const> const_ref;
+ using factory = MessageFactory<MMonHealth>;
+ friend factory;
+
static const int HEAD_VERSION = 1;
int service_type = 0;
#include "messages/PaxosServiceMessage.h"
#include "mon/health_check.h"
-struct MMonHealthChecks : public PaxosServiceMessage
-{
+class MMonHealthChecks : public PaxosServiceMessage {
+public:
+ typedef boost::intrusive_ptr<MMonHealthChecks> ref;
+ typedef boost::intrusive_ptr<MMonHealthChecks const> const_ref;
+ using factory = MessageFactory<MMonHealthChecks>;
+ friend factory;
+
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
using std::vector;
class MMonJoin : public PaxosServiceMessage {
- public:
+public:
+ typedef boost::intrusive_ptr<MMonJoin> ref;
+ typedef boost::intrusive_ptr<MMonJoin const> const_ref;
+ using factory = MessageFactory<MMonJoin>;
+ friend factory;
+
uuid_d fsid;
string name;
entity_addr_t addr;
class MMonMap : public Message {
public:
+ typedef boost::intrusive_ptr<MMonMap> ref;
+ typedef boost::intrusive_ptr<MMonMap const> const_ref;
+ using factory = MessageFactory<MMonMap>;
+ friend factory;
+
bufferlist monmapbl;
MMonMap() : Message(CEPH_MSG_MON_MAP) { }
class MMonMetadata : public Message {
public:
+ typedef boost::intrusive_ptr<MMonMetadata> ref;
+ typedef boost::intrusive_ptr<MMonMetadata const> const_ref;
+ using factory = MessageFactory<MMonMetadata>;
+ friend factory;
+
Metadata data;
private:
#include "mon/health_check.h"
class MMonMgrReport : public PaxosServiceMessage {
-
+public:
+ typedef boost::intrusive_ptr<MMonMgrReport> ref;
+ typedef boost::intrusive_ptr<MMonMgrReport const> const_ref;
+ using factory = MessageFactory<MMonMgrReport>;
+ friend factory;
+private:
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
#include "include/ceph_features.h"
class MMonPaxos : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MMonPaxos> ref;
+ typedef boost::intrusive_ptr<MMonPaxos const> const_ref;
+ using factory = MessageFactory<MMonPaxos>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 3;
class MMonProbe : public Message {
public:
+ typedef boost::intrusive_ptr<MMonProbe> ref;
+ typedef boost::intrusive_ptr<MMonProbe const> const_ref;
+ using factory = MessageFactory<MMonProbe>;
+ friend factory;
+
static const int HEAD_VERSION = 6;
static const int COMPAT_VERSION = 5;
#include "msg/Message.h"
-struct MMonQuorumService : public Message
-{
+class MMonQuorumService : public Message {
+public:
+ typedef boost::intrusive_ptr<MMonQuorumService> ref;
+ typedef boost::intrusive_ptr<MMonQuorumService const> const_ref;
+ using factory = MessageFactory<MMonQuorumService>;
+ friend factory;
+
epoch_t epoch;
version_t round;
#include "msg/Message.h"
#include "mon/mon_types.h"
-class MMonScrub : public Message
-{
+class MMonScrub : public Message {
+public:
+ typedef boost::intrusive_ptr<MMonScrub> ref;
+ typedef boost::intrusive_ptr<MMonScrub const> const_ref;
+ using factory = MessageFactory<MMonScrub>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 2;
WRITE_RAW_ENCODER(ceph_mon_subscribe_item_old)
-struct MMonSubscribe : public Message {
+class MMonSubscribe : public Message {
+public:
+ typedef boost::intrusive_ptr<MMonSubscribe> ref;
+ typedef boost::intrusive_ptr<MMonSubscribe const> const_ref;
+ using factory = MessageFactory<MMonSubscribe>;
+ friend factory;
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
#include "msg/Message.h"
-struct MMonSubscribeAck : public Message {
+class MMonSubscribeAck : public Message {
+public:
+ typedef boost::intrusive_ptr<MMonSubscribeAck> ref;
+ typedef boost::intrusive_ptr<MMonSubscribeAck const> const_ref;
+ using factory = MessageFactory<MMonSubscribeAck>;
+ friend factory;
+
__u32 interval;
uuid_d fsid;
#include "msg/Message.h"
-class MMonSync : public Message
-{
+class MMonSync : public Message {
+public:
+ typedef boost::intrusive_ptr<MMonSync> ref;
+ typedef boost::intrusive_ptr<MMonSync const> const_ref;
+ using factory = MessageFactory<MMonSync>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 2;
*/
class MNop : public Message {
public:
+ typedef boost::intrusive_ptr<MNop> ref;
+ typedef boost::intrusive_ptr<MNop const> const_ref;
+ using factory = MessageFactory<MNop>;
+ friend factory;
+
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
#include "messages/PaxosServiceMessage.h"
class MOSDAlive : public PaxosServiceMessage {
- public:
+public:
+ typedef boost::intrusive_ptr<MOSDAlive> ref;
+ typedef boost::intrusive_ptr<MOSDAlive const> const_ref;
+ using factory = MessageFactory<MOSDAlive>;
+ friend factory;
+
epoch_t want = 0;
MOSDAlive(epoch_t h, epoch_t w) : PaxosServiceMessage(MSG_OSD_ALIVE, h), want(w) { }
class MOSDBackoff : public MOSDFastDispatchOp {
public:
+ typedef boost::intrusive_ptr<MOSDBackoff> ref;
+ typedef boost::intrusive_ptr<MOSDBackoff const> const_ref;
+ using factory = MessageFactory<MOSDBackoff>;
+ friend factory;
+
static constexpr int HEAD_VERSION = 1;
static constexpr int COMPAT_VERSION = 1;
class MOSDBeacon : public PaxosServiceMessage {
public:
+ typedef boost::intrusive_ptr<MOSDBeacon> ref;
+ typedef boost::intrusive_ptr<MOSDBeacon const> const_ref;
+ using factory = MessageFactory<MOSDBeacon>;
+ friend factory;
+
std::vector<pg_t> pgs;
epoch_t min_last_epoch_clean = 0;
#include "osd/osd_types.h"
class MOSDBoot : public PaxosServiceMessage {
-
+public:
+ typedef boost::intrusive_ptr<MOSDBoot> ref;
+ typedef boost::intrusive_ptr<MOSDBoot const> const_ref;
+ using factory = MessageFactory<MOSDBoot>;
+ friend factory;
+private:
static const int HEAD_VERSION = 6;
static const int COMPAT_VERSION = 6;
#include "osd/ECMsgTypes.h"
class MOSDECSubOpRead : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDECSubOpRead> ref;
+ typedef boost::intrusive_ptr<MOSDECSubOpRead const> const_ref;
+ using factory = MessageFactory<MOSDECSubOpRead>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
#include "osd/ECMsgTypes.h"
class MOSDECSubOpReadReply : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDECSubOpReadReply> ref;
+ typedef boost::intrusive_ptr<MOSDECSubOpReadReply const> const_ref;
+ using factory = MessageFactory<MOSDECSubOpReadReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
#include "osd/ECMsgTypes.h"
class MOSDECSubOpWrite : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDECSubOpWrite> ref;
+ typedef boost::intrusive_ptr<MOSDECSubOpWrite const> const_ref;
+ using factory = MessageFactory<MOSDECSubOpWrite>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
#include "osd/ECMsgTypes.h"
class MOSDECSubOpWriteReply : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDECSubOpWriteReply> ref;
+ typedef boost::intrusive_ptr<MOSDECSubOpWriteReply const> const_ref;
+ using factory = MessageFactory<MOSDECSubOpWriteReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
class MOSDFailure : public PaxosServiceMessage {
-
+public:
+ typedef boost::intrusive_ptr<MOSDFailure> ref;
+ typedef boost::intrusive_ptr<MOSDFailure const> const_ref;
+ using factory = MessageFactory<MOSDFailure>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 4;
class MOSDFastDispatchOp : public Message {
public:
+ typedef boost::intrusive_ptr<MOSDFastDispatchOp> ref;
+ typedef boost::intrusive_ptr<MOSDFastDispatchOp const> const_ref;
+ using factory = MessageFactory<MOSDFastDispatchOp>;
+ friend factory;
+
virtual epoch_t get_map_epoch() const = 0;
virtual epoch_t get_min_epoch() const {
return get_map_epoch();
// cancel priority boost, requeue if necessary
static const int OFR_CANCEL = 4;
-struct MOSDForceRecovery : public Message {
+class MOSDForceRecovery : public Message {
+public:
+ typedef boost::intrusive_ptr<MOSDForceRecovery> ref;
+ typedef boost::intrusive_ptr<MOSDForceRecovery const> const_ref;
+ using factory = MessageFactory<MOSDForceRecovery>;
+ friend factory;
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 2;
// for now name it for its sole application.
class MOSDFull : public PaxosServiceMessage {
- public:
+public:
+ typedef boost::intrusive_ptr<MOSDFull> ref;
+ typedef boost::intrusive_ptr<MOSDFull const> const_ref;
+ using factory = MessageFactory<MOSDFull>;
+ friend factory;
+
epoch_t map_epoch = 0;
uint32_t state = 0;
#include "include/ceph_features.h"
class MOSDMap : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MOSDMap> ref;
+ typedef boost::intrusive_ptr<MOSDMap const> const_ref;
+ using factory = MessageFactory<MOSDMap>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 3;
#include "messages/PaxosServiceMessage.h"
class MOSDMarkMeDown : public PaxosServiceMessage {
-
+public:
+ typedef boost::intrusive_ptr<MOSDMarkMeDown> ref;
+ typedef boost::intrusive_ptr<MOSDMarkMeDown const> const_ref;
+ using factory = MessageFactory<MOSDMarkMeDown>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 3;
class OSD;
class MOSDOp : public MOSDFastDispatchOp {
-
+public:
+ typedef boost::intrusive_ptr<MOSDOp> ref;
+ typedef boost::intrusive_ptr<MOSDOp const> const_ref;
+ using factory = MessageFactory<MOSDOp>;
+ friend factory;
+private:
static const int HEAD_VERSION = 8;
static const int COMPAT_VERSION = 3;
*/
class MOSDOpReply : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MOSDOpReply> ref;
+ typedef boost::intrusive_ptr<MOSDOpReply const> const_ref;
+ using factory = MessageFactory<MOSDOpReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 8;
static const int COMPAT_VERSION = 2;
#include "MOSDFastDispatchOp.h"
class MOSDPGBackfill : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDPGBackfill> ref;
+ typedef boost::intrusive_ptr<MOSDPGBackfill const> const_ref;
+ using factory = MessageFactory<MOSDPGBackfill>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 3;
public:
* instruct non-primary to remove some objects during backfill
*/
-struct MOSDPGBackfillRemove : public MOSDFastDispatchOp {
+class MOSDPGBackfillRemove : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDPGBackfillRemove> ref;
+ typedef boost::intrusive_ptr<MOSDPGBackfillRemove const> const_ref;
+ using factory = MessageFactory<MOSDPGBackfillRemove>;
+ friend factory;
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
* PGCreate - instruct an OSD to create a pg, if it doesn't already exist
*/
-struct MOSDPGCreate : public Message {
+class MOSDPGCreate : public Message {
+public:
+ typedef boost::intrusive_ptr<MOSDPGCreate> ref;
+ typedef boost::intrusive_ptr<MOSDPGCreate const> const_ref;
+ using factory = MessageFactory<MOSDPGCreate>;
+ friend factory;
const static int HEAD_VERSION = 3;
const static int COMPAT_VERSION = 3;
* PGCreate2 - instruct an OSD to create some pgs
*/
-struct MOSDPGCreate2 : public Message {
+class MOSDPGCreate2 : public Message {
+public:
+ typedef boost::intrusive_ptr<MOSDPGCreate2> ref;
+ typedef boost::intrusive_ptr<MOSDPGCreate2 const> const_ref;
+ using factory = MessageFactory<MOSDPGCreate2>;
+ friend factory;
+
const static int HEAD_VERSION = 1;
const static int COMPAT_VERSION = 1;
class MOSDPGCreated : public PaxosServiceMessage {
public:
+ typedef boost::intrusive_ptr<MOSDPGCreated> ref;
+ typedef boost::intrusive_ptr<MOSDPGCreated const> const_ref;
+ using factory = MessageFactory<MOSDPGCreated>;
+ friend factory;
+
pg_t pgid;
MOSDPGCreated()
: PaxosServiceMessage(MSG_OSD_PG_CREATED, 0)
#include "osd/osd_types.h"
class MOSDPGInfo : public Message {
+public:
+ typedef boost::intrusive_ptr<MOSDPGInfo> ref;
+ typedef boost::intrusive_ptr<MOSDPGInfo const> const_ref;
+ using factory = MessageFactory<MOSDPGInfo>;
+ friend factory;
+private:
static const int HEAD_VERSION = 5;
static const int COMPAT_VERSION = 5;
#include "messages/MOSDPeeringOp.h"
class MOSDPGLog : public MOSDPeeringOp {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPGLog> ref;
+ typedef boost::intrusive_ptr<MOSDPGLog const> const_ref;
+ using factory = MessageFactory<MOSDPGLog>;
+ friend factory;
+private:
static const int HEAD_VERSION = 5;
static const int COMPAT_VERSION = 5;
*/
class MOSDPGNotify : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPGNotify> ref;
+ typedef boost::intrusive_ptr<MOSDPGNotify const> const_ref;
+ using factory = MessageFactory<MOSDPGNotify>;
+ friend factory;
+private:
static const int HEAD_VERSION = 6;
static const int COMPAT_VERSION = 6;
#include "MOSDFastDispatchOp.h"
class MOSDPGPull : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDPGPull> ref;
+ typedef boost::intrusive_ptr<MOSDPGPull const> const_ref;
+ using factory = MessageFactory<MOSDPGPull>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 2;
#include "MOSDFastDispatchOp.h"
class MOSDPGPush : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDPGPush> ref;
+ typedef boost::intrusive_ptr<MOSDPGPush const> const_ref;
+ using factory = MessageFactory<MOSDPGPush>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 2;
#include "MOSDFastDispatchOp.h"
class MOSDPGPushReply : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDPGPushReply> ref;
+ typedef boost::intrusive_ptr<MOSDPGPushReply const> const_ref;
+ using factory = MessageFactory<MOSDPGPushReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 2;
*/
class MOSDPGQuery : public Message {
+public:
+ typedef boost::intrusive_ptr<MOSDPGQuery> ref;
+ typedef boost::intrusive_ptr<MOSDPGQuery const> const_ref;
+ using factory = MessageFactory<MOSDPGQuery>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 4;
* instruct non-primary to remove some objects during recovery
*/
-struct MOSDPGRecoveryDelete : public MOSDFastDispatchOp {
+class MOSDPGRecoveryDelete : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDPGRecoveryDelete> ref;
+ typedef boost::intrusive_ptr<MOSDPGRecoveryDelete const> const_ref;
+ using factory = MessageFactory<MOSDPGRecoveryDelete>;
+ friend factory;
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
#include "MOSDFastDispatchOp.h"
-struct MOSDPGRecoveryDeleteReply : public MOSDFastDispatchOp {
+class MOSDPGRecoveryDeleteReply : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDPGRecoveryDeleteReply> ref;
+ typedef boost::intrusive_ptr<MOSDPGRecoveryDeleteReply const> const_ref;
+ using factory = MessageFactory<MOSDPGRecoveryDeleteReply>;
+ friend factory;
+
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
class MOSDPGRemove : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPGRemove> ref;
+ typedef boost::intrusive_ptr<MOSDPGRemove const> const_ref;
+ using factory = MessageFactory<MOSDPGRemove>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 3;
#include "MOSDFastDispatchOp.h"
class MOSDPGScan : public MOSDFastDispatchOp {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPGScan> ref;
+ typedef boost::intrusive_ptr<MOSDPGScan const> const_ref;
+ using factory = MessageFactory<MOSDPGScan>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 2;
#include "messages/PaxosServiceMessage.h"
class MOSDPGTemp : public PaxosServiceMessage {
- public:
+public:
+ typedef boost::intrusive_ptr<MOSDPGTemp> ref;
+ typedef boost::intrusive_ptr<MOSDPGTemp const> const_ref;
+ using factory = MessageFactory<MOSDPGTemp>;
+ friend factory;
+
epoch_t map_epoch = 0;
map<pg_t, vector<int32_t> > pg_temp;
bool forced = false;
#include "messages/MOSDPeeringOp.h"
class MOSDPGTrim : public MOSDPeeringOp {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPGTrim> ref;
+ typedef boost::intrusive_ptr<MOSDPGTrim const> const_ref;
+ using factory = MessageFactory<MOSDPGTrim>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 2;
#include "MOSDFastDispatchOp.h"
class MOSDPGUpdateLogMissing : public MOSDFastDispatchOp {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPGUpdateLogMissing> ref;
+ typedef boost::intrusive_ptr<MOSDPGUpdateLogMissing const> const_ref;
+ using factory = MessageFactory<MOSDPGUpdateLogMissing>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
#include "MOSDFastDispatchOp.h"
class MOSDPGUpdateLogMissingReply : public MOSDFastDispatchOp {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPGUpdateLogMissingReply> ref;
+ typedef boost::intrusive_ptr<MOSDPGUpdateLogMissingReply const> const_ref;
+ using factory = MessageFactory<MOSDPGUpdateLogMissingReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
class MOSDPeeringOp : public Message {
public:
+ typedef boost::intrusive_ptr<MOSDPeeringOp> ref;
+ typedef boost::intrusive_ptr<MOSDPeeringOp const> const_ref;
+ using factory = MessageFactory<MOSDPeeringOp>;
+ friend factory;
+
MOSDPeeringOp(int t, int version, int compat_version)
: Message(t, version, compat_version) {}
class MOSDPing : public Message {
-
+public:
+ typedef boost::intrusive_ptr<MOSDPing> ref;
+ typedef boost::intrusive_ptr<MOSDPing const> const_ref;
+ using factory = MessageFactory<MOSDPing>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 4;
*/
class MOSDRepOp : public MOSDFastDispatchOp {
-
+public:
+ typedef boost::intrusive_ptr<MOSDRepOp> ref;
+ typedef boost::intrusive_ptr<MOSDRepOp const> const_ref;
+ using factory = MessageFactory<MOSDRepOp>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
*/
class MOSDRepOpReply : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDRepOpReply> ref;
+ typedef boost::intrusive_ptr<MOSDRepOpReply const> const_ref;
+ using factory = MessageFactory<MOSDRepOpReply>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
public:
* instruct an OSD initiate a replica scrub on a specific PG
*/
-struct MOSDRepScrub : public MOSDFastDispatchOp {
+class MOSDRepScrub : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDRepScrub> ref;
+ typedef boost::intrusive_ptr<MOSDRepScrub const> const_ref;
+ using factory = MessageFactory<MOSDRepScrub>;
+ friend factory;
static const int HEAD_VERSION = 9;
static const int COMPAT_VERSION = 6;
* pass a ScrubMap from a shard back to the primary
*/
-struct MOSDRepScrubMap : public MOSDFastDispatchOp {
+class MOSDRepScrubMap : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDRepScrubMap> ref;
+ typedef boost::intrusive_ptr<MOSDRepScrubMap const> const_ref;
+ using factory = MessageFactory<MOSDRepScrubMap>;
+ friend factory;
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
* instruct an OSD to scrub some or all pg(s)
*/
-struct MOSDScrub : public Message {
+class MOSDScrub : public Message {
+public:
+ typedef boost::intrusive_ptr<MOSDScrub> ref;
+ typedef boost::intrusive_ptr<MOSDScrub const> const_ref;
+ using factory = MessageFactory<MOSDScrub>;
+ friend factory;
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 2;
* instruct an OSD to scrub some or all pg(s)
*/
-struct MOSDScrub2 : public Message {
+class MOSDScrub2 : public Message {
+public:
+ typedef boost::intrusive_ptr<MOSDScrub2> ref;
+ typedef boost::intrusive_ptr<MOSDScrub2 const> const_ref;
+ using factory = MessageFactory<MOSDScrub2>;
+ friend factory;
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
#include "MOSDFastDispatchOp.h"
class MOSDScrubReserve : public MOSDFastDispatchOp {
+public:
+ typedef boost::intrusive_ptr<MOSDScrubReserve> ref;
+ typedef boost::intrusive_ptr<MOSDScrubReserve const> const_ref;
+ using factory = MessageFactory<MOSDScrubReserve>;
+ friend factory;
+private:
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
public:
class MPGStats : public PaxosServiceMessage {
public:
+ typedef boost::intrusive_ptr<MPGStats> ref;
+ typedef boost::intrusive_ptr<MPGStats const> const_ref;
+ using factory = MessageFactory<MPGStats>;
+ friend factory;
+
uuid_d fsid;
map<pg_t,pg_stat_t> pg_stat;
osd_stat_t osd_stat;
class MPGStatsAck : public Message {
public:
+ typedef boost::intrusive_ptr<MPGStatsAck> ref;
+ typedef boost::intrusive_ptr<MPGStatsAck const> const_ref;
+ using factory = MessageFactory<MPGStatsAck>;
+ friend factory;
+
map<pg_t,pair<version_t,epoch_t> > pg_stat;
MPGStatsAck() : Message(MSG_PGSTATSACK) {}
#include "msg/Message.h"
class MPing : public Message {
- public:
+public:
+ typedef boost::intrusive_ptr<MPing> ref;
+ typedef boost::intrusive_ptr<MPing const> const_ref;
+ using factory = MessageFactory<MPing>;
+ friend factory;
+
MPing() : Message(CEPH_MSG_PING) {}
private:
~MPing() override {}
class MPoolOp : public PaxosServiceMessage {
-
+public:
+ typedef boost::intrusive_ptr<MPoolOp> ref;
+ typedef boost::intrusive_ptr<MPoolOp const> const_ref;
+ using factory = MessageFactory<MPoolOp>;
+ friend factory;
+private:
static const int HEAD_VERSION = 4;
static const int COMPAT_VERSION = 2;
class MPoolOpReply : public PaxosServiceMessage {
public:
+ typedef boost::intrusive_ptr<MPoolOpReply> ref;
+ typedef boost::intrusive_ptr<MPoolOpReply const> const_ref;
+ using factory = MessageFactory<MPoolOpReply>;
+ friend factory;
+
uuid_d fsid;
__u32 replyCode = 0;
epoch_t epoch = 0;
#include "messages/MOSDPeeringOp.h"
class MRecoveryReserve : public MOSDPeeringOp {
+public:
+ typedef boost::intrusive_ptr<MRecoveryReserve> ref;
+ typedef boost::intrusive_ptr<MRecoveryReserve const> const_ref;
+ using factory = MessageFactory<MRecoveryReserve>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 2;
public:
#include "messages/PaxosServiceMessage.h"
-struct MRemoveSnaps : public PaxosServiceMessage {
+class MRemoveSnaps : public PaxosServiceMessage {
+public:
+ typedef boost::intrusive_ptr<MRemoveSnaps> ref;
+ typedef boost::intrusive_ptr<MRemoveSnaps const> const_ref;
+ using factory = MessageFactory<MRemoveSnaps>;
+ friend factory;
+
map<int, vector<snapid_t> > snaps;
MRemoveSnaps() :
#include "msg/Message.h"
#include "include/encoding.h"
-struct MRoute : public Message {
+class MRoute : public Message {
+public:
+ typedef boost::intrusive_ptr<MRoute> ref;
+ typedef boost::intrusive_ptr<MRoute const> const_ref;
+ using factory = MessageFactory<MRoute>;
+ friend factory;
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 3;
class MServiceMap : public Message {
public:
+ typedef boost::intrusive_ptr<MServiceMap> ref;
+ typedef boost::intrusive_ptr<MServiceMap const> const_ref;
+ using factory = MessageFactory<MServiceMap>;
+ friend factory;
+
ServiceMap service_map;
MServiceMap() : Message(MSG_SERVICE_MAP) { }
#include "messages/PaxosServiceMessage.h"
class MStatfs : public PaxosServiceMessage {
-
+public:
+ typedef boost::intrusive_ptr<MStatfs> ref;
+ typedef boost::intrusive_ptr<MStatfs const> const_ref;
+ using factory = MessageFactory<MStatfs>;
+ friend factory;
+private:
static const int HEAD_VERSION = 2;
static const int COMPAT_VERSION = 1;
class MStatfsReply : public Message {
public:
+ typedef boost::intrusive_ptr<MStatfsReply> ref;
+ typedef boost::intrusive_ptr<MStatfsReply const> const_ref;
+ using factory = MessageFactory<MStatfsReply>;
+ friend factory;
+
struct ceph_mon_statfs_reply h{};
MStatfsReply() : Message(CEPH_MSG_STATFS_REPLY) {}
#ifndef CEPH_MTIMECHECK_H
#define CEPH_MTIMECHECK_H
-struct MTimeCheck : public Message
-{
+class MTimeCheck : public Message {
+public:
+ typedef boost::intrusive_ptr<MTimeCheck> ref;
+ typedef boost::intrusive_ptr<MTimeCheck const> const_ref;
+ using factory = MessageFactory<MTimeCheck>;
+ friend factory;
+
static const int HEAD_VERSION = 1;
enum {
#pragma once
-struct MTimeCheck2 : public Message
-{
+class MTimeCheck2 : public Message {
+public:
+ typedef boost::intrusive_ptr<MTimeCheck2> ref;
+ typedef boost::intrusive_ptr<MTimeCheck2 const> const_ref;
+ using factory = MessageFactory<MTimeCheck2>;
+ friend factory;
+
static const int HEAD_VERSION = 1;
static const int COMPAT_VERSION = 1;
class MWatchNotify : public Message {
+public:
+ typedef boost::intrusive_ptr<MWatchNotify> ref;
+ typedef boost::intrusive_ptr<MWatchNotify const> const_ref;
+ using factory = MessageFactory<MWatchNotify>;
+ friend factory;
+private:
static const int HEAD_VERSION = 3;
static const int COMPAT_VERSION = 1;
#include "mon/Session.h"
class PaxosServiceMessage : public Message {
- public:
+public:
+ typedef boost::intrusive_ptr<PaxosServiceMessage> ref;
+ typedef boost::intrusive_ptr<PaxosServiceMessage const> const_ref;
+ using factory = MessageFactory<PaxosServiceMessage>;
+ friend factory;
+
version_t version;
__s16 deprecated_session_mon;
uint64_t deprecated_session_mon_tid;
}
// make message
- Message *m = 0;
+ Message::ref m;
int type = header.type;
switch (type) {
// -- with payload --
case MSG_PGSTATS:
- m = new MPGStats;
+ m = MPGStats::factory::build();
break;
case MSG_PGSTATSACK:
- m = new MPGStatsAck;
+ m = MPGStatsAck::factory::build();
break;
case CEPH_MSG_STATFS:
- m = new MStatfs;
+ m = MStatfs::factory::build();
break;
case CEPH_MSG_STATFS_REPLY:
- m = new MStatfsReply;
+ m = MStatfsReply::factory::build();
break;
case MSG_GETPOOLSTATS:
- m = new MGetPoolStats;
+ m = MGetPoolStats::factory::build();
break;
case MSG_GETPOOLSTATSREPLY:
- m = new MGetPoolStatsReply;
+ m = MGetPoolStatsReply::factory::build();
break;
case CEPH_MSG_POOLOP:
- m = new MPoolOp;
+ m = MPoolOp::factory::build();
break;
case CEPH_MSG_POOLOP_REPLY:
- m = new MPoolOpReply;
+ m = MPoolOpReply::factory::build();
break;
case MSG_MON_COMMAND:
- m = new MMonCommand;
+ m = MMonCommand::factory::build();
break;
case MSG_MON_COMMAND_ACK:
- m = new MMonCommandAck;
+ m = MMonCommandAck::factory::build();
break;
case MSG_MON_PAXOS:
- m = new MMonPaxos;
+ m = MMonPaxos::factory::build();
break;
case MSG_CONFIG:
- m = new MConfig;
+ m = MConfig::factory::build();
break;
case MSG_GET_CONFIG:
- m = new MGetConfig;
+ m = MGetConfig::factory::build();
break;
case MSG_MON_PROBE:
- m = new MMonProbe;
+ m = MMonProbe::factory::build();
break;
case MSG_MON_JOIN:
- m = new MMonJoin;
+ m = MMonJoin::factory::build();
break;
case MSG_MON_ELECTION:
- m = new MMonElection;
+ m = MMonElection::factory::build();
break;
case MSG_MON_SYNC:
- m = new MMonSync;
+ m = MMonSync::factory::build();
break;
case MSG_MON_SCRUB:
- m = new MMonScrub;
+ m = MMonScrub::factory::build();
break;
case MSG_LOG:
- m = new MLog;
+ m = MLog::factory::build();
break;
case MSG_LOGACK:
- m = new MLogAck;
+ m = MLogAck::factory::build();
break;
case CEPH_MSG_PING:
- m = new MPing();
+ m = MPing::factory::build();
break;
case MSG_COMMAND:
- m = new MCommand;
+ m = MCommand::factory::build();
break;
case MSG_COMMAND_REPLY:
- m = new MCommandReply;
+ m = MCommandReply::factory::build();
break;
case MSG_OSD_BACKFILL_RESERVE:
- m = new MBackfillReserve;
+ m = MBackfillReserve::factory::build();
break;
case MSG_OSD_RECOVERY_RESERVE:
- m = new MRecoveryReserve;
+ m = MRecoveryReserve::factory::build();
break;
case MSG_OSD_FORCE_RECOVERY:
- m = new MOSDForceRecovery;
+ m = MOSDForceRecovery::factory::build();
break;
case MSG_ROUTE:
- m = new MRoute;
+ m = MRoute::factory::build();
break;
case MSG_FORWARD:
- m = new MForward;
+ m = MForward::factory::build();
break;
case CEPH_MSG_MON_MAP:
- m = new MMonMap;
+ m = MMonMap::factory::build();
break;
case CEPH_MSG_MON_GET_MAP:
- m = new MMonGetMap;
+ m = MMonGetMap::factory::build();
break;
case CEPH_MSG_MON_GET_OSDMAP:
- m = new MMonGetOSDMap;
+ m = MMonGetOSDMap::factory::build();
break;
case CEPH_MSG_MON_GET_VERSION:
- m = new MMonGetVersion();
+ m = MMonGetVersion::factory::build();
break;
case CEPH_MSG_MON_GET_VERSION_REPLY:
- m = new MMonGetVersionReply();
+ m = MMonGetVersionReply::factory::build();
break;
case CEPH_MSG_MON_METADATA:
- m = new MMonMetadata();
+ m = MMonMetadata::factory::build();
break;
case MSG_OSD_BOOT:
- m = new MOSDBoot();
+ m = MOSDBoot::factory::build();
break;
case MSG_OSD_ALIVE:
- m = new MOSDAlive();
+ m = MOSDAlive::factory::build();
break;
case MSG_OSD_BEACON:
- m = new MOSDBeacon();
+ m = MOSDBeacon::factory::build();
break;
case MSG_OSD_PGTEMP:
- m = new MOSDPGTemp;
+ m = MOSDPGTemp::factory::build();
break;
case MSG_OSD_FAILURE:
- m = new MOSDFailure();
+ m = MOSDFailure::factory::build();
break;
case MSG_OSD_MARK_ME_DOWN:
- m = new MOSDMarkMeDown();
+ m = MOSDMarkMeDown::factory::build();
break;
case MSG_OSD_FULL:
- m = new MOSDFull();
+ m = MOSDFull::factory::build();
break;
case MSG_OSD_PING:
- m = new MOSDPing();
+ m = MOSDPing::factory::build();
break;
case CEPH_MSG_OSD_OP:
- m = new MOSDOp();
+ m = MOSDOp::factory::build();
break;
case CEPH_MSG_OSD_OPREPLY:
- m = new MOSDOpReply();
+ m = MOSDOpReply::factory::build();
break;
case MSG_OSD_REPOP:
- m = new MOSDRepOp();
+ m = MOSDRepOp::factory::build();
break;
case MSG_OSD_REPOPREPLY:
- m = new MOSDRepOpReply();
+ m = MOSDRepOpReply::factory::build();
break;
case MSG_OSD_PG_CREATED:
- m = new MOSDPGCreated();
+ m = MOSDPGCreated::factory::build();
break;
case MSG_OSD_PG_UPDATE_LOG_MISSING:
- m = new MOSDPGUpdateLogMissing();
+ m = MOSDPGUpdateLogMissing::factory::build();
break;
case MSG_OSD_PG_UPDATE_LOG_MISSING_REPLY:
- m = new MOSDPGUpdateLogMissingReply();
+ m = MOSDPGUpdateLogMissingReply::factory::build();
break;
case CEPH_MSG_OSD_BACKOFF:
- m = new MOSDBackoff;
+ m = MOSDBackoff::factory::build();
break;
case CEPH_MSG_OSD_MAP:
- m = new MOSDMap;
+ m = MOSDMap::factory::build();
break;
case CEPH_MSG_WATCH_NOTIFY:
- m = new MWatchNotify;
+ m = MWatchNotify::factory::build();
break;
case MSG_OSD_PG_NOTIFY:
- m = new MOSDPGNotify;
+ m = MOSDPGNotify::factory::build();
break;
case MSG_OSD_PG_QUERY:
- m = new MOSDPGQuery;
+ m = MOSDPGQuery::factory::build();
break;
case MSG_OSD_PG_LOG:
- m = new MOSDPGLog;
+ m = MOSDPGLog::factory::build();
break;
case MSG_OSD_PG_REMOVE:
- m = new MOSDPGRemove;
+ m = MOSDPGRemove::factory::build();
break;
case MSG_OSD_PG_INFO:
- m = new MOSDPGInfo;
+ m = MOSDPGInfo::factory::build();
break;
case MSG_OSD_PG_CREATE:
- m = new MOSDPGCreate;
+ m = MOSDPGCreate::factory::build();
break;
case MSG_OSD_PG_CREATE2:
- m = new MOSDPGCreate2;
+ m = MOSDPGCreate2::factory::build();
break;
case MSG_OSD_PG_TRIM:
- m = new MOSDPGTrim;
+ m = MOSDPGTrim::factory::build();
break;
case MSG_OSD_SCRUB:
- m = new MOSDScrub;
+ m = MOSDScrub::factory::build();
break;
case MSG_OSD_SCRUB2:
- m = new MOSDScrub2;
+ m = MOSDScrub2::factory::build();
break;
case MSG_OSD_SCRUB_RESERVE:
- m = new MOSDScrubReserve;
+ m = MOSDScrubReserve::factory::build();
break;
case MSG_REMOVE_SNAPS:
- m = new MRemoveSnaps;
+ m = MRemoveSnaps::factory::build();
break;
case MSG_OSD_REP_SCRUB:
- m = new MOSDRepScrub;
+ m = MOSDRepScrub::factory::build();
break;
case MSG_OSD_REP_SCRUBMAP:
- m = new MOSDRepScrubMap;
+ m = MOSDRepScrubMap::factory::build();
break;
case MSG_OSD_PG_SCAN:
- m = new MOSDPGScan;
+ m = MOSDPGScan::factory::build();
break;
case MSG_OSD_PG_BACKFILL:
- m = new MOSDPGBackfill;
+ m = MOSDPGBackfill::factory::build();
break;
case MSG_OSD_PG_BACKFILL_REMOVE:
- m = new MOSDPGBackfillRemove;
+ m = MOSDPGBackfillRemove::factory::build();
break;
case MSG_OSD_PG_PUSH:
- m = new MOSDPGPush;
+ m = MOSDPGPush::factory::build();
break;
case MSG_OSD_PG_PULL:
- m = new MOSDPGPull;
+ m = MOSDPGPull::factory::build();
break;
case MSG_OSD_PG_PUSH_REPLY:
- m = new MOSDPGPushReply;
+ m = MOSDPGPushReply::factory::build();
break;
case MSG_OSD_PG_RECOVERY_DELETE:
- m = new MOSDPGRecoveryDelete;
+ m = MOSDPGRecoveryDelete::factory::build();
break;
case MSG_OSD_PG_RECOVERY_DELETE_REPLY:
- m = new MOSDPGRecoveryDeleteReply;
+ m = MOSDPGRecoveryDeleteReply::factory::build();
break;
case MSG_OSD_EC_WRITE:
- m = new MOSDECSubOpWrite;
+ m = MOSDECSubOpWrite::factory::build();
break;
case MSG_OSD_EC_WRITE_REPLY:
- m = new MOSDECSubOpWriteReply;
+ m = MOSDECSubOpWriteReply::factory::build();
break;
case MSG_OSD_EC_READ:
- m = new MOSDECSubOpRead;
+ m = MOSDECSubOpRead::factory::build();
break;
case MSG_OSD_EC_READ_REPLY:
- m = new MOSDECSubOpReadReply;
+ m = MOSDECSubOpReadReply::factory::build();
break;
// auth
case CEPH_MSG_AUTH:
- m = new MAuth;
+ m = MAuth::factory::build();
break;
case CEPH_MSG_AUTH_REPLY:
- m = new MAuthReply;
+ m = MAuthReply::factory::build();
break;
case MSG_MON_GLOBAL_ID:
- m = new MMonGlobalID;
+ m = MMonGlobalID::factory::build();
break;
// clients
case CEPH_MSG_MON_SUBSCRIBE:
- m = new MMonSubscribe;
+ m = MMonSubscribe::factory::build();
break;
case CEPH_MSG_MON_SUBSCRIBE_ACK:
- m = new MMonSubscribeAck;
+ m = MMonSubscribeAck::factory::build();
break;
case CEPH_MSG_CLIENT_SESSION:
- m = new MClientSession;
+ m = MClientSession::factory::build();
break;
case CEPH_MSG_CLIENT_RECONNECT:
- m = new MClientReconnect;
+ m = MClientReconnect::factory::build();
break;
case CEPH_MSG_CLIENT_REQUEST:
- m = new MClientRequest;
+ m = MClientRequest::factory::build();
break;
case CEPH_MSG_CLIENT_REQUEST_FORWARD:
- m = new MClientRequestForward;
+ m = MClientRequestForward::factory::build();
break;
case CEPH_MSG_CLIENT_REPLY:
- m = new MClientReply;
+ m = MClientReply::factory::build();
break;
case CEPH_MSG_CLIENT_CAPS:
- m = new MClientCaps;
+ m = MClientCaps::factory::build();
break;
case CEPH_MSG_CLIENT_CAPRELEASE:
- m = new MClientCapRelease;
+ m = MClientCapRelease::factory::build();
break;
case CEPH_MSG_CLIENT_LEASE:
- m = new MClientLease;
+ m = MClientLease::factory::build();
break;
case CEPH_MSG_CLIENT_SNAP:
- m = new MClientSnap;
+ m = MClientSnap::factory::build();
break;
case CEPH_MSG_CLIENT_QUOTA:
- m = new MClientQuota;
+ m = MClientQuota::factory::build();
break;
// mds
case MSG_MDS_SLAVE_REQUEST:
- m = new MMDSSlaveRequest;
+ m = MMDSSlaveRequest::factory::build();
break;
case CEPH_MSG_MDS_MAP:
- m = new MMDSMap;
+ m = MMDSMap::factory::build();
break;
case CEPH_MSG_FS_MAP:
- m = new MFSMap;
+ m = MFSMap::factory::build();
break;
case CEPH_MSG_FS_MAP_USER:
- m = new MFSMapUser;
+ m = MFSMapUser::factory::build();
break;
case MSG_MDS_BEACON:
- m = new MMDSBeacon;
+ m = MMDSBeacon::factory::build();
break;
case MSG_MDS_OFFLOAD_TARGETS:
- m = new MMDSLoadTargets;
+ m = MMDSLoadTargets::factory::build();
break;
case MSG_MDS_RESOLVE:
- m = new MMDSResolve;
+ m = MMDSResolve::factory::build();
break;
case MSG_MDS_RESOLVEACK:
- m = new MMDSResolveAck;
+ m = MMDSResolveAck::factory::build();
break;
case MSG_MDS_CACHEREJOIN:
- m = new MMDSCacheRejoin;
+ m = MMDSCacheRejoin::factory::build();
break;
case MSG_MDS_DIRUPDATE:
- m = new MDirUpdate();
+ m = MDirUpdate::factory::build();
break;
case MSG_MDS_DISCOVER:
- m = new MDiscover();
+ m = MDiscover::factory::build();
break;
case MSG_MDS_DISCOVERREPLY:
- m = new MDiscoverReply();
+ m = MDiscoverReply::factory::build();
break;
case MSG_MDS_FINDINO:
- m = new MMDSFindIno;
+ m = MMDSFindIno::factory::build();
break;
case MSG_MDS_FINDINOREPLY:
- m = new MMDSFindInoReply;
+ m = MMDSFindInoReply::factory::build();
break;
case MSG_MDS_OPENINO:
- m = new MMDSOpenIno;
+ m = MMDSOpenIno::factory::build();
break;
case MSG_MDS_OPENINOREPLY:
- m = new MMDSOpenInoReply;
+ m = MMDSOpenInoReply::factory::build();
break;
case MSG_MDS_SNAPUPDATE:
- m = new MMDSSnapUpdate();
+ m = MMDSSnapUpdate::factory::build();
break;
case MSG_MDS_FRAGMENTNOTIFY:
- m = new MMDSFragmentNotify;
+ m = MMDSFragmentNotify::factory::build();
break;
case MSG_MDS_EXPORTDIRDISCOVER:
- m = new MExportDirDiscover();
+ m = MExportDirDiscover::factory::build();
break;
case MSG_MDS_EXPORTDIRDISCOVERACK:
- m = new MExportDirDiscoverAck();
+ m = MExportDirDiscoverAck::factory::build();
break;
case MSG_MDS_EXPORTDIRCANCEL:
- m = new MExportDirCancel();
+ m = MExportDirCancel::factory::build();
break;
case MSG_MDS_EXPORTDIR:
- m = new MExportDir;
+ m = MExportDir::factory::build();
break;
case MSG_MDS_EXPORTDIRACK:
- m = new MExportDirAck;
+ m = MExportDirAck::factory::build();
break;
case MSG_MDS_EXPORTDIRFINISH:
- m = new MExportDirFinish;
+ m = MExportDirFinish::factory::build();
break;
case MSG_MDS_EXPORTDIRNOTIFY:
- m = new MExportDirNotify();
+ m = MExportDirNotify::factory::build();
break;
case MSG_MDS_EXPORTDIRNOTIFYACK:
- m = new MExportDirNotifyAck();
+ m = MExportDirNotifyAck::factory::build();
break;
case MSG_MDS_EXPORTDIRPREP:
- m = new MExportDirPrep();
+ m = MExportDirPrep::factory::build();
break;
case MSG_MDS_EXPORTDIRPREPACK:
- m = new MExportDirPrepAck();
+ m = MExportDirPrepAck::factory::build();
break;
case MSG_MDS_EXPORTCAPS:
- m = new MExportCaps;
+ m = MExportCaps::factory::build();
break;
case MSG_MDS_EXPORTCAPSACK:
- m = new MExportCapsAck;
+ m = MExportCapsAck::factory::build();
break;
case MSG_MDS_GATHERCAPS:
- m = new MGatherCaps;
+ m = MGatherCaps::factory::build();
break;
case MSG_MDS_DENTRYUNLINK:
- m = new MDentryUnlink;
+ m = MDentryUnlink::factory::build();
break;
case MSG_MDS_DENTRYLINK:
- m = new MDentryLink;
+ m = MDentryLink::factory::build();
break;
case MSG_MDS_HEARTBEAT:
- m = new MHeartbeat();
+ m = MHeartbeat::factory::build();
break;
case MSG_MDS_CACHEEXPIRE:
- m = new MCacheExpire();
+ m = MCacheExpire::factory::build();
break;
case MSG_MDS_TABLE_REQUEST:
- m = new MMDSTableRequest;
+ m = MMDSTableRequest::factory::build();
break;
/* case MSG_MDS_INODEUPDATE:
- m = new MInodeUpdate();
+ m = MInodeUpdate::factory::build();
break;
*/
case MSG_MDS_INODEFILECAPS:
- m = new MInodeFileCaps();
+ m = MInodeFileCaps::factory::build();
break;
case MSG_MDS_LOCK:
- m = new MLock();
+ m = MLock::factory::build();
break;
case MSG_MGR_BEACON:
- m = new MMgrBeacon();
+ m = MMgrBeacon::factory::build();
break;
case MSG_MON_MGR_REPORT:
- m = new MMonMgrReport();
+ m = MMonMgrReport::factory::build();
break;
case MSG_SERVICE_MAP:
- m = new MServiceMap();
+ m = MServiceMap::factory::build();
break;
case MSG_MGR_MAP:
- m = new MMgrMap();
+ m = MMgrMap::factory::build();
break;
case MSG_MGR_DIGEST:
- m = new MMgrDigest();
+ m = MMgrDigest::factory::build();
break;
case MSG_MGR_OPEN:
- m = new MMgrOpen();
+ m = MMgrOpen::factory::build();
break;
case MSG_MGR_CLOSE:
- m = new MMgrClose();
+ m = MMgrClose::factory::build();
break;
case MSG_MGR_REPORT:
- m = new MMgrReport();
+ m = MMgrReport::factory::build();
break;
case MSG_MGR_CONFIGURE:
- m = new MMgrConfigure();
+ m = MMgrConfigure::factory::build();
break;
case MSG_TIMECHECK:
- m = new MTimeCheck();
+ m = MTimeCheck::factory::build();
break;
case MSG_TIMECHECK2:
- m = new MTimeCheck2();
+ m = MTimeCheck2::factory::build();
break;
case MSG_MON_HEALTH:
- m = new MMonHealth();
+ m = MMonHealth::factory::build();
break;
case MSG_MON_HEALTH_CHECKS:
- m = new MMonHealthChecks();
+ m = MMonHealthChecks::factory::build();
break;
#if defined(HAVE_XIO)
case MSG_DATA_PING:
- m = new MDataPing();
+ m = MDataPing::factory::build();
break;
#endif
// -- simple messages without payload --
case CEPH_MSG_SHUTDOWN:
- m = new MGenericMessage(type);
+ m = MGenericMessage::factory::build(type);
break;
default:
if (cct->_conf->ms_die_on_bad_msg)
ceph_abort();
}
- m->put();
return 0;
}
if (cct->_conf->ms_die_on_bad_msg)
ceph_abort();
}
- m->put();
return 0;
}
// done!
- return m;
+ return m.detach();
}
void Message::encode_trace(bufferlist &bl, uint64_t features) const
extern Message *decode_message(CephContext *cct, int crcflags,
bufferlist::const_iterator& bl);
+template <class MessageType>
+class MessageFactory {
+public:
+template<typename... Args>
+ static typename MessageType::ref build(Args&&... args) {
+ return typename MessageType::ref(new MessageType(std::forward<Args>(args)...), false);
+ }
+};
+
#endif
template<class T>
class MessageDencoderImpl : public Dencoder {
- T *m_object;
- list<T*> m_list;
+ typename T::ref m_object;
+ list<typename T::ref> m_list;
public:
- MessageDencoderImpl() {
- m_object = new T;
- }
- ~MessageDencoderImpl() override {
- m_object->put();
- }
+ MessageDencoderImpl() : m_object(T::factory::build()) {}
+ ~MessageDencoderImpl() override {}
string decode(bufferlist bl, uint64_t seek) override {
auto p = bl.cbegin();
p.seek(seek);
try {
- Message *n = decode_message(g_ceph_context, 0, p);
+ Message::ref n(decode_message(g_ceph_context, 0, p), false);
if (!n)
throw std::runtime_error("failed to decode");
if (n->get_type() != m_object->get_type()) {
ss << "decoded type " << n->get_type() << " instead of expected " << m_object->get_type();
throw std::runtime_error(ss.str());
}
- m_object->put();
- m_object = static_cast<T *>(n);
+ m_object = boost::static_pointer_cast<typename T::ref::element_type, std::remove_reference<decltype(n)>::type::element_type>(n);
}
catch (buffer::error& e) {
return e.what();
void encode(bufferlist& out, uint64_t features) override {
out.clear();
- encode_message(m_object, features, out);
+ encode_message(m_object.get(), features, out);
}
void dump(ceph::Formatter *f) override {
i = m_list.size();
if ((i == 0) || (i > m_list.size()))
return "invalid id for generated object";
- m_object->put();
m_object = *(std::next(m_list.begin(), i-1));
return string();
}
#include "messages/MWatchNotify.h"
MESSAGE(MWatchNotify)
-
-#include "messages/PaxosServiceMessage.h"
-MESSAGE(PaxosServiceMessage)