0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OperationCompact.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_OperationCompact_h
29 #define Hypertable_Master_OperationCompact_h
30 
31 #include "Operation.h"
32 
34 
35 #include <Common/StringExt.h>
36 
37 #include <string>
38 
39 namespace Hypertable {
40 
43 
45  class OperationCompact : public Operation {
46  public:
47 
51  OperationCompact(ContextPtr &context, const MetaLog::EntityHeader &header_);
52 
60  OperationCompact(ContextPtr &context, EventPtr &event);
61 
63  virtual ~OperationCompact() { }
64 
66  void execute() override;
67 
71  const std::string name() override;
72 
76  const std::string label() override;
77 
81  void display_state(std::ostream &os) override;
82 
83  uint8_t encoding_version_state() const override;
84 
90  size_t encoded_length_state() const override;
91 
127  void encode_state(uint8_t **bufp) const override;
128 
139  void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
140 
141  void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
142 
143  private:
144 
152 
155 
157  std::string m_id;
158 
161 
164  };
165 
167 
168 }
169 
170 #endif // Hypertable_Master_OperationCompact_h
std::set< String > StringSet
STL Set managing Strings.
Definition: StringExt.h:42
void execute() override
Carries out the manual compaction operation.
void initialize_dependencies()
Initializes dependency graph state.
void encode_state(uint8_t **bufp) const override
Writes serialized encoding of object state.
Declarations for Operation.
OperationCompact(ContextPtr &context, const MetaLog::EntityHeader &header_)
Constructor for constructing object from MetaLog entry.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Definition: Event.h:228
StringSet m_completed
Set of range servers that have completed operation.
Request parameters for compact operation.
Definition: Compact.h:46
Declarations for Compact request parameters.
size_t encoded_length_state() const override
Returns serialized state length.
virtual ~OperationCompact()
Destructor.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
Carries out a manual compaction operation.
std::string m_id
Table identifier
Lib::Master::Request::Parameters::Compact m_params
Request parmaeters.
StringSet m_servers
Set of participating range servers.
Hypertable definitions
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
const std::string label() override
Returns descriptive label for operation.
uint8_t encoding_version_state() const override
Returns version of encoding format of state.
Abstract base class for master operations.
Definition: Operation.h:124
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized encoding of object state.
const std::string name() override
Returns name of operation ("OperationCompact")
void display_state(std::ostream &os) override
Writes human readable representation of object to output stream.
String extensions and helpers: sets, maps, append operators etc.