0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
AlterTable.cc
Go to the documentation of this file.
1 /*
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; either version 3
9  * of the 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 #include <Common/Compat.h>
28 
29 #include "AlterTable.h"
30 
32 
33 #include <Common/Logger.h>
34 #include <Common/Serialization.h>
35 
36 using namespace Hypertable;
38 
39 AlterTable::AlterTable(const std::string &name, const std::string &schema, bool force)
40  : m_name(name), m_schema(schema), m_force(force) {
42 }
43 
44 
46  return 1;
47 }
48 
52 }
53 
74 void AlterTable::encode_internal(uint8_t **bufp) const {
78 }
79 
80 void AlterTable::decode_internal(uint8_t version, const uint8_t **bufp,
81  size_t *remainp) {
82  m_name.clear();
83  m_name.append(Serialization::decode_vstr(bufp, remainp));
84  m_schema.clear();
85  m_schema.append(Serialization::decode_vstr(bufp, remainp));
86  m_force = Serialization::decode_bool(bufp, remainp);
87 }
88 
89 
90 
char * decode_vstr(const uint8_t **bufp, size_t *remainp)
Decode a vstr (vint64, data, null).
uint8_t encoding_version() const override
Returns encoding version.
Definition: AlterTable.cc:45
Declarations for Canonicalize.
size_t encoded_length_internal() const override
Returns internal serialized length.
Definition: AlterTable.cc:49
Declarations for AlterTable request parameters.
size_t encoded_length_vstr(size_t len)
Computes the encoded length of vstr (vint64, data, null)
void decode_internal(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized representation of object from a buffer.
Definition: AlterTable.cc:80
bool decode_bool(const uint8_t **bufp, size_t *remainp)
Decodes a boolean value from the given buffer.
Definition: Serialization.h:96
Logging routines and macros.
Compatibility Macros for C/C++.
Functions to serialize/deserialize primitives to/from a memory buffer.
void encode_vstr(uint8_t **bufp, const void *buf, size_t len)
Encode a buffer as variable length string (vint64, data, null)
Hypertable definitions
void encode_bool(uint8_t **bufp, bool bval)
Encodes a boolean into the given buffer.
Definition: Serialization.h:84
void encode_internal(uint8_t **bufp) const override
Writes serialized representation of object to a buffer.
Definition: AlterTable.cc:74
static void table_name(std::string &name)
Canonicalizes a table name.
Definition: Canonicalize.cc:38
bool m_force
Force schema alteration even if generation does not match original.
Definition: AlterTable.h:105