0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OperationSetState.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
28 #ifndef Hypertable_Master_OperationSetState_h
29 #define Hypertable_Master_OperationSetState_h
30 
31 #include "Operation.h"
32 
35 
36 #include <Common/StringExt.h>
37 
38 namespace Hypertable {
39 
42 
44  class OperationSetState : public Operation {
45  public:
46 
54  OperationSetState(ContextPtr &context);
55 
62  OperationSetState(ContextPtr &context, const MetaLog::EntityHeader &header_);
63 
72  OperationSetState(ContextPtr &context, EventPtr &event);
73 
75  virtual ~OperationSetState() { }
76 
79  void execute() override;
80 
84  const String name() override;
85 
89  const String label() override;
90 
95  void display_state(std::ostream &os) override;
96 
97  uint8_t encoding_version_state() const override;
98 
100  size_t encoded_length_state() const override;
101 
116  void encode_state(uint8_t **bufp) const override;
117 
124  void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
125 
126  void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
127 
128  private:
129 
136 
139 
141  uint64_t m_generation;
142 
144  std::vector<SystemVariable::Spec> m_specs;
145  };
146 
148 
149 }
150 
151 #endif // Hypertable_Master_OperationSetState_h
Request parameters for set state operation.
Definition: SetState.h:49
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
Declarations for SystemVariable.
Declarations for Operation.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Definition: Event.h:228
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
size_t encoded_length_state() const override
Returns length of encoded state.
virtual ~OperationSetState()
Destructor.
uint8_t encoding_version_state() const override
Returns version of encoding format of state.
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Decodes operation state.
OperationSetState(ContextPtr &context)
Constructor.
std::vector< SystemVariable::Spec > m_specs
Current system state variables.
Carries out a set variables operation.
const String label() override
Returns textual string describing operation plus state.
const String name() override
Returns operation name (OperationSetState)
Hypertable definitions
uint64_t m_generation
Generation number of system state variables (m_specs)a.
void initialize_dependencies()
Initializes operation dependencies.
void execute() override
Executes "set state" operation.
Abstract base class for master operations.
Definition: Operation.h:124
Lib::Master::Request::Parameters::SetState m_params
Request parmaeters.
Declarations for SetState request parameters.
void display_state(std::ostream &os) override
Displays textual representation of object state.
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
void encode_state(uint8_t **bufp) const override
Encodes operation state.
String extensions and helpers: sets, maps, append operators etc.