0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OperationDropTable.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 
26 
27 #ifndef Hypertable_Master_OperationDropTable_h
28 #define Hypertable_Master_OperationDropTable_h
29 
31 
34 
35 #include <Common/StringExt.h>
36 
37 #include <vector>
38 
39 namespace Hypertable {
40 
43 
45  class OperationDropTable : public Operation {
46  public:
47 
61  OperationDropTable(ContextPtr &context, const String &name, bool if_exists,
62  TableParts parts);
63 
67  OperationDropTable(ContextPtr &context, const MetaLog::EntityHeader &header_);
68 
72  OperationDropTable(ContextPtr &context, EventPtr &event);
73 
75  virtual ~OperationDropTable() { }
76 
78  void execute() override;
79 
82  const String name() override;
83 
89  const String label() override;
90 
97  void display_state(std::ostream &os) override;
98 
99  uint8_t encoding_version_state() const override;
100 
106  size_t encoded_length_state() const override;
107 
143  void encode_state(uint8_t **bufp) const override;
144 
154  void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
155 
156  void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override;
157 
158  private:
159 
162 
165 
168 
171 
174  };
175 
177 
178 }
179 
180 #endif // Hypertable_Master_OperationDropTable_h
std::set< String > StringSet
STL Set managing Strings.
Definition: StringExt.h:42
Carries out a drop table operation.
TableParts m_parts
Specification for which parts of table to drop.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
Declarations for Operation.
OperationDropTable(ContextPtr &context, const String &name, bool if_exists, TableParts parts)
Constructor.
const String label() override
Returns descriptive label for operation.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Definition: Event.h:228
StringSet m_servers
Set of participating range servers.
Declarations for DropTable request parameters.
StringSet m_completed
Range servers for which drop table operation has completed successfuly
Represents a set of table parts (sub-tables).
Definition: TableParts.h:47
void encode_state(uint8_t **bufp) const override
Writes serialized encoding of object state.
void display_state(std::ostream &os) override
Writes human readable representation of object to output stream.
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
Request parameters for drop table operation.
Definition: DropTable.h:46
Lib::Master::Request::Parameters::DropTable m_params
Request parmaeters.
void execute() override
Carries out the drop table operation.
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Decodes state from serialized object.
Hypertable definitions
Abstract base class for master operations.
Definition: Operation.h:124
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
size_t encoded_length_state() const override
Returns serialized state length.
const String name() override
Returns name of operation ("OperationDropTable")
uint8_t encoding_version_state() const override
Returns version of encoding format of state.
virtual ~OperationDropTable()
Destructor.
String extensions and helpers: sets, maps, append operators etc.
Declarations for TableParts.