]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MMonCommand.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_MMONCOMMAND_H
16 #define CEPH_MMONCOMMAND_H
18 #include "messages/PaxosServiceMessage.h"
23 class MMonCommand
: public PaxosServiceMessage
{
25 // weird note: prior to octopus, MgrClient would leave fsid blank when
26 // sending commands to the mgr. Starting with octopus, this is either
27 // populated with a valid fsid (tell command) or an MMgrCommand is sent
30 std::vector
<std::string
> cmd
;
32 MMonCommand() : PaxosServiceMessage
{MSG_MON_COMMAND
, 0} {}
33 MMonCommand(const uuid_d
&f
)
34 : PaxosServiceMessage
{MSG_MON_COMMAND
, 0},
39 ~MMonCommand() override
{}
42 std::string_view
get_type_name() const override
{ return "mon_command"; }
43 void print(std::ostream
& o
) const override
{
45 for (unsigned i
=0; i
<cmd
.size(); i
++) {
49 o
<< " v " << version
<< ")";
52 void encode_payload(uint64_t features
) override
{
55 encode(fsid
, payload
);
58 void decode_payload() override
{
60 auto p
= payload
.cbegin();
66 template<class T
, typename
... Args
>
67 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);