0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OperationCreateTable.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_OperationCreateTable_h
28 #define Hypertable_Master_OperationCreateTable_h
29 
31 
34 
35 namespace Hypertable {
36 
39 
46  public:
47 
55  OperationCreateTable(ContextPtr &context, const String &name,
56  const String &schema, TableParts parts);
57 
63  Operation(context, header) { }
64 
74  OperationCreateTable(ContextPtr &context, EventPtr &event);
75 
77  virtual ~OperationCreateTable() { }
78 
80  void execute() override;
81 
85  const String name() override;
86 
90  const String label() override;
91 
94  void display_state(std::ostream &os) override;
95 
98  uint8_t encoding_version_state() const override;
99 
105  size_t encoded_length_state() const override;
106 
134  void encode_state(uint8_t **bufp) const override;
135 
145  void decode_state(uint8_t version,
146  const uint8_t **bufp, size_t *remainp) override;
147 
148  void decode_state_old(uint8_t version,
149  const uint8_t **bufp, size_t *remainp) override;
150 
151  private:
152 
155 
158 
161 
164 
167 
168  };
169 
171 
172 } // namespace Hypertable
173 
174 #endif // Hypertable_Master_OperationCreateTable_h
size_t encoded_length_state() const override
Returns serialized state length.
void decode_state(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized encoding of object state.
void display_state(std::ostream &os) override
Writes human readable representation of object to output stream.
Lib::Master::Request::Parameters::CreateTable m_params
Request parmaeters.
std::string String
A String is simply a typedef to std::string.
Definition: String.h:44
Request parameters for create table operation.
Definition: CreateTable.h:46
void decode_state_old(uint8_t version, const uint8_t **bufp, size_t *remainp) override
OperationCreateTable(ContextPtr &context, const String &name, const String &schema, TableParts parts)
Constructor.
Declarations for Operation.
std::shared_ptr< Event > EventPtr
Smart pointer to Event.
Definition: Event.h:228
const String label() override
Returns label for operation Returns string "CreateTable " Label for operation.
EntityHeader header
Entity header
TableParts m_parts
Which parts of table to create.
Represents a set of table parts (sub-tables).
Definition: TableParts.h:47
String m_schema
Schema for the table
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition: Context.h:265
Wrapper for TableIdentifier providing member storage.
Declarations for CreateTable request parameters.
OperationCreateTable(ContextPtr &context, const MetaLog::EntityHeader &header)
Constructor with MML entity.
const String name() override
Returns name of operation Returns name of operation (OperationCreateTable)
Carries out a create table operation.
String m_location
Proxy name of server to hold initial range
Hypertable definitions
TableIdentifierManaged m_table
Table identifier
uint8_t encoding_version_state() const override
Returns encoding version of serialization format.
void execute() override
Carries out the create table operation.
Abstract base class for master operations.
Definition: Operation.h:124
void encode_state(uint8_t **bufp) const override
Writes serialized encoding of object state.
virtual ~OperationCreateTable()
Destructor.
Declarations for TableParts.