diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-01-31 09:48:19 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-01-31 09:48:19 +0100 |
commit | ab83952f293ea46c00e421c81b81a394c9cae2b4 (patch) | |
tree | 6a3e995bd1330828a0e988d896bca218863fc74c /storage | |
parent | 055b62f404ee0a0463ee8ff98a0e24c083b95f1d (diff) | |
parent | 5267af5e9e5e601d4f4b1ef40730da1e36d38d9d (diff) | |
download | mariadb-git-ab83952f293ea46c00e421c81b81a394c9cae2b4.tar.gz |
10.0-base merge
Diffstat (limited to 'storage')
112 files changed, 29859 insertions, 774 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 75026f2a443..342f8be956e 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1666,7 +1666,7 @@ int ha_archive::info(uint flag) turn will keep selects from causing a sync to occur. Basically, yet another optimizations to keep compression working well. */ -void ha_archive::start_bulk_insert(ha_rows rows) +void ha_archive::start_bulk_insert(ha_rows rows, uint flags) { DBUG_ENTER("ha_archive::start_bulk_insert"); if (!rows || rows >= ARCHIVE_MIN_ROWS_TO_USE_BULK_INSERT) diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index d1c4bfbc7fb..627267c7306 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -136,7 +136,7 @@ public: int optimize(THD* thd, HA_CHECK_OPT* check_opt); int repair(THD* thd, HA_CHECK_OPT* check_opt); int check_for_upgrade(HA_CHECK_OPT *check_opt); - void start_bulk_insert(ha_rows rows); + void start_bulk_insert(ha_rows rows, uint flags); int end_bulk_insert(); enum row_type get_row_type() const { diff --git a/storage/cassandra/CMakeLists.txt b/storage/cassandra/CMakeLists.txt new file mode 100644 index 00000000000..dbccc2eb127 --- /dev/null +++ b/storage/cassandra/CMakeLists.txt @@ -0,0 +1,68 @@ +# use the first path that has Thrift.h included, if found + +FIND_PATH(Thrift_INCLUDE_DIRS Thrift.h PATHS +$ENV{THRIFT_INCLUDE} # environment variable to be used optionally +${Thrift_INCLUDE_DIR} # this may be set +/usr/local/include/thrift # list of additional directories to look from +/opt/local/include/thrift +/usr/include/thrift +/opt/include/thrift +) + +# Verify that thrift linking library is found +FIND_LIBRARY(Thrift_LIBS NAMES thrift PATHS ${Thrift_LIB_PATHS} ${Thrift_LIB}) +IF(EXISTS ${Thrift_LIBS}) + GET_FILENAME_COMPONENT(LINK_DIR ${Thrift_LIBS} PATH ABSOLUTE) +ELSE() + RETURN() +ENDIF() + +INCLUDE_DIRECTORIES(AFTER ${Thrift_INCLUDE_DIRS}) +SET(CMAKE_REQUIRED_INCLUDES ${Thrift_INCLUDE_DIRS}) + +STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) +STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + +CHECK_CXX_SOURCE_COMPILES( +" +#include <Thrift.h> +#include <boost/shared_ptr.hpp> +int main() { + boost::shared_ptr<char> p(new char(10)); + return 0; +} +" CASSANDRASE_OK) + +IF(CASSANDRASE_OK) + SET(cassandra_sources + ha_cassandra.cc + ha_cassandra.h + cassandra_se.h + cassandra_se.cc + gen-cpp/Cassandra.cpp + gen-cpp/cassandra_types.h + gen-cpp/cassandra_types.cpp + gen-cpp/cassandra_constants.h + gen-cpp/cassandra_constants.cpp + gen-cpp/Cassandra.h) + + LINK_DIRECTORIES(${LINK_DIR}) + + MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES thrift COMPONENT CassandraSE) + IF (INSTALL_SYSCONFDIR) + INSTALL(FILES cassandra.cnf DESTINATION ${INSTALL_SYSCONFDIR}/my.cnf.d + COMPONENT CassandraSE) + ENDIF(INSTALL_SYSCONFDIR) + + IF(RPM) + SET(CPACK_COMPONENT_CASSANDRASELIBRARIES_GROUP "CassandraSE" PARENT_SCOPE) + SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} CassandraSE PARENT_SCOPE) + SET(CPACK_RPM_CassandraSE_PACKAGE_REQUIRES "MariaDB-server" PARENT_SCOPE) + + # workarounds for cmake issues #13248 and #12864: + SET(CPACK_RPM_CassandraSE_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*" PARENT_SCOPE) + SET(CPACK_RPM_CassandraSE_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) + SET(CPACK_RPM_CassandraSE_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) + ENDIF(RPM) + +ENDIF(CASSANDRASE_OK) diff --git a/storage/cassandra/cassandra.cnf b/storage/cassandra/cassandra.cnf new file mode 100644 index 00000000000..8f4b3d6f91e --- /dev/null +++ b/storage/cassandra/cassandra.cnf @@ -0,0 +1,2 @@ +[mariadb] +plugin-load-add=ha_cassandra.so diff --git a/storage/cassandra/cassandra_se.cc b/storage/cassandra/cassandra_se.cc new file mode 100644 index 00000000000..0d62c5af7a6 --- /dev/null +++ b/storage/cassandra/cassandra_se.cc @@ -0,0 +1,800 @@ + +// Cassandra includes: +#include <inttypes.h> +#include <netinet/in.h> +#include <sys/time.h> +#include <stdio.h> +#include <stdarg.h> + +#include "Thrift.h" +#include "transport/TSocket.h" +#include "transport/TTransport.h" +#include "transport/TBufferTransports.h" +#include "protocol/TProtocol.h" +#include "protocol/TBinaryProtocol.h" +#include "gen-cpp/Cassandra.h" +// cassandra includes end + +#include "cassandra_se.h" + +struct st_mysql_lex_string +{ + char *str; + size_t length; +}; + +using namespace std; +using namespace apache::thrift; +using namespace apache::thrift::transport; +using namespace apache::thrift::protocol; +using namespace org::apache::cassandra; + + +/* + Implementation of connection to one Cassandra column family (ie., table) +*/ +class Cassandra_se_impl: public Cassandra_se_interface +{ + CassandraClient *cass; /* Connection to cassandra */ + + std::string column_family; + std::string keyspace; + + ConsistencyLevel::type write_consistency; + ConsistencyLevel::type read_consistency; + + /* How many times to retry an operation before giving up */ + int thrift_call_retries_to_do; + + + /* DDL data */ + KsDef ks_def; /* KeySpace we're using (TODO: put this in table->share) */ + CfDef cf_def; /* Column family we're using (TODO: put in table->share)*/ + std::vector<ColumnDef>::iterator column_ddl_it; + + /* The list that was returned by the last key lookup */ + std::vector<ColumnOrSuperColumn> column_data_vec; + std::vector<ColumnOrSuperColumn>::iterator column_data_it; + + /* Insert preparation */ + typedef std::map<std::string, std::vector<Mutation> > ColumnFamilyToMutation; + typedef std::map<std::string, ColumnFamilyToMutation> KeyToCfMutationMap; + + KeyToCfMutationMap batch_mutation; /* Prepare operation here */ + int64_t insert_timestamp; + std::vector<Mutation>* insert_list; + + /* Resultset we're reading */ + std::vector<KeySlice> key_slice_vec; + std::vector<KeySlice>::iterator key_slice_it; + + std::string rowkey; /* key of the record we're returning now */ + + SlicePredicate slice_pred; + SliceRange slice_pred_sr; + bool get_slices_returned_less; + bool get_slice_found_rows; +public: + Cassandra_se_impl() : cass(NULL), + write_consistency(ConsistencyLevel::ONE), + read_consistency(ConsistencyLevel::ONE), + thrift_call_retries_to_do(0) {} + virtual ~Cassandra_se_impl(){ delete cass; } + + /* Connection and DDL checks */ + bool connect(const char *host, int port, const char *keyspace); + void set_column_family(const char *cfname) { column_family.assign(cfname); } + + bool setup_ddl_checks(); + void first_ddl_column(); + bool next_ddl_column(char **name, int *name_len, char **value, int *value_len); + void get_rowkey_type(char **name, char **type); + size_t get_ddl_size(); + const char* get_default_validator(); + + /* Settings */ + void set_consistency_levels(ulong read_cons_level, ulong write_cons_level); + + /* Writes */ + void clear_insert_buffer(); + void start_row_insert(const char *key, int key_len); + void add_insert_column(const char *name, int name_len, + const char *value, int value_len); + void add_insert_delete_column(const char *name, int name_len); + void add_row_deletion(const char *key, int key_len, + Column_name_enumerator *col_names, + LEX_STRING *names, uint nnames); + + bool do_insert(); + + /* Reads, point lookups */ + bool get_slice(char *key, size_t key_len, bool *found); + bool get_next_read_column(char **name, int *name_len, + char **value, int *value_len ); + void get_read_rowkey(char **value, int *value_len); + + /* Reads, multi-row scans */ +private: + bool have_rowkey_to_skip; + std::string rowkey_to_skip; + + bool get_range_slices_param_last_key_as_start_key; +public: + bool get_range_slices(bool last_key_as_start_key); + void finish_reading_range_slices(); + bool get_next_range_slice_row(bool *eof); + + /* Setup that's necessary before a multi-row read. (todo: use it before point lookups, too) */ + void clear_read_columns(); + void clear_read_all_columns(); + void add_read_column(const char *name); + + /* Reads, MRR scans */ + void new_lookup_keys(); + int add_lookup_key(const char *key, size_t key_len); + bool multiget_slice(); + + bool get_next_multiget_row(); + + bool truncate(); + + bool remove_row(); + +private: + bool retryable_truncate(); + bool retryable_do_insert(); + bool retryable_remove_row(); + bool retryable_setup_ddl_checks(); + bool retryable_multiget_slice(); + bool retryable_get_range_slices(); + bool retryable_get_slice(); + + std::vector<std::string> mrr_keys; /* can we use allocator to put these into MRR buffer? */ + std::map<std::string, std::vector<ColumnOrSuperColumn> > mrr_result; + std::map<std::string, std::vector<ColumnOrSuperColumn> >::iterator mrr_result_it; + + /* Non-inherited utility functions: */ + int64_t get_i64_timestamp(); + + typedef bool (Cassandra_se_impl::*retryable_func_t)(); + bool try_operation(retryable_func_t func); +}; + + +///////////////////////////////////////////////////////////////////////////// +// Connection and setup +///////////////////////////////////////////////////////////////////////////// +Cassandra_se_interface *create_cassandra_se() +{ + return new Cassandra_se_impl; +} + + +bool Cassandra_se_impl::connect(const char *host, int port, const char *keyspace_arg) +{ + bool res= true; + + keyspace.assign(keyspace_arg); + + try { + boost::shared_ptr<TTransport> socket = + boost::shared_ptr<TSocket>(new TSocket(host, port)); + boost::shared_ptr<TTransport> tr = + boost::shared_ptr<TFramedTransport>(new TFramedTransport (socket)); + boost::shared_ptr<TProtocol> p = + boost::shared_ptr<TBinaryProtocol>(new TBinaryProtocol(tr)); + + cass= new CassandraClient(p); + tr->open(); + cass->set_keyspace(keyspace_arg); + + res= false; // success + }catch(TTransportException te){ + print_error("%s [%d]", te.what(), te.getType()); + }catch(InvalidRequestException ire){ + print_error("%s [%s]", ire.what(), ire.why.c_str()); + }catch(NotFoundException nfe){ + print_error("%s", nfe.what()); + }catch(TException e){ + print_error("Thrift exception: %s", e.what()); + }catch (...) { + print_error("Unknown exception"); + } + + if (!res && setup_ddl_checks()) + res= true; + return res; +} + + +void Cassandra_se_impl::set_consistency_levels(ulong read_cons_level, + ulong write_cons_level) +{ + write_cons_level= (ConsistencyLevel::type)(write_cons_level + 1); + read_cons_level= (ConsistencyLevel::type)(read_cons_level + 1); +} + + +bool Cassandra_se_impl::retryable_setup_ddl_checks() +{ + try { + + cass->describe_keyspace(ks_def, keyspace); + + } catch (NotFoundException nfe) { + print_error("keyspace `%s` not found: %s", keyspace.c_str(), nfe.what()); + return true; + } + + std::vector<CfDef>::iterator it; + for (it= ks_def.cf_defs.begin(); it < ks_def.cf_defs.end(); it++) + { + cf_def= *it; + if (!cf_def.name.compare(column_family)) + return false; + } + + print_error("Column family %s not found in keyspace %s", + column_family.c_str(), + keyspace.c_str()); + return true; +} + +bool Cassandra_se_impl::setup_ddl_checks() +{ + return try_operation(&Cassandra_se_impl::retryable_setup_ddl_checks); +} + + +void Cassandra_se_impl::first_ddl_column() +{ + column_ddl_it= cf_def.column_metadata.begin(); +} + + +bool Cassandra_se_impl::next_ddl_column(char **name, int *name_len, + char **type, int *type_len) +{ + if (column_ddl_it == cf_def.column_metadata.end()) + return true; + + *name= (char*)(*column_ddl_it).name.c_str(); + *name_len= (*column_ddl_it).name.length(); + + *type= (char*)(*column_ddl_it).validation_class.c_str(); + *type_len= (*column_ddl_it).validation_class.length(); + + column_ddl_it++; + return false; +} + + +void Cassandra_se_impl::get_rowkey_type(char **name, char **type) +{ + if (cf_def.__isset.key_validation_class) + *type= (char*)cf_def.key_validation_class.c_str(); + else + *type= NULL; + + if (cf_def.__isset.key_alias) + *name= (char*)cf_def.key_alias.c_str(); + else + *name= NULL; +} + +size_t Cassandra_se_impl::get_ddl_size() +{ + return cf_def.column_metadata.size(); +} + +const char* Cassandra_se_impl::get_default_validator() +{ + return cf_def.default_validation_class.c_str(); +} + + +///////////////////////////////////////////////////////////////////////////// +// Data writes +///////////////////////////////////////////////////////////////////////////// +int64_t Cassandra_se_impl::get_i64_timestamp() +{ + struct timeval td; + gettimeofday(&td, NULL); + int64_t ms = td.tv_sec; + ms = ms * 1000; + int64_t usec = td.tv_usec; + usec = usec / 1000; + ms += usec; + + return ms; +} + + +void Cassandra_se_impl::clear_insert_buffer() +{ + batch_mutation.clear(); +} + + +void Cassandra_se_impl::start_row_insert(const char *key, int key_len) +{ + std::string key_to_insert; + key_to_insert.assign(key, key_len); + batch_mutation[key_to_insert]= ColumnFamilyToMutation(); + ColumnFamilyToMutation& cf_mut= batch_mutation[key_to_insert]; + + cf_mut[column_family]= std::vector<Mutation>(); + insert_list= &cf_mut[column_family]; + + insert_timestamp= get_i64_timestamp(); +} + + +void Cassandra_se_impl::add_row_deletion(const char *key, int key_len, + Column_name_enumerator *col_names, + LEX_STRING *names, uint nnames) +{ + std::string key_to_delete; + key_to_delete.assign(key, key_len); + + batch_mutation[key_to_delete]= ColumnFamilyToMutation(); + ColumnFamilyToMutation& cf_mut= batch_mutation[key_to_delete]; + + cf_mut[column_family]= std::vector<Mutation>(); + std::vector<Mutation> &mutation_list= cf_mut[column_family]; + + Mutation mut; + mut.__isset.deletion= true; + mut.deletion.__isset.timestamp= true; + mut.deletion.timestamp= get_i64_timestamp(); + mut.deletion.__isset.predicate= true; + + /* + Attempting to delete columns with SliceRange causes exception with message + "Deletion does not yet support SliceRange predicates". + + Delete all columns individually. + */ + SlicePredicate slice_pred; + slice_pred.__isset.column_names= true; + const char *col_name; + while ((col_name= col_names->get_next_name())) + slice_pred.column_names.push_back(std::string(col_name)); + for (uint i= 0; i < nnames; i++) + slice_pred.column_names.push_back(std::string(names[i].str, + names[i].length)); + + mut.deletion.predicate= slice_pred; + + mutation_list.push_back(mut); +} + + +void Cassandra_se_impl::add_insert_column(const char *name, + int name_len, + const char *value, + int value_len) +{ + Mutation mut; + mut.__isset.column_or_supercolumn= true; + mut.column_or_supercolumn.__isset.column= true; + + Column& col=mut.column_or_supercolumn.column; + if (name_len) + col.name.assign(name, name_len); + else + col.name.assign(name); + col.value.assign(value, value_len); + col.timestamp= insert_timestamp; + col.__isset.value= true; + col.__isset.timestamp= true; + insert_list->push_back(mut); +} + +void Cassandra_se_impl::add_insert_delete_column(const char *name, + int name_len) +{ + Mutation mut; + mut.__isset.deletion= true; + mut.deletion.__isset.timestamp= true; + mut.deletion.timestamp= insert_timestamp; + mut.deletion.__isset.predicate= true; + + SlicePredicate slice_pred; + slice_pred.__isset.column_names= true; + slice_pred.column_names.push_back(std::string(name, name_len)); + mut.deletion.predicate= slice_pred; + + insert_list->push_back(mut); +} + + +bool Cassandra_se_impl::retryable_do_insert() +{ + cass->batch_mutate(batch_mutation, write_consistency); + + cassandra_counters.row_inserts+= batch_mutation.size(); + cassandra_counters.row_insert_batches++; + + clear_insert_buffer(); + return 0; +} + + +bool Cassandra_se_impl::do_insert() +{ + /* + zero-size mutations are allowed by Cassandra's batch_mutate but lets not + do them (we may attempt to do it if there is a bulk insert that stores + exactly @@cassandra_insert_batch_size*n elements. + */ + if (batch_mutation.empty()) + return false; + + return try_operation(&Cassandra_se_impl::retryable_do_insert); +} + + +///////////////////////////////////////////////////////////////////////////// +// Reading data +///////////////////////////////////////////////////////////////////////////// + +/* + Make one key lookup. If the record is found, the result is stored locally and + the caller should iterate over it. +*/ + +bool Cassandra_se_impl::get_slice(char *key, size_t key_len, bool *found) +{ + bool res; + rowkey.assign(key, key_len); + + if (!(res= try_operation(&Cassandra_se_impl::retryable_get_slice))) + *found= get_slice_found_rows; + return res; +} + + +bool Cassandra_se_impl::retryable_get_slice() +{ + ColumnParent cparent; + cparent.column_family= column_family; + + SlicePredicate slice_pred; + SliceRange sr; + sr.start = ""; + sr.finish = ""; + slice_pred.__set_slice_range(sr); + + cass->get_slice(column_data_vec, rowkey, cparent, slice_pred, + read_consistency); + + if (column_data_vec.size() == 0) + { + /* + No columns found. Cassandra doesn't allow records without any column => + this means the seach key doesn't exist + */ + get_slice_found_rows= false; + return false; + } + get_slice_found_rows= true; + + column_data_it= column_data_vec.begin(); + return false; +} + + +bool Cassandra_se_impl::get_next_read_column(char **name, int *name_len, + char **value, int *value_len) +{ + bool use_counter=false; + while (1) + { + if (column_data_it == column_data_vec.end()) + return true; + + if ((*column_data_it).__isset.column) + break; /* Ok it's a real column. Should be always the case. */ + + if ((*column_data_it).__isset.counter_column) + { + use_counter= true; + break; + } + + column_data_it++; + } + + ColumnOrSuperColumn& cs= *column_data_it; + if (use_counter) + { + *name_len= cs.counter_column.name.size(); + *name= (char*)cs.counter_column.name.c_str(); + *value= (char*)&cs.counter_column.value; + *value_len= sizeof(cs.counter_column.value); + } + else + { + *name_len= cs.column.name.size(); + *name= (char*)cs.column.name.c_str(); + *value= (char*)cs.column.value.c_str(); + *value_len= cs.column.value.length(); + } + + column_data_it++; + return false; +} + + +/* Return the rowkey for the record that was read */ + +void Cassandra_se_impl::get_read_rowkey(char **value, int *value_len) +{ + *value= (char*)rowkey.c_str(); + *value_len= rowkey.length(); +} + + +bool Cassandra_se_impl::get_range_slices(bool last_key_as_start_key) +{ + get_range_slices_param_last_key_as_start_key= last_key_as_start_key; + + return try_operation(&Cassandra_se_impl::retryable_get_range_slices); +} + + +bool Cassandra_se_impl::retryable_get_range_slices() +{ + bool last_key_as_start_key= get_range_slices_param_last_key_as_start_key; + + ColumnParent cparent; + cparent.column_family= column_family; + + /* SlicePredicate can be used to limit columns we will retrieve */ + + KeyRange key_range; + key_range.__isset.start_key= true; + key_range.__isset.end_key= true; + + if (last_key_as_start_key) + { + key_range.start_key= rowkey; + + have_rowkey_to_skip= true; + rowkey_to_skip= rowkey; + } + else + { + have_rowkey_to_skip= false; + key_range.start_key.assign("", 0); + } + + key_range.end_key.assign("", 0); + key_range.count= read_batch_size; + + cass->get_range_slices(key_slice_vec, cparent, slice_pred, key_range, + read_consistency); + + if (key_slice_vec.size() < (uint)read_batch_size) + get_slices_returned_less= true; + else + get_slices_returned_less= false; + + key_slice_it= key_slice_vec.begin(); + return false; +} + + +/* Switch to next row. This may produce an error */ +bool Cassandra_se_impl::get_next_range_slice_row(bool *eof) +{ +restart: + if (key_slice_it == key_slice_vec.end()) + { + if (get_slices_returned_less) + { + *eof= true; + return false; + } + + /* + We have read through all columns in this batch. Try getting the next + batch. + */ + if (get_range_slices(true)) + return true; + + if (key_slice_vec.empty()) + { + *eof= true; + return false; + } + } + + /* + (1) - skip the last row that we have read in the previous batch. + (2) - Rows that were deleted show up as rows without any columns. Skip + them, like CQL does. + */ + if ((have_rowkey_to_skip && !rowkey_to_skip.compare(key_slice_it->key)) || // (1) + key_slice_it->columns.size() == 0) // (2) + { + key_slice_it++; + goto restart; + } + + *eof= false; + column_data_vec= key_slice_it->columns; + rowkey= key_slice_it->key; + column_data_it= column_data_vec.begin(); + key_slice_it++; + return false; +} + + +void Cassandra_se_impl::finish_reading_range_slices() +{ + key_slice_vec.clear(); +} + + +void Cassandra_se_impl::clear_read_columns() +{ + slice_pred.column_names.clear(); +} + +void Cassandra_se_impl::clear_read_all_columns() +{ + slice_pred_sr.start = ""; + slice_pred_sr.finish = ""; + slice_pred.__set_slice_range(slice_pred_sr); +} + + +void Cassandra_se_impl::add_read_column(const char *name_arg) +{ + std::string name(name_arg); + slice_pred.__isset.column_names= true; + slice_pred.column_names.push_back(name); +} + + +bool Cassandra_se_impl::truncate() +{ + return try_operation(&Cassandra_se_impl::retryable_truncate); +} + + +bool Cassandra_se_impl::retryable_truncate() +{ + cass->truncate(column_family); + return 0; +} + + +bool Cassandra_se_impl::remove_row() +{ + return try_operation(&Cassandra_se_impl::retryable_remove_row); +} + + +bool Cassandra_se_impl::retryable_remove_row() +{ + ColumnPath column_path; + column_path.column_family= column_family; + cass->remove(rowkey, column_path, get_i64_timestamp(), write_consistency); + return 0; +} + +/* + Try calling a function, catching possible Cassandra errors, and re-trying + for "transient" errors. +*/ +bool Cassandra_se_impl::try_operation(retryable_func_t func_to_call) +{ + bool res; + int n_retries= thrift_call_retries_to_do; + + do + { + res= true; + + try { + + if ((res= (this->*func_to_call)())) + { + /* + The function call was made successfully (without timeouts, etc), + but something inside it returned 'true'. + This is supposedly a failure (or "not found" or other negative + result). We need to return this to the caller. + */ + n_retries= 0; + } + + } catch (InvalidRequestException ire) { + n_retries= 0; /* there is no point in retrying this operation */ + print_error("%s [%s]", ire.what(), ire.why.c_str()); + } catch (UnavailableException ue) { + cassandra_counters.unavailable_exceptions++; + if (!--n_retries) + print_error("UnavailableException: %s", ue.what()); + } catch (TimedOutException te) { + cassandra_counters.timeout_exceptions++; + if (!--n_retries) + print_error("TimedOutException: %s", te.what()); + }catch(TException e){ + /* todo: we may use retry for certain kinds of Thrift errors */ + n_retries= 0; + print_error("Thrift exception: %s", e.what()); + } catch (...) { + n_retries= 0; /* Don't retry */ + print_error("Unknown exception"); + } + + } while (res && n_retries > 0); + + return res; +} + +///////////////////////////////////////////////////////////////////////////// +// MRR reads +///////////////////////////////////////////////////////////////////////////// + +void Cassandra_se_impl::new_lookup_keys() +{ + mrr_keys.clear(); +} + + +int Cassandra_se_impl::add_lookup_key(const char *key, size_t key_len) +{ + mrr_keys.push_back(std::string(key, key_len)); + return mrr_keys.size(); +} + +bool Cassandra_se_impl::multiget_slice() +{ + return try_operation(&Cassandra_se_impl::retryable_multiget_slice); +} + + +bool Cassandra_se_impl::retryable_multiget_slice() +{ + ColumnParent cparent; + cparent.column_family= column_family; + + SlicePredicate slice_pred; + SliceRange sr; + sr.start = ""; + sr.finish = ""; + slice_pred.__set_slice_range(sr); + + cassandra_counters.multiget_reads++; + cassandra_counters.multiget_keys_scanned += mrr_keys.size(); + cass->multiget_slice(mrr_result, mrr_keys, cparent, slice_pred, + read_consistency); + + cassandra_counters.multiget_rows_read += mrr_result.size(); + mrr_result_it= mrr_result.begin(); + + return false; +} + + +bool Cassandra_se_impl::get_next_multiget_row() +{ + if (mrr_result_it == mrr_result.end()) + return true; /* EOF */ + + column_data_vec= mrr_result_it->second; + rowkey= mrr_result_it->first; + + column_data_it= column_data_vec.begin(); + mrr_result_it++; + return false; +} + + + diff --git a/storage/cassandra/cassandra_se.h b/storage/cassandra/cassandra_se.h new file mode 100644 index 00000000000..050c65e6dde --- /dev/null +++ b/storage/cassandra/cassandra_se.h @@ -0,0 +1,123 @@ + +/* + This file is a "bridge" interface between cassandra+Thrift and MariaDB. + + It is #included by both sides, so it must itself include neither (including + both together causes compile errors due to conflicts). +*/ + +struct st_mysql_lex_string; +typedef struct st_mysql_lex_string LEX_STRING; + +/* We need to define this here so that ha_cassandra.cc also has access to it */ +typedef enum +{ + ONE = 1-1, + QUORUM = 2-1, + LOCAL_QUORUM = 3-1, + EACH_QUORUM = 4-1, + ALL = 5-1, + ANY = 6-1, + TWO = 7-1, + THREE = 8-1, +} enum_cassandra_consistency_level; + + +class Column_name_enumerator +{ +public: + virtual const char* get_next_name()=0; + virtual ~Column_name_enumerator(){} +}; + +/* + Interface to one cassandra column family, i.e. one 'table' +*/ +class Cassandra_se_interface +{ +public: + Cassandra_se_interface() { err_buffer[0]=0; } + + virtual ~Cassandra_se_interface(){}; + /* Init */ + virtual bool connect(const char *host, int port, const char *keyspace)=0; + virtual void set_column_family(const char *cfname) = 0; + + /* Settings */ + virtual void set_consistency_levels(ulong read_cons_level, ulong write_cons_level)=0; + + /* Check underlying DDL */ + virtual bool setup_ddl_checks()=0; + virtual void first_ddl_column()=0; + virtual bool next_ddl_column(char **name, int *name_len, char **value, + int *value_len)=0; + virtual void get_rowkey_type(char **name, char **type)=0; + virtual size_t get_ddl_size()=0; + virtual const char* get_default_validator()=0; + + /* Writes */ + virtual void clear_insert_buffer()=0; + virtual void add_row_deletion(const char *key, int key_len, + Column_name_enumerator *col_names, + LEX_STRING *names, uint nnames)=0; + virtual void start_row_insert(const char *key, int key_len)=0; + virtual void add_insert_delete_column(const char *name, int name_len)= 0; + virtual void add_insert_column(const char *name, int name_len, + const char *value, + int value_len)=0; + virtual bool do_insert()=0; + + /* Reads */ + virtual bool get_slice(char *key, size_t key_len, bool *found)=0 ; + virtual bool get_next_read_column(char **name, int *name_len, + char **value, int *value_len)=0; + virtual void get_read_rowkey(char **value, int *value_len)=0; + + /* Reads, multi-row scans */ + int read_batch_size; + virtual bool get_range_slices(bool last_key_as_start_key)=0; + virtual void finish_reading_range_slices()=0; + virtual bool get_next_range_slice_row(bool *eof)=0; + + /* Reads, MRR scans */ + virtual void new_lookup_keys()=0; + virtual int add_lookup_key(const char *key, size_t key_len)=0; + virtual bool multiget_slice()=0; + virtual bool get_next_multiget_row()=0; + + /* read_set setup */ + virtual void clear_read_columns()=0; + virtual void clear_read_all_columns()=0; + virtual void add_read_column(const char *name)=0; + + virtual bool truncate()=0; + virtual bool remove_row()=0; + + /* Passing error messages up to ha_cassandra */ + char err_buffer[512]; + const char *error_str() { return err_buffer; } + void print_error(const char *format, ...); +}; + + +/* A structure with global counters */ +class Cassandra_status_vars +{ +public: + ulong row_inserts; + ulong row_insert_batches; + + ulong multiget_reads; + ulong multiget_keys_scanned; + ulong multiget_rows_read; + + ulong timeout_exceptions; + ulong unavailable_exceptions; +}; + + +extern Cassandra_status_vars cassandra_counters; + + +Cassandra_se_interface *create_cassandra_se(); + diff --git a/storage/cassandra/gen-cpp/Cassandra.cpp b/storage/cassandra/gen-cpp/Cassandra.cpp new file mode 100644 index 00000000000..db1deb34c31 --- /dev/null +++ b/storage/cassandra/gen-cpp/Cassandra.cpp @@ -0,0 +1,12871 @@ +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include <inttypes.h> +#include <netinet/in.h> + +#include "Cassandra.h" + +namespace org { namespace apache { namespace cassandra { + +uint32_t Cassandra_login_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_auth_request = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->auth_request.read(iprot); + isset_auth_request = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_auth_request) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_login_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_login_args"); + xfer += oprot->writeFieldBegin("auth_request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->auth_request.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_login_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_login_pargs"); + xfer += oprot->writeFieldBegin("auth_request", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->auth_request)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_login_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->authnx.read(iprot); + this->__isset.authnx = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->authzx.read(iprot); + this->__isset.authzx = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_login_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_login_result"); + + if (this->__isset.authnx) { + xfer += oprot->writeFieldBegin("authnx", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->authnx.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.authzx) { + xfer += oprot->writeFieldBegin("authzx", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->authzx.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_login_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->authnx.read(iprot); + this->__isset.authnx = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->authzx.read(iprot); + this->__isset.authzx = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_set_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_keyspace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->keyspace); + isset_keyspace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keyspace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_set_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_set_keyspace_args"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->keyspace); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_set_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_set_keyspace_pargs"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->keyspace))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_set_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_set_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_set_keyspace_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_set_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_column_path = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_path.read(iprot); + isset_column_path = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast149; + xfer += iprot->readI32(ecast149); + this->consistency_level = (ConsistencyLevel::type)ecast149; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_path) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_get_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_args"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_path.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_pargs"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->key))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_path)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->nfe.read(iprot); + this->__isset.nfe = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_get_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.nfe) { + xfer += oprot->writeFieldBegin("nfe", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->nfe.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->nfe.read(iprot); + this->__isset.nfe = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_slice_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_column_parent = false; + bool isset_predicate = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->predicate.read(iprot); + isset_predicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast150; + xfer += iprot->readI32(ecast150); + this->consistency_level = (ConsistencyLevel::type)ecast150; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_predicate) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_get_slice_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_slice_args"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->predicate.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_slice_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_slice_pargs"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->key))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->predicate)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_slice_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size151; + ::apache::thrift::protocol::TType _etype154; + iprot->readListBegin(_etype154, _size151); + this->success.resize(_size151); + uint32_t _i155; + for (_i155 = 0; _i155 < _size151; ++_i155) + { + xfer += this->success[_i155].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_slice_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_get_slice_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size())); + std::vector<ColumnOrSuperColumn> ::const_iterator _iter156; + for (_iter156 = this->success.begin(); _iter156 != this->success.end(); ++_iter156) + { + xfer += (*_iter156).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_slice_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size157; + ::apache::thrift::protocol::TType _etype160; + iprot->readListBegin(_etype160, _size157); + (*(this->success)).resize(_size157); + uint32_t _i161; + for (_i161 = 0; _i161 < _size157; ++_i161) + { + xfer += (*(this->success))[_i161].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_count_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_column_parent = false; + bool isset_predicate = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->predicate.read(iprot); + isset_predicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast162; + xfer += iprot->readI32(ecast162); + this->consistency_level = (ConsistencyLevel::type)ecast162; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_predicate) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_get_count_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_count_args"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->predicate.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_count_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_count_pargs"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->key))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->predicate)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_count_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_count_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_get_count_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0); + xfer += oprot->writeI32(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_count_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_multiget_slice_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_keys = false; + bool isset_column_parent = false; + bool isset_predicate = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->keys.clear(); + uint32_t _size163; + ::apache::thrift::protocol::TType _etype166; + iprot->readListBegin(_etype166, _size163); + this->keys.resize(_size163); + uint32_t _i167; + for (_i167 = 0; _i167 < _size163; ++_i167) + { + xfer += iprot->readBinary(this->keys[_i167]); + } + iprot->readListEnd(); + } + isset_keys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->predicate.read(iprot); + isset_predicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast168; + xfer += iprot->readI32(ecast168); + this->consistency_level = (ConsistencyLevel::type)ecast168; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keys) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_predicate) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_multiget_slice_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_multiget_slice_args"); + xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->keys.size())); + std::vector<std::string> ::const_iterator _iter169; + for (_iter169 = this->keys.begin(); _iter169 != this->keys.end(); ++_iter169) + { + xfer += oprot->writeBinary((*_iter169)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->predicate.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_multiget_slice_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_multiget_slice_pargs"); + xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>((*(this->keys)).size())); + std::vector<std::string> ::const_iterator _iter170; + for (_iter170 = (*(this->keys)).begin(); _iter170 != (*(this->keys)).end(); ++_iter170) + { + xfer += oprot->writeBinary((*_iter170)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->predicate)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_multiget_slice_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size171; + ::apache::thrift::protocol::TType _ktype172; + ::apache::thrift::protocol::TType _vtype173; + iprot->readMapBegin(_ktype172, _vtype173, _size171); + uint32_t _i175; + for (_i175 = 0; _i175 < _size171; ++_i175) + { + std::string _key176; + xfer += iprot->readBinary(_key176); + std::vector<ColumnOrSuperColumn> & _val177 = this->success[_key176]; + { + _val177.clear(); + uint32_t _size178; + ::apache::thrift::protocol::TType _etype181; + iprot->readListBegin(_etype181, _size178); + _val177.resize(_size178); + uint32_t _i182; + for (_i182 = 0; _i182 < _size178; ++_i182) + { + xfer += _val177[_i182].read(iprot); + } + iprot->readListEnd(); + } + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_multiget_slice_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_multiget_slice_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(this->success.size())); + std::map<std::string, std::vector<ColumnOrSuperColumn> > ::const_iterator _iter183; + for (_iter183 = this->success.begin(); _iter183 != this->success.end(); ++_iter183) + { + xfer += oprot->writeBinary(_iter183->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(_iter183->second.size())); + std::vector<ColumnOrSuperColumn> ::const_iterator _iter184; + for (_iter184 = _iter183->second.begin(); _iter184 != _iter183->second.end(); ++_iter184) + { + xfer += (*_iter184).write(oprot); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_multiget_slice_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size185; + ::apache::thrift::protocol::TType _ktype186; + ::apache::thrift::protocol::TType _vtype187; + iprot->readMapBegin(_ktype186, _vtype187, _size185); + uint32_t _i189; + for (_i189 = 0; _i189 < _size185; ++_i189) + { + std::string _key190; + xfer += iprot->readBinary(_key190); + std::vector<ColumnOrSuperColumn> & _val191 = (*(this->success))[_key190]; + { + _val191.clear(); + uint32_t _size192; + ::apache::thrift::protocol::TType _etype195; + iprot->readListBegin(_etype195, _size192); + _val191.resize(_size192); + uint32_t _i196; + for (_i196 = 0; _i196 < _size192; ++_i196) + { + xfer += _val191[_i196].read(iprot); + } + iprot->readListEnd(); + } + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_multiget_count_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_keys = false; + bool isset_column_parent = false; + bool isset_predicate = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->keys.clear(); + uint32_t _size197; + ::apache::thrift::protocol::TType _etype200; + iprot->readListBegin(_etype200, _size197); + this->keys.resize(_size197); + uint32_t _i201; + for (_i201 = 0; _i201 < _size197; ++_i201) + { + xfer += iprot->readBinary(this->keys[_i201]); + } + iprot->readListEnd(); + } + isset_keys = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->predicate.read(iprot); + isset_predicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast202; + xfer += iprot->readI32(ecast202); + this->consistency_level = (ConsistencyLevel::type)ecast202; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keys) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_predicate) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_multiget_count_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_multiget_count_args"); + xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->keys.size())); + std::vector<std::string> ::const_iterator _iter203; + for (_iter203 = this->keys.begin(); _iter203 != this->keys.end(); ++_iter203) + { + xfer += oprot->writeBinary((*_iter203)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->predicate.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_multiget_count_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_multiget_count_pargs"); + xfer += oprot->writeFieldBegin("keys", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>((*(this->keys)).size())); + std::vector<std::string> ::const_iterator _iter204; + for (_iter204 = (*(this->keys)).begin(); _iter204 != (*(this->keys)).end(); ++_iter204) + { + xfer += oprot->writeBinary((*_iter204)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->predicate)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_multiget_count_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size205; + ::apache::thrift::protocol::TType _ktype206; + ::apache::thrift::protocol::TType _vtype207; + iprot->readMapBegin(_ktype206, _vtype207, _size205); + uint32_t _i209; + for (_i209 = 0; _i209 < _size205; ++_i209) + { + std::string _key210; + xfer += iprot->readBinary(_key210); + int32_t& _val211 = this->success[_key210]; + xfer += iprot->readI32(_val211); + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_multiget_count_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_multiget_count_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, static_cast<uint32_t>(this->success.size())); + std::map<std::string, int32_t> ::const_iterator _iter212; + for (_iter212 = this->success.begin(); _iter212 != this->success.end(); ++_iter212) + { + xfer += oprot->writeBinary(_iter212->first); + xfer += oprot->writeI32(_iter212->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_multiget_count_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size213; + ::apache::thrift::protocol::TType _ktype214; + ::apache::thrift::protocol::TType _vtype215; + iprot->readMapBegin(_ktype214, _vtype215, _size213); + uint32_t _i217; + for (_i217 = 0; _i217 < _size213; ++_i217) + { + std::string _key218; + xfer += iprot->readBinary(_key218); + int32_t& _val219 = (*(this->success))[_key218]; + xfer += iprot->readI32(_val219); + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_range_slices_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_column_parent = false; + bool isset_predicate = false; + bool isset_range = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->predicate.read(iprot); + isset_predicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->range.read(iprot); + isset_range = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast220; + xfer += iprot->readI32(ecast220); + this->consistency_level = (ConsistencyLevel::type)ecast220; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_predicate) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_range) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_get_range_slices_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_range_slices_args"); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->predicate.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->range.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_range_slices_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_range_slices_pargs"); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->predicate)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->range)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_range_slices_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size221; + ::apache::thrift::protocol::TType _etype224; + iprot->readListBegin(_etype224, _size221); + this->success.resize(_size221); + uint32_t _i225; + for (_i225 = 0; _i225 < _size221; ++_i225) + { + xfer += this->success[_i225].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_range_slices_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_get_range_slices_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size())); + std::vector<KeySlice> ::const_iterator _iter226; + for (_iter226 = this->success.begin(); _iter226 != this->success.end(); ++_iter226) + { + xfer += (*_iter226).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_range_slices_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size227; + ::apache::thrift::protocol::TType _etype230; + iprot->readListBegin(_etype230, _size227); + (*(this->success)).resize(_size227); + uint32_t _i231; + for (_i231 = 0; _i231 < _size227; ++_i231) + { + xfer += (*(this->success))[_i231].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_paged_slice_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_column_family = false; + bool isset_range = false; + bool isset_start_column = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_family); + isset_column_family = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->range.read(iprot); + isset_range = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->start_column); + isset_start_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast232; + xfer += iprot->readI32(ecast232); + this->consistency_level = (ConsistencyLevel::type)ecast232; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_column_family) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_range) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_start_column) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_get_paged_slice_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_paged_slice_args"); + xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->column_family); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->range.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("start_column", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeBinary(this->start_column); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_paged_slice_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_paged_slice_pargs"); + xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->column_family))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("range", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->range)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("start_column", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeBinary((*(this->start_column))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_paged_slice_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size233; + ::apache::thrift::protocol::TType _etype236; + iprot->readListBegin(_etype236, _size233); + this->success.resize(_size233); + uint32_t _i237; + for (_i237 = 0; _i237 < _size233; ++_i237) + { + xfer += this->success[_i237].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_paged_slice_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_get_paged_slice_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size())); + std::vector<KeySlice> ::const_iterator _iter238; + for (_iter238 = this->success.begin(); _iter238 != this->success.end(); ++_iter238) + { + xfer += (*_iter238).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_paged_slice_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size239; + ::apache::thrift::protocol::TType _etype242; + iprot->readListBegin(_etype242, _size239); + (*(this->success)).resize(_size239); + uint32_t _i243; + for (_i243 = 0; _i243 < _size239; ++_i243) + { + xfer += (*(this->success))[_i243].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_indexed_slices_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_column_parent = false; + bool isset_index_clause = false; + bool isset_column_predicate = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->index_clause.read(iprot); + isset_index_clause = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_predicate.read(iprot); + isset_column_predicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast244; + xfer += iprot->readI32(ecast244); + this->consistency_level = (ConsistencyLevel::type)ecast244; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_index_clause) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_predicate) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_get_indexed_slices_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_indexed_slices_args"); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("index_clause", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->index_clause.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->column_predicate.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_indexed_slices_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_get_indexed_slices_pargs"); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("index_clause", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->index_clause)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->column_predicate)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_indexed_slices_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size245; + ::apache::thrift::protocol::TType _etype248; + iprot->readListBegin(_etype248, _size245); + this->success.resize(_size245); + uint32_t _i249; + for (_i249 = 0; _i249 < _size245; ++_i249) + { + xfer += this->success[_i249].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_get_indexed_slices_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_get_indexed_slices_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size())); + std::vector<KeySlice> ::const_iterator _iter250; + for (_iter250 = this->success.begin(); _iter250 != this->success.end(); ++_iter250) + { + xfer += (*_iter250).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_get_indexed_slices_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size251; + ::apache::thrift::protocol::TType _etype254; + iprot->readListBegin(_etype254, _size251); + (*(this->success)).resize(_size251); + uint32_t _i255; + for (_i255 = 0; _i255 < _size251; ++_i255) + { + xfer += (*(this->success))[_i255].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_insert_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_column_parent = false; + bool isset_column = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column.read(iprot); + isset_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast256; + xfer += iprot->readI32(ecast256); + this->consistency_level = (ConsistencyLevel::type)ecast256; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_insert_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_insert_args"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->column.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_insert_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_insert_pargs"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->key))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->column)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_insert_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_insert_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_insert_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_insert_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_add_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_column_parent = false; + bool isset_column = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_parent.read(iprot); + isset_column_parent = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column.read(iprot); + isset_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast257; + xfer += iprot->readI32(ecast257); + this->consistency_level = (ConsistencyLevel::type)ecast257; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_parent) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_add_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_add_args"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_parent.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->column.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_add_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_add_pargs"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->key))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_parent", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_parent)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += (*(this->column)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_add_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_add_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_add_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_add_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_remove_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_column_path = false; + bool isset_timestamp = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_path.read(iprot); + isset_column_path = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->timestamp); + isset_timestamp = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast258; + xfer += iprot->readI32(ecast258); + this->consistency_level = (ConsistencyLevel::type)ecast258; + this->__isset.consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_column_path) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_timestamp) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_remove_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_remove_args"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->column_path.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->timestamp); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_remove_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_remove_pargs"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->key))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("column_path", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->column_path)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64((*(this->timestamp))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_remove_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_remove_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_remove_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_remove_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_remove_counter_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_path = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->path.read(iprot); + isset_path = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast259; + xfer += iprot->readI32(ecast259); + this->consistency_level = (ConsistencyLevel::type)ecast259; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_path) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_remove_counter_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_remove_counter_args"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("path", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->path.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_remove_counter_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_remove_counter_pargs"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->key))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("path", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += (*(this->path)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_remove_counter_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_remove_counter_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_remove_counter_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_remove_counter_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_batch_mutate_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_mutation_map = false; + bool isset_consistency_level = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->mutation_map.clear(); + uint32_t _size260; + ::apache::thrift::protocol::TType _ktype261; + ::apache::thrift::protocol::TType _vtype262; + iprot->readMapBegin(_ktype261, _vtype262, _size260); + uint32_t _i264; + for (_i264 = 0; _i264 < _size260; ++_i264) + { + std::string _key265; + xfer += iprot->readBinary(_key265); + std::map<std::string, std::vector<Mutation> > & _val266 = this->mutation_map[_key265]; + { + _val266.clear(); + uint32_t _size267; + ::apache::thrift::protocol::TType _ktype268; + ::apache::thrift::protocol::TType _vtype269; + iprot->readMapBegin(_ktype268, _vtype269, _size267); + uint32_t _i271; + for (_i271 = 0; _i271 < _size267; ++_i271) + { + std::string _key272; + xfer += iprot->readString(_key272); + std::vector<Mutation> & _val273 = _val266[_key272]; + { + _val273.clear(); + uint32_t _size274; + ::apache::thrift::protocol::TType _etype277; + iprot->readListBegin(_etype277, _size274); + _val273.resize(_size274); + uint32_t _i278; + for (_i278 = 0; _i278 < _size274; ++_i278) + { + xfer += _val273[_i278].read(iprot); + } + iprot->readListEnd(); + } + } + iprot->readMapEnd(); + } + } + iprot->readMapEnd(); + } + isset_mutation_map = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast279; + xfer += iprot->readI32(ecast279); + this->consistency_level = (ConsistencyLevel::type)ecast279; + isset_consistency_level = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_mutation_map) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_consistency_level) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_batch_mutate_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_batch_mutate_args"); + xfer += oprot->writeFieldBegin("mutation_map", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_MAP, static_cast<uint32_t>(this->mutation_map.size())); + std::map<std::string, std::map<std::string, std::vector<Mutation> > > ::const_iterator _iter280; + for (_iter280 = this->mutation_map.begin(); _iter280 != this->mutation_map.end(); ++_iter280) + { + xfer += oprot->writeBinary(_iter280->first); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(_iter280->second.size())); + std::map<std::string, std::vector<Mutation> > ::const_iterator _iter281; + for (_iter281 = _iter280->second.begin(); _iter281 != _iter280->second.end(); ++_iter281) + { + xfer += oprot->writeString(_iter281->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(_iter281->second.size())); + std::vector<Mutation> ::const_iterator _iter282; + for (_iter282 = _iter281->second.begin(); _iter282 != _iter281->second.end(); ++_iter282) + { + xfer += (*_iter282).write(oprot); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->consistency_level); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_batch_mutate_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_batch_mutate_pargs"); + xfer += oprot->writeFieldBegin("mutation_map", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_MAP, static_cast<uint32_t>((*(this->mutation_map)).size())); + std::map<std::string, std::map<std::string, std::vector<Mutation> > > ::const_iterator _iter283; + for (_iter283 = (*(this->mutation_map)).begin(); _iter283 != (*(this->mutation_map)).end(); ++_iter283) + { + xfer += oprot->writeBinary(_iter283->first); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(_iter283->second.size())); + std::map<std::string, std::vector<Mutation> > ::const_iterator _iter284; + for (_iter284 = _iter283->second.begin(); _iter284 != _iter283->second.end(); ++_iter284) + { + xfer += oprot->writeString(_iter284->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(_iter284->second.size())); + std::vector<Mutation> ::const_iterator _iter285; + for (_iter285 = _iter284->second.begin(); _iter285 != _iter284->second.end(); ++_iter285) + { + xfer += (*_iter285).write(oprot); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("consistency_level", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)(*(this->consistency_level))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_batch_mutate_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_batch_mutate_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_batch_mutate_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_batch_mutate_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_truncate_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_cfname = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->cfname); + isset_cfname = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_cfname) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_truncate_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_truncate_args"); + xfer += oprot->writeFieldBegin("cfname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->cfname); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_truncate_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_truncate_pargs"); + xfer += oprot->writeFieldBegin("cfname", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->cfname))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_truncate_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_truncate_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_truncate_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_truncate_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_schema_versions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_schema_versions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_schema_versions_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_schema_versions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_schema_versions_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_schema_versions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size286; + ::apache::thrift::protocol::TType _ktype287; + ::apache::thrift::protocol::TType _vtype288; + iprot->readMapBegin(_ktype287, _vtype288, _size286); + uint32_t _i290; + for (_i290 = 0; _i290 < _size286; ++_i290) + { + std::string _key291; + xfer += iprot->readString(_key291); + std::vector<std::string> & _val292 = this->success[_key291]; + { + _val292.clear(); + uint32_t _size293; + ::apache::thrift::protocol::TType _etype296; + iprot->readListBegin(_etype296, _size293); + _val292.resize(_size293); + uint32_t _i297; + for (_i297 = 0; _i297 < _size293; ++_i297) + { + xfer += iprot->readString(_val292[_i297]); + } + iprot->readListEnd(); + } + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_schema_versions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_schema_versions_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_LIST, static_cast<uint32_t>(this->success.size())); + std::map<std::string, std::vector<std::string> > ::const_iterator _iter298; + for (_iter298 = this->success.begin(); _iter298 != this->success.end(); ++_iter298) + { + xfer += oprot->writeString(_iter298->first); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(_iter298->second.size())); + std::vector<std::string> ::const_iterator _iter299; + for (_iter299 = _iter298->second.begin(); _iter299 != _iter298->second.end(); ++_iter299) + { + xfer += oprot->writeString((*_iter299)); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_schema_versions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size300; + ::apache::thrift::protocol::TType _ktype301; + ::apache::thrift::protocol::TType _vtype302; + iprot->readMapBegin(_ktype301, _vtype302, _size300); + uint32_t _i304; + for (_i304 = 0; _i304 < _size300; ++_i304) + { + std::string _key305; + xfer += iprot->readString(_key305); + std::vector<std::string> & _val306 = (*(this->success))[_key305]; + { + _val306.clear(); + uint32_t _size307; + ::apache::thrift::protocol::TType _etype310; + iprot->readListBegin(_etype310, _size307); + _val306.resize(_size307); + uint32_t _i311; + for (_i311 = 0; _i311 < _size307; ++_i311) + { + xfer += iprot->readString(_val306[_i311]); + } + iprot->readListEnd(); + } + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_keyspaces_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_keyspaces_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_keyspaces_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_keyspaces_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_keyspaces_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_keyspaces_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size312; + ::apache::thrift::protocol::TType _etype315; + iprot->readListBegin(_etype315, _size312); + this->success.resize(_size312); + uint32_t _i316; + for (_i316 = 0; _i316 < _size312; ++_i316) + { + xfer += this->success[_i316].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_keyspaces_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_keyspaces_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size())); + std::vector<KsDef> ::const_iterator _iter317; + for (_iter317 = this->success.begin(); _iter317 != this->success.end(); ++_iter317) + { + xfer += (*_iter317).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_keyspaces_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size318; + ::apache::thrift::protocol::TType _etype321; + iprot->readListBegin(_etype321, _size318); + (*(this->success)).resize(_size318); + uint32_t _i322; + for (_i322 = 0; _i322 < _size318; ++_i322) + { + xfer += (*(this->success))[_i322].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_cluster_name_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_cluster_name_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_cluster_name_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_cluster_name_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_cluster_name_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_cluster_name_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_cluster_name_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_cluster_name_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_cluster_name_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_version_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_version_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_version_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_version_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_version_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_ring_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_keyspace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->keyspace); + isset_keyspace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keyspace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_describe_ring_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_ring_args"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->keyspace); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_ring_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_ring_pargs"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->keyspace))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_ring_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size323; + ::apache::thrift::protocol::TType _etype326; + iprot->readListBegin(_etype326, _size323); + this->success.resize(_size323); + uint32_t _i327; + for (_i327 = 0; _i327 < _size323; ++_i327) + { + xfer += this->success[_i327].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_ring_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_ring_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size())); + std::vector<TokenRange> ::const_iterator _iter328; + for (_iter328 = this->success.begin(); _iter328 != this->success.end(); ++_iter328) + { + xfer += (*_iter328).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_ring_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size329; + ::apache::thrift::protocol::TType _etype332; + iprot->readListBegin(_etype332, _size329); + (*(this->success)).resize(_size329); + uint32_t _i333; + for (_i333 = 0; _i333 < _size329; ++_i333) + { + xfer += (*(this->success))[_i333].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_token_map_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_token_map_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_token_map_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_token_map_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_token_map_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_token_map_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->success.clear(); + uint32_t _size334; + ::apache::thrift::protocol::TType _ktype335; + ::apache::thrift::protocol::TType _vtype336; + iprot->readMapBegin(_ktype335, _vtype336, _size334); + uint32_t _i338; + for (_i338 = 0; _i338 < _size334; ++_i338) + { + std::string _key339; + xfer += iprot->readString(_key339); + std::string& _val340 = this->success[_key339]; + xfer += iprot->readString(_val340); + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_token_map_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_token_map_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size())); + std::map<std::string, std::string> ::const_iterator _iter341; + for (_iter341 = this->success.begin(); _iter341 != this->success.end(); ++_iter341) + { + xfer += oprot->writeString(_iter341->first); + xfer += oprot->writeString(_iter341->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_token_map_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + (*(this->success)).clear(); + uint32_t _size342; + ::apache::thrift::protocol::TType _ktype343; + ::apache::thrift::protocol::TType _vtype344; + iprot->readMapBegin(_ktype343, _vtype344, _size342); + uint32_t _i346; + for (_i346 = 0; _i346 < _size342; ++_i346) + { + std::string _key347; + xfer += iprot->readString(_key347); + std::string& _val348 = (*(this->success))[_key347]; + xfer += iprot->readString(_val348); + } + iprot->readMapEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_partitioner_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_partitioner_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_partitioner_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_partitioner_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_partitioner_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_partitioner_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_partitioner_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_snitch_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_snitch_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_snitch_args"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_snitch_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_snitch_pargs"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_snitch_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_snitch_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_snitch_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_snitch_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_keyspace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->keyspace); + isset_keyspace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keyspace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_describe_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_keyspace_args"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->keyspace); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_keyspace_pargs"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->keyspace))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->nfe.read(iprot); + this->__isset.nfe = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_keyspace_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.nfe) { + xfer += oprot->writeFieldBegin("nfe", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->nfe.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->nfe.read(iprot); + this->__isset.nfe = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_splits_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_cfName = false; + bool isset_start_token = false; + bool isset_end_token = false; + bool isset_keys_per_split = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->cfName); + isset_cfName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->start_token); + isset_start_token = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->end_token); + isset_end_token = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->keys_per_split); + isset_keys_per_split = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_cfName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_start_token) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_end_token) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_keys_per_split) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_describe_splits_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_splits_args"); + xfer += oprot->writeFieldBegin("cfName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->cfName); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->start_token); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->end_token); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("keys_per_split", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->keys_per_split); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_splits_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_describe_splits_pargs"); + xfer += oprot->writeFieldBegin("cfName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->cfName))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString((*(this->start_token))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString((*(this->end_token))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("keys_per_split", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((*(this->keys_per_split))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_splits_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->success.clear(); + uint32_t _size349; + ::apache::thrift::protocol::TType _etype352; + iprot->readListBegin(_etype352, _size349); + this->success.resize(_size349); + uint32_t _i353; + for (_i353 = 0; _i353 < _size349; ++_i353) + { + xfer += iprot->readString(this->success[_i353]); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_describe_splits_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_describe_splits_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size())); + std::vector<std::string> ::const_iterator _iter354; + for (_iter354 = this->success.begin(); _iter354 != this->success.end(); ++_iter354) + { + xfer += oprot->writeString((*_iter354)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_describe_splits_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + (*(this->success)).clear(); + uint32_t _size355; + ::apache::thrift::protocol::TType _etype358; + iprot->readListBegin(_etype358, _size355); + (*(this->success)).resize(_size355); + uint32_t _i359; + for (_i359 = 0; _i359 < _size355; ++_i359) + { + xfer += iprot->readString((*(this->success))[_i359]); + } + iprot->readListEnd(); + } + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_add_column_family_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_cf_def = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cf_def.read(iprot); + isset_cf_def = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_cf_def) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_system_add_column_family_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_add_column_family_args"); + xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cf_def.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_add_column_family_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_add_column_family_pargs"); + xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cf_def)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_add_column_family_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_add_column_family_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_system_add_column_family_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_add_column_family_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_drop_column_family_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_column_family = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_family); + isset_column_family = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_column_family) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_system_drop_column_family_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_drop_column_family_args"); + xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->column_family); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_drop_column_family_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_drop_column_family_pargs"); + xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->column_family))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_drop_column_family_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_drop_column_family_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_system_drop_column_family_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_drop_column_family_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_add_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_ks_def = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ks_def.read(iprot); + isset_ks_def = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_ks_def) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_system_add_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_add_keyspace_args"); + xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ks_def.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_add_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_add_keyspace_pargs"); + xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->ks_def)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_add_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_add_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_system_add_keyspace_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_add_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_drop_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_keyspace = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->keyspace); + isset_keyspace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keyspace) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_system_drop_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_drop_keyspace_args"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->keyspace); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_drop_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_drop_keyspace_pargs"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->keyspace))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_drop_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_drop_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_system_drop_keyspace_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_drop_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_update_keyspace_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_ks_def = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ks_def.read(iprot); + isset_ks_def = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_ks_def) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_system_update_keyspace_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_update_keyspace_args"); + xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ks_def.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_update_keyspace_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_update_keyspace_pargs"); + xfer += oprot->writeFieldBegin("ks_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->ks_def)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_update_keyspace_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_update_keyspace_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_system_update_keyspace_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_update_keyspace_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_update_column_family_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_cf_def = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->cf_def.read(iprot); + isset_cf_def = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_cf_def) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_system_update_column_family_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_update_column_family_args"); + xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->cf_def.write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_update_column_family_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_system_update_column_family_pargs"); + xfer += oprot->writeFieldBegin("cf_def", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += (*(this->cf_def)).write(oprot); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_update_column_family_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->success); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_system_update_column_family_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_system_update_column_family_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0); + xfer += oprot->writeString(this->success); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_system_update_column_family_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString((*(this->success))); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_execute_cql_query_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_query = false; + bool isset_compression = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->query); + isset_query = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast360; + xfer += iprot->readI32(ecast360); + this->compression = (Compression::type)ecast360; + isset_compression = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_query) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_compression) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_execute_cql_query_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_execute_cql_query_args"); + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->query); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->compression); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_execute_cql_query_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_execute_cql_query_pargs"); + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->query))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)(*(this->compression))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_execute_cql_query_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_execute_cql_query_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_execute_cql_query_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_execute_cql_query_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_prepare_cql_query_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_query = false; + bool isset_compression = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->query); + isset_query = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast361; + xfer += iprot->readI32(ecast361); + this->compression = (Compression::type)ecast361; + isset_compression = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_query) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_compression) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_prepare_cql_query_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_prepare_cql_query_args"); + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->query); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->compression); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_prepare_cql_query_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_prepare_cql_query_pargs"); + xfer += oprot->writeFieldBegin("query", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary((*(this->query))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("compression", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)(*(this->compression))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_prepare_cql_query_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_prepare_cql_query_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_prepare_cql_query_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_prepare_cql_query_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_execute_prepared_cql_query_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_itemId = false; + bool isset_values = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->itemId); + isset_itemId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->values.clear(); + uint32_t _size362; + ::apache::thrift::protocol::TType _etype365; + iprot->readListBegin(_etype365, _size362); + this->values.resize(_size362); + uint32_t _i366; + for (_i366 = 0; _i366 < _size362; ++_i366) + { + xfer += iprot->readBinary(this->values[_i366]); + } + iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_itemId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_execute_prepared_cql_query_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_execute_prepared_cql_query_args"); + xfer += oprot->writeFieldBegin("itemId", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->itemId); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->values.size())); + std::vector<std::string> ::const_iterator _iter367; + for (_iter367 = this->values.begin(); _iter367 != this->values.end(); ++_iter367) + { + xfer += oprot->writeBinary((*_iter367)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_execute_prepared_cql_query_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_execute_prepared_cql_query_pargs"); + xfer += oprot->writeFieldBegin("itemId", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((*(this->itemId))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>((*(this->values)).size())); + std::vector<std::string> ::const_iterator _iter368; + for (_iter368 = (*(this->values)).begin(); _iter368 != (*(this->values)).end(); ++_iter368) + { + xfer += oprot->writeBinary((*_iter368)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_execute_prepared_cql_query_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->success.read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_execute_prepared_cql_query_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_execute_prepared_cql_query_result"); + + if (this->__isset.success) { + xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0); + xfer += this->success.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.ue) { + xfer += oprot->writeFieldBegin("ue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->ue.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.te) { + xfer += oprot->writeFieldBegin("te", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->te.write(oprot); + xfer += oprot->writeFieldEnd(); + } else if (this->__isset.sde) { + xfer += oprot->writeFieldBegin("sde", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->sde.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_execute_prepared_cql_query_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 0: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += (*(this->success)).read(iprot); + this->__isset.success = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ue.read(iprot); + this->__isset.ue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->te.read(iprot); + this->__isset.te = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sde.read(iprot); + this->__isset.sde = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_set_cql_version_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_version = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->version); + isset_version = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_version) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Cassandra_set_cql_version_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_set_cql_version_args"); + xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->version); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_set_cql_version_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Cassandra_set_cql_version_pargs"); + xfer += oprot->writeFieldBegin("version", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString((*(this->version))); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_set_cql_version_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Cassandra_set_cql_version_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("Cassandra_set_cql_version_result"); + + if (this->__isset.ire) { + xfer += oprot->writeFieldBegin("ire", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->ire.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +uint32_t Cassandra_set_cql_version_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->ire.read(iprot); + this->__isset.ire = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +void CassandraClient::login(const AuthenticationRequest& auth_request) +{ + send_login(auth_request); + recv_login(); +} + +void CassandraClient::send_login(const AuthenticationRequest& auth_request) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("login", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_login_pargs args; + args.auth_request = &auth_request; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_login() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("login") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_login_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.authnx) { + throw result.authnx; + } + if (result.__isset.authzx) { + throw result.authzx; + } + return; +} + +void CassandraClient::set_keyspace(const std::string& keyspace) +{ + send_set_keyspace(keyspace); + recv_set_keyspace(); +} + +void CassandraClient::send_set_keyspace(const std::string& keyspace) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_set_keyspace_pargs args; + args.keyspace = &keyspace; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_set_keyspace() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_keyspace") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_set_keyspace_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + return; +} + +void CassandraClient::get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) +{ + send_get(key, column_path, consistency_level); + recv_get(_return); +} + +void CassandraClient::send_get(const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_get_pargs args; + args.key = &key; + args.column_path = &column_path; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_get(ColumnOrSuperColumn& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_get_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.nfe) { + throw result.nfe; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get failed: unknown result"); +} + +void CassandraClient::get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + send_get_slice(key, column_parent, predicate, consistency_level); + recv_get_slice(_return); +} + +void CassandraClient::send_get_slice(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_get_slice_pargs args; + args.key = &key; + args.column_parent = &column_parent; + args.predicate = &predicate; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_get_slice(std::vector<ColumnOrSuperColumn> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_slice") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_get_slice_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_slice failed: unknown result"); +} + +int32_t CassandraClient::get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + send_get_count(key, column_parent, predicate, consistency_level); + return recv_get_count(); +} + +void CassandraClient::send_get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_count", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_get_count_pargs args; + args.key = &key; + args.column_parent = &column_parent; + args.predicate = &predicate; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +int32_t CassandraClient::recv_get_count() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_count") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + int32_t _return; + Cassandra_get_count_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + return _return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_count failed: unknown result"); +} + +void CassandraClient::multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + send_multiget_slice(keys, column_parent, predicate, consistency_level); + recv_multiget_slice(_return); +} + +void CassandraClient::send_multiget_slice(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_multiget_slice_pargs args; + args.keys = &keys; + args.column_parent = &column_parent; + args.predicate = &predicate; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("multiget_slice") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_multiget_slice_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "multiget_slice failed: unknown result"); +} + +void CassandraClient::multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + send_multiget_count(keys, column_parent, predicate, consistency_level); + recv_multiget_count(_return); +} + +void CassandraClient::send_multiget_count(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_multiget_count_pargs args; + args.keys = &keys; + args.column_parent = &column_parent; + args.predicate = &predicate; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_multiget_count(std::map<std::string, int32_t> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("multiget_count") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_multiget_count_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "multiget_count failed: unknown result"); +} + +void CassandraClient::get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) +{ + send_get_range_slices(column_parent, predicate, range, consistency_level); + recv_get_range_slices(_return); +} + +void CassandraClient::send_get_range_slices(const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_get_range_slices_pargs args; + args.column_parent = &column_parent; + args.predicate = &predicate; + args.range = ⦥ + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_get_range_slices(std::vector<KeySlice> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_range_slices") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_get_range_slices_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_range_slices failed: unknown result"); +} + +void CassandraClient::get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) +{ + send_get_paged_slice(column_family, range, start_column, consistency_level); + recv_get_paged_slice(_return); +} + +void CassandraClient::send_get_paged_slice(const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_paged_slice", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_get_paged_slice_pargs args; + args.column_family = &column_family; + args.range = ⦥ + args.start_column = &start_column; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_get_paged_slice(std::vector<KeySlice> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_paged_slice") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_get_paged_slice_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_paged_slice failed: unknown result"); +} + +void CassandraClient::get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) +{ + send_get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level); + recv_get_indexed_slices(_return); +} + +void CassandraClient::send_get_indexed_slices(const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_get_indexed_slices_pargs args; + args.column_parent = &column_parent; + args.index_clause = &index_clause; + args.column_predicate = &column_predicate; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_get_indexed_slices(std::vector<KeySlice> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("get_indexed_slices") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_get_indexed_slices_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get_indexed_slices failed: unknown result"); +} + +void CassandraClient::insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) +{ + send_insert(key, column_parent, column, consistency_level); + recv_insert(); +} + +void CassandraClient::send_insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("insert", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_insert_pargs args; + args.key = &key; + args.column_parent = &column_parent; + args.column = &column; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_insert() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("insert") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_insert_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + return; +} + +void CassandraClient::add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) +{ + send_add(key, column_parent, column, consistency_level); + recv_add(); +} + +void CassandraClient::send_add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_add_pargs args; + args.key = &key; + args.column_parent = &column_parent; + args.column = &column; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_add() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("add") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_add_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + return; +} + +void CassandraClient::remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) +{ + send_remove(key, column_path, timestamp, consistency_level); + recv_remove(); +} + +void CassandraClient::send_remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("remove", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_remove_pargs args; + args.key = &key; + args.column_path = &column_path; + args.timestamp = ×tamp; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_remove() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_remove_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + return; +} + +void CassandraClient::remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) +{ + send_remove_counter(key, path, consistency_level); + recv_remove_counter(); +} + +void CassandraClient::send_remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("remove_counter", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_remove_counter_pargs args; + args.key = &key; + args.path = &path; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_remove_counter() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("remove_counter") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_remove_counter_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + return; +} + +void CassandraClient::batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) +{ + send_batch_mutate(mutation_map, consistency_level); + recv_batch_mutate(); +} + +void CassandraClient::send_batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_batch_mutate_pargs args; + args.mutation_map = &mutation_map; + args.consistency_level = &consistency_level; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_batch_mutate() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("batch_mutate") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_batch_mutate_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + return; +} + +void CassandraClient::truncate(const std::string& cfname) +{ + send_truncate(cfname); + recv_truncate(); +} + +void CassandraClient::send_truncate(const std::string& cfname) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("truncate", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_truncate_pargs args; + args.cfname = &cfname; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_truncate() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("truncate") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_truncate_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + return; +} + +void CassandraClient::describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) +{ + send_describe_schema_versions(); + recv_describe_schema_versions(_return); +} + +void CassandraClient::send_describe_schema_versions() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_schema_versions_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_schema_versions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_schema_versions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_schema_versions failed: unknown result"); +} + +void CassandraClient::describe_keyspaces(std::vector<KsDef> & _return) +{ + send_describe_keyspaces(); + recv_describe_keyspaces(_return); +} + +void CassandraClient::send_describe_keyspaces() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_keyspaces_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_keyspaces(std::vector<KsDef> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_keyspaces") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_keyspaces_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_keyspaces failed: unknown result"); +} + +void CassandraClient::describe_cluster_name(std::string& _return) +{ + send_describe_cluster_name(); + recv_describe_cluster_name(_return); +} + +void CassandraClient::send_describe_cluster_name() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_cluster_name_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_cluster_name(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_cluster_name") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_cluster_name_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_cluster_name failed: unknown result"); +} + +void CassandraClient::describe_version(std::string& _return) +{ + send_describe_version(); + recv_describe_version(_return); +} + +void CassandraClient::send_describe_version() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_version_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_version(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_version_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_version failed: unknown result"); +} + +void CassandraClient::describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace) +{ + send_describe_ring(keyspace); + recv_describe_ring(_return); +} + +void CassandraClient::send_describe_ring(const std::string& keyspace) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_ring_pargs args; + args.keyspace = &keyspace; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_ring(std::vector<TokenRange> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_ring") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_ring_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_ring failed: unknown result"); +} + +void CassandraClient::describe_token_map(std::map<std::string, std::string> & _return) +{ + send_describe_token_map(); + recv_describe_token_map(_return); +} + +void CassandraClient::send_describe_token_map() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_token_map", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_token_map_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_token_map(std::map<std::string, std::string> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_token_map") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_token_map_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_token_map failed: unknown result"); +} + +void CassandraClient::describe_partitioner(std::string& _return) +{ + send_describe_partitioner(); + recv_describe_partitioner(_return); +} + +void CassandraClient::send_describe_partitioner() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_partitioner_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_partitioner(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_partitioner") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_partitioner_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_partitioner failed: unknown result"); +} + +void CassandraClient::describe_snitch(std::string& _return) +{ + send_describe_snitch(); + recv_describe_snitch(_return); +} + +void CassandraClient::send_describe_snitch() +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_snitch_pargs args; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_snitch(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_snitch") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_snitch_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_snitch failed: unknown result"); +} + +void CassandraClient::describe_keyspace(KsDef& _return, const std::string& keyspace) +{ + send_describe_keyspace(keyspace); + recv_describe_keyspace(_return); +} + +void CassandraClient::send_describe_keyspace(const std::string& keyspace) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_keyspace_pargs args; + args.keyspace = &keyspace; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_keyspace(KsDef& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_keyspace") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_keyspace_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.nfe) { + throw result.nfe; + } + if (result.__isset.ire) { + throw result.ire; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_keyspace failed: unknown result"); +} + +void CassandraClient::describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) +{ + send_describe_splits(cfName, start_token, end_token, keys_per_split); + recv_describe_splits(_return); +} + +void CassandraClient::send_describe_splits(const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_describe_splits_pargs args; + args.cfName = &cfName; + args.start_token = &start_token; + args.end_token = &end_token; + args.keys_per_split = &keys_per_split; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_describe_splits(std::vector<std::string> & _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("describe_splits") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_describe_splits_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "describe_splits failed: unknown result"); +} + +void CassandraClient::system_add_column_family(std::string& _return, const CfDef& cf_def) +{ + send_system_add_column_family(cf_def); + recv_system_add_column_family(_return); +} + +void CassandraClient::send_system_add_column_family(const CfDef& cf_def) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_system_add_column_family_pargs args; + args.cf_def = &cf_def; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_system_add_column_family(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("system_add_column_family") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_system_add_column_family_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_add_column_family failed: unknown result"); +} + +void CassandraClient::system_drop_column_family(std::string& _return, const std::string& column_family) +{ + send_system_drop_column_family(column_family); + recv_system_drop_column_family(_return); +} + +void CassandraClient::send_system_drop_column_family(const std::string& column_family) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_system_drop_column_family_pargs args; + args.column_family = &column_family; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_system_drop_column_family(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("system_drop_column_family") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_system_drop_column_family_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_drop_column_family failed: unknown result"); +} + +void CassandraClient::system_add_keyspace(std::string& _return, const KsDef& ks_def) +{ + send_system_add_keyspace(ks_def); + recv_system_add_keyspace(_return); +} + +void CassandraClient::send_system_add_keyspace(const KsDef& ks_def) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_system_add_keyspace_pargs args; + args.ks_def = &ks_def; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_system_add_keyspace(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("system_add_keyspace") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_system_add_keyspace_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_add_keyspace failed: unknown result"); +} + +void CassandraClient::system_drop_keyspace(std::string& _return, const std::string& keyspace) +{ + send_system_drop_keyspace(keyspace); + recv_system_drop_keyspace(_return); +} + +void CassandraClient::send_system_drop_keyspace(const std::string& keyspace) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_system_drop_keyspace_pargs args; + args.keyspace = &keyspace; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_system_drop_keyspace(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("system_drop_keyspace") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_system_drop_keyspace_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_drop_keyspace failed: unknown result"); +} + +void CassandraClient::system_update_keyspace(std::string& _return, const KsDef& ks_def) +{ + send_system_update_keyspace(ks_def); + recv_system_update_keyspace(_return); +} + +void CassandraClient::send_system_update_keyspace(const KsDef& ks_def) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_system_update_keyspace_pargs args; + args.ks_def = &ks_def; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_system_update_keyspace(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("system_update_keyspace") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_system_update_keyspace_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_update_keyspace failed: unknown result"); +} + +void CassandraClient::system_update_column_family(std::string& _return, const CfDef& cf_def) +{ + send_system_update_column_family(cf_def); + recv_system_update_column_family(_return); +} + +void CassandraClient::send_system_update_column_family(const CfDef& cf_def) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_system_update_column_family_pargs args; + args.cf_def = &cf_def; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_system_update_column_family(std::string& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("system_update_column_family") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_system_update_column_family_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "system_update_column_family failed: unknown result"); +} + +void CassandraClient::execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression) +{ + send_execute_cql_query(query, compression); + recv_execute_cql_query(_return); +} + +void CassandraClient::send_execute_cql_query(const std::string& query, const Compression::type compression) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("execute_cql_query", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_execute_cql_query_pargs args; + args.query = &query; + args.compression = &compression; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_execute_cql_query(CqlResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("execute_cql_query") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_execute_cql_query_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "execute_cql_query failed: unknown result"); +} + +void CassandraClient::prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression) +{ + send_prepare_cql_query(query, compression); + recv_prepare_cql_query(_return); +} + +void CassandraClient::send_prepare_cql_query(const std::string& query, const Compression::type compression) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("prepare_cql_query", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_prepare_cql_query_pargs args; + args.query = &query; + args.compression = &compression; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_prepare_cql_query(CqlPreparedResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("prepare_cql_query") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_prepare_cql_query_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "prepare_cql_query failed: unknown result"); +} + +void CassandraClient::execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values) +{ + send_execute_prepared_cql_query(itemId, values); + recv_execute_prepared_cql_query(_return); +} + +void CassandraClient::send_execute_prepared_cql_query(const int32_t itemId, const std::vector<std::string> & values) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("execute_prepared_cql_query", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_execute_prepared_cql_query_pargs args; + args.itemId = &itemId; + args.values = &values; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_execute_prepared_cql_query(CqlResult& _return) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("execute_prepared_cql_query") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_execute_prepared_cql_query_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + return; + } + if (result.__isset.ire) { + throw result.ire; + } + if (result.__isset.ue) { + throw result.ue; + } + if (result.__isset.te) { + throw result.te; + } + if (result.__isset.sde) { + throw result.sde; + } + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "execute_prepared_cql_query failed: unknown result"); +} + +void CassandraClient::set_cql_version(const std::string& version) +{ + send_set_cql_version(version); + recv_set_cql_version(); +} + +void CassandraClient::send_set_cql_version(const std::string& version) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("set_cql_version", ::apache::thrift::protocol::T_CALL, cseqid); + + Cassandra_set_cql_version_pargs args; + args.version = &version; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void CassandraClient::recv_set_cql_version() +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + iprot_->readMessageBegin(fname, mtype, rseqid); + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("set_cql_version") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + Cassandra_set_cql_version_presult result; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.ire) { + throw result.ire; + } + return; +} + +bool CassandraProcessor::process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot, void* callContext) { + + ::apache::thrift::protocol::TProtocol* iprot = piprot.get(); + ::apache::thrift::protocol::TProtocol* oprot = poprot.get(); + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + int32_t seqid; + + iprot->readMessageBegin(fname, mtype, seqid); + + if (mtype != ::apache::thrift::protocol::T_CALL && mtype != ::apache::thrift::protocol::T_ONEWAY) { + iprot->skip(::apache::thrift::protocol::T_STRUCT); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE); + oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return true; + } + + return process_fn(iprot, oprot, fname, seqid, callContext); +} + +bool CassandraProcessor::process_fn( ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid, void* callContext) { + std::map<std::string, void (CassandraProcessor::*)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*)>::iterator pfn; + pfn = processMap_.find(fname); + if (pfn == processMap_.end()) { + iprot->skip(::apache::thrift::protocol::T_STRUCT); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'"); + oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return true; + } + (this->*(pfn->second))(seqid, iprot, oprot, callContext); + return true; +} + +void CassandraProcessor::process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.login", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.login"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.login"); + } + + Cassandra_login_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.login", bytes); + } + + Cassandra_login_result result; + try { + iface_->login(args.auth_request); + } catch (AuthenticationException &authnx) { + result.authnx = authnx; + result.__isset.authnx = true; + } catch (AuthorizationException &authzx) { + result.authzx = authzx; + result.__isset.authzx = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.login"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("login", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.login"); + } + + oprot->writeMessageBegin("login", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.login", bytes); + } +} + +void CassandraProcessor::process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.set_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.set_keyspace"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.set_keyspace"); + } + + Cassandra_set_keyspace_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.set_keyspace", bytes); + } + + Cassandra_set_keyspace_result result; + try { + iface_->set_keyspace(args.keyspace); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.set_keyspace"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.set_keyspace"); + } + + oprot->writeMessageBegin("set_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.set_keyspace", bytes); + } +} + +void CassandraProcessor::process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.get", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.get"); + } + + Cassandra_get_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.get", bytes); + } + + Cassandra_get_result result; + try { + iface_->get(result.success, args.key, args.column_path, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (NotFoundException &nfe) { + result.nfe = nfe; + result.__isset.nfe = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.get"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.get"); + } + + oprot->writeMessageBegin("get", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.get", bytes); + } +} + +void CassandraProcessor::process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.get_slice", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_slice"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.get_slice"); + } + + Cassandra_get_slice_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.get_slice", bytes); + } + + Cassandra_get_slice_result result; + try { + iface_->get_slice(result.success, args.key, args.column_parent, args.predicate, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.get_slice"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.get_slice"); + } + + oprot->writeMessageBegin("get_slice", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.get_slice", bytes); + } +} + +void CassandraProcessor::process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.get_count", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_count"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.get_count"); + } + + Cassandra_get_count_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.get_count", bytes); + } + + Cassandra_get_count_result result; + try { + result.success = iface_->get_count(args.key, args.column_parent, args.predicate, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.get_count"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_count", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.get_count"); + } + + oprot->writeMessageBegin("get_count", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.get_count", bytes); + } +} + +void CassandraProcessor::process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.multiget_slice", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.multiget_slice"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.multiget_slice"); + } + + Cassandra_multiget_slice_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.multiget_slice", bytes); + } + + Cassandra_multiget_slice_result result; + try { + iface_->multiget_slice(result.success, args.keys, args.column_parent, args.predicate, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.multiget_slice"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.multiget_slice"); + } + + oprot->writeMessageBegin("multiget_slice", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.multiget_slice", bytes); + } +} + +void CassandraProcessor::process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.multiget_count", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.multiget_count"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.multiget_count"); + } + + Cassandra_multiget_count_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.multiget_count", bytes); + } + + Cassandra_multiget_count_result result; + try { + iface_->multiget_count(result.success, args.keys, args.column_parent, args.predicate, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.multiget_count"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.multiget_count"); + } + + oprot->writeMessageBegin("multiget_count", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.multiget_count", bytes); + } +} + +void CassandraProcessor::process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.get_range_slices", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_range_slices"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.get_range_slices"); + } + + Cassandra_get_range_slices_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.get_range_slices", bytes); + } + + Cassandra_get_range_slices_result result; + try { + iface_->get_range_slices(result.success, args.column_parent, args.predicate, args.range, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.get_range_slices"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.get_range_slices"); + } + + oprot->writeMessageBegin("get_range_slices", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.get_range_slices", bytes); + } +} + +void CassandraProcessor::process_get_paged_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.get_paged_slice", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_paged_slice"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.get_paged_slice"); + } + + Cassandra_get_paged_slice_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.get_paged_slice", bytes); + } + + Cassandra_get_paged_slice_result result; + try { + iface_->get_paged_slice(result.success, args.column_family, args.range, args.start_column, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.get_paged_slice"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_paged_slice", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.get_paged_slice"); + } + + oprot->writeMessageBegin("get_paged_slice", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.get_paged_slice", bytes); + } +} + +void CassandraProcessor::process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.get_indexed_slices", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.get_indexed_slices"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.get_indexed_slices"); + } + + Cassandra_get_indexed_slices_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.get_indexed_slices", bytes); + } + + Cassandra_get_indexed_slices_result result; + try { + iface_->get_indexed_slices(result.success, args.column_parent, args.index_clause, args.column_predicate, args.consistency_level); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.get_indexed_slices"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.get_indexed_slices"); + } + + oprot->writeMessageBegin("get_indexed_slices", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.get_indexed_slices", bytes); + } +} + +void CassandraProcessor::process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.insert", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.insert"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.insert"); + } + + Cassandra_insert_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.insert", bytes); + } + + Cassandra_insert_result result; + try { + iface_->insert(args.key, args.column_parent, args.column, args.consistency_level); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.insert"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("insert", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.insert"); + } + + oprot->writeMessageBegin("insert", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.insert", bytes); + } +} + +void CassandraProcessor::process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.add", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.add"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.add"); + } + + Cassandra_add_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.add", bytes); + } + + Cassandra_add_result result; + try { + iface_->add(args.key, args.column_parent, args.column, args.consistency_level); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.add"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.add"); + } + + oprot->writeMessageBegin("add", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.add", bytes); + } +} + +void CassandraProcessor::process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.remove", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.remove"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.remove"); + } + + Cassandra_remove_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.remove", bytes); + } + + Cassandra_remove_result result; + try { + iface_->remove(args.key, args.column_path, args.timestamp, args.consistency_level); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.remove"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("remove", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.remove"); + } + + oprot->writeMessageBegin("remove", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.remove", bytes); + } +} + +void CassandraProcessor::process_remove_counter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.remove_counter", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.remove_counter"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.remove_counter"); + } + + Cassandra_remove_counter_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.remove_counter", bytes); + } + + Cassandra_remove_counter_result result; + try { + iface_->remove_counter(args.key, args.path, args.consistency_level); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.remove_counter"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("remove_counter", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.remove_counter"); + } + + oprot->writeMessageBegin("remove_counter", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.remove_counter", bytes); + } +} + +void CassandraProcessor::process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.batch_mutate", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.batch_mutate"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.batch_mutate"); + } + + Cassandra_batch_mutate_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.batch_mutate", bytes); + } + + Cassandra_batch_mutate_result result; + try { + iface_->batch_mutate(args.mutation_map, args.consistency_level); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.batch_mutate"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.batch_mutate"); + } + + oprot->writeMessageBegin("batch_mutate", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.batch_mutate", bytes); + } +} + +void CassandraProcessor::process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.truncate", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.truncate"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.truncate"); + } + + Cassandra_truncate_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.truncate", bytes); + } + + Cassandra_truncate_result result; + try { + iface_->truncate(args.cfname); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.truncate"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("truncate", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.truncate"); + } + + oprot->writeMessageBegin("truncate", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.truncate", bytes); + } +} + +void CassandraProcessor::process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_schema_versions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_schema_versions"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_schema_versions"); + } + + Cassandra_describe_schema_versions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_schema_versions", bytes); + } + + Cassandra_describe_schema_versions_result result; + try { + iface_->describe_schema_versions(result.success); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_schema_versions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_schema_versions"); + } + + oprot->writeMessageBegin("describe_schema_versions", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_schema_versions", bytes); + } +} + +void CassandraProcessor::process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_keyspaces", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_keyspaces"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_keyspaces"); + } + + Cassandra_describe_keyspaces_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_keyspaces", bytes); + } + + Cassandra_describe_keyspaces_result result; + try { + iface_->describe_keyspaces(result.success); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_keyspaces"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_keyspaces"); + } + + oprot->writeMessageBegin("describe_keyspaces", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_keyspaces", bytes); + } +} + +void CassandraProcessor::process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_cluster_name", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_cluster_name"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_cluster_name"); + } + + Cassandra_describe_cluster_name_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_cluster_name", bytes); + } + + Cassandra_describe_cluster_name_result result; + try { + iface_->describe_cluster_name(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_cluster_name"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_cluster_name"); + } + + oprot->writeMessageBegin("describe_cluster_name", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_cluster_name", bytes); + } +} + +void CassandraProcessor::process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_version", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_version"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_version"); + } + + Cassandra_describe_version_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_version", bytes); + } + + Cassandra_describe_version_result result; + try { + iface_->describe_version(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_version"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_version"); + } + + oprot->writeMessageBegin("describe_version", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_version", bytes); + } +} + +void CassandraProcessor::process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_ring", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_ring"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_ring"); + } + + Cassandra_describe_ring_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_ring", bytes); + } + + Cassandra_describe_ring_result result; + try { + iface_->describe_ring(result.success, args.keyspace); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_ring"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_ring"); + } + + oprot->writeMessageBegin("describe_ring", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_ring", bytes); + } +} + +void CassandraProcessor::process_describe_token_map(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_token_map", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_token_map"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_token_map"); + } + + Cassandra_describe_token_map_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_token_map", bytes); + } + + Cassandra_describe_token_map_result result; + try { + iface_->describe_token_map(result.success); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_token_map"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_token_map", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_token_map"); + } + + oprot->writeMessageBegin("describe_token_map", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_token_map", bytes); + } +} + +void CassandraProcessor::process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_partitioner", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_partitioner"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_partitioner"); + } + + Cassandra_describe_partitioner_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_partitioner", bytes); + } + + Cassandra_describe_partitioner_result result; + try { + iface_->describe_partitioner(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_partitioner"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_partitioner"); + } + + oprot->writeMessageBegin("describe_partitioner", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_partitioner", bytes); + } +} + +void CassandraProcessor::process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_snitch", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_snitch"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_snitch"); + } + + Cassandra_describe_snitch_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_snitch", bytes); + } + + Cassandra_describe_snitch_result result; + try { + iface_->describe_snitch(result.success); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_snitch"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_snitch"); + } + + oprot->writeMessageBegin("describe_snitch", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_snitch", bytes); + } +} + +void CassandraProcessor::process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_keyspace"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_keyspace"); + } + + Cassandra_describe_keyspace_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_keyspace", bytes); + } + + Cassandra_describe_keyspace_result result; + try { + iface_->describe_keyspace(result.success, args.keyspace); + result.__isset.success = true; + } catch (NotFoundException &nfe) { + result.nfe = nfe; + result.__isset.nfe = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_keyspace"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_keyspace"); + } + + oprot->writeMessageBegin("describe_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_keyspace", bytes); + } +} + +void CassandraProcessor::process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.describe_splits", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.describe_splits"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.describe_splits"); + } + + Cassandra_describe_splits_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.describe_splits", bytes); + } + + Cassandra_describe_splits_result result; + try { + iface_->describe_splits(result.success, args.cfName, args.start_token, args.end_token, args.keys_per_split); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.describe_splits"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.describe_splits"); + } + + oprot->writeMessageBegin("describe_splits", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.describe_splits", bytes); + } +} + +void CassandraProcessor::process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.system_add_column_family", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_add_column_family"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.system_add_column_family"); + } + + Cassandra_system_add_column_family_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.system_add_column_family", bytes); + } + + Cassandra_system_add_column_family_result result; + try { + iface_->system_add_column_family(result.success, args.cf_def); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.system_add_column_family"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.system_add_column_family"); + } + + oprot->writeMessageBegin("system_add_column_family", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.system_add_column_family", bytes); + } +} + +void CassandraProcessor::process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.system_drop_column_family", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_drop_column_family"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.system_drop_column_family"); + } + + Cassandra_system_drop_column_family_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.system_drop_column_family", bytes); + } + + Cassandra_system_drop_column_family_result result; + try { + iface_->system_drop_column_family(result.success, args.column_family); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.system_drop_column_family"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.system_drop_column_family"); + } + + oprot->writeMessageBegin("system_drop_column_family", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.system_drop_column_family", bytes); + } +} + +void CassandraProcessor::process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.system_add_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_add_keyspace"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.system_add_keyspace"); + } + + Cassandra_system_add_keyspace_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.system_add_keyspace", bytes); + } + + Cassandra_system_add_keyspace_result result; + try { + iface_->system_add_keyspace(result.success, args.ks_def); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.system_add_keyspace"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.system_add_keyspace"); + } + + oprot->writeMessageBegin("system_add_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.system_add_keyspace", bytes); + } +} + +void CassandraProcessor::process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.system_drop_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_drop_keyspace"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.system_drop_keyspace"); + } + + Cassandra_system_drop_keyspace_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.system_drop_keyspace", bytes); + } + + Cassandra_system_drop_keyspace_result result; + try { + iface_->system_drop_keyspace(result.success, args.keyspace); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.system_drop_keyspace"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.system_drop_keyspace"); + } + + oprot->writeMessageBegin("system_drop_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.system_drop_keyspace", bytes); + } +} + +void CassandraProcessor::process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.system_update_keyspace", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_update_keyspace"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.system_update_keyspace"); + } + + Cassandra_system_update_keyspace_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.system_update_keyspace", bytes); + } + + Cassandra_system_update_keyspace_result result; + try { + iface_->system_update_keyspace(result.success, args.ks_def); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.system_update_keyspace"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.system_update_keyspace"); + } + + oprot->writeMessageBegin("system_update_keyspace", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.system_update_keyspace", bytes); + } +} + +void CassandraProcessor::process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.system_update_column_family", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.system_update_column_family"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.system_update_column_family"); + } + + Cassandra_system_update_column_family_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.system_update_column_family", bytes); + } + + Cassandra_system_update_column_family_result result; + try { + iface_->system_update_column_family(result.success, args.cf_def); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.system_update_column_family"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.system_update_column_family"); + } + + oprot->writeMessageBegin("system_update_column_family", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.system_update_column_family", bytes); + } +} + +void CassandraProcessor::process_execute_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.execute_cql_query", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.execute_cql_query"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.execute_cql_query"); + } + + Cassandra_execute_cql_query_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.execute_cql_query", bytes); + } + + Cassandra_execute_cql_query_result result; + try { + iface_->execute_cql_query(result.success, args.query, args.compression); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.execute_cql_query"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("execute_cql_query", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.execute_cql_query"); + } + + oprot->writeMessageBegin("execute_cql_query", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.execute_cql_query", bytes); + } +} + +void CassandraProcessor::process_prepare_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.prepare_cql_query", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.prepare_cql_query"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.prepare_cql_query"); + } + + Cassandra_prepare_cql_query_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.prepare_cql_query", bytes); + } + + Cassandra_prepare_cql_query_result result; + try { + iface_->prepare_cql_query(result.success, args.query, args.compression); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.prepare_cql_query"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("prepare_cql_query", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.prepare_cql_query"); + } + + oprot->writeMessageBegin("prepare_cql_query", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.prepare_cql_query", bytes); + } +} + +void CassandraProcessor::process_execute_prepared_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.execute_prepared_cql_query", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.execute_prepared_cql_query"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.execute_prepared_cql_query"); + } + + Cassandra_execute_prepared_cql_query_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.execute_prepared_cql_query", bytes); + } + + Cassandra_execute_prepared_cql_query_result result; + try { + iface_->execute_prepared_cql_query(result.success, args.itemId, args.values); + result.__isset.success = true; + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (UnavailableException &ue) { + result.ue = ue; + result.__isset.ue = true; + } catch (TimedOutException &te) { + result.te = te; + result.__isset.te = true; + } catch (SchemaDisagreementException &sde) { + result.sde = sde; + result.__isset.sde = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.execute_prepared_cql_query"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("execute_prepared_cql_query", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.execute_prepared_cql_query"); + } + + oprot->writeMessageBegin("execute_prepared_cql_query", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.execute_prepared_cql_query", bytes); + } +} + +void CassandraProcessor::process_set_cql_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext) +{ + void* ctx = NULL; + if (this->eventHandler_.get() != NULL) { + ctx = this->eventHandler_->getContext("Cassandra.set_cql_version", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "Cassandra.set_cql_version"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "Cassandra.set_cql_version"); + } + + Cassandra_set_cql_version_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "Cassandra.set_cql_version", bytes); + } + + Cassandra_set_cql_version_result result; + try { + iface_->set_cql_version(args.version); + } catch (InvalidRequestException &ire) { + result.ire = ire; + result.__isset.ire = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "Cassandra.set_cql_version"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("set_cql_version", ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return; + } + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preWrite(ctx, "Cassandra.set_cql_version"); + } + + oprot->writeMessageBegin("set_cql_version", ::apache::thrift::protocol::T_REPLY, seqid); + result.write(oprot); + oprot->writeMessageEnd(); + bytes = oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postWrite(ctx, "Cassandra.set_cql_version", bytes); + } +} + +::boost::shared_ptr< ::apache::thrift::TProcessor > CassandraProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { + ::apache::thrift::ReleaseHandler< CassandraIfFactory > cleanup(handlerFactory_); + ::boost::shared_ptr< CassandraIf > handler(handlerFactory_->getHandler(connInfo), cleanup); + ::boost::shared_ptr< ::apache::thrift::TProcessor > processor(new CassandraProcessor(handler)); + return processor; +} +}}} // namespace + diff --git a/storage/cassandra/gen-cpp/Cassandra.h b/storage/cassandra/gen-cpp/Cassandra.h new file mode 100644 index 00000000000..2040cc63aa2 --- /dev/null +++ b/storage/cassandra/gen-cpp/Cassandra.h @@ -0,0 +1,5466 @@ +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef Cassandra_H +#define Cassandra_H + +#include <TProcessor.h> +#include "cassandra_types.h" + +namespace org { namespace apache { namespace cassandra { + +class CassandraIf { + public: + virtual ~CassandraIf() {} + virtual void login(const AuthenticationRequest& auth_request) = 0; + virtual void set_keyspace(const std::string& keyspace) = 0; + virtual void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) = 0; + virtual void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0; + virtual int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0; + virtual void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0; + virtual void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) = 0; + virtual void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) = 0; + virtual void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) = 0; + virtual void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) = 0; + virtual void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) = 0; + virtual void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) = 0; + virtual void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) = 0; + virtual void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) = 0; + virtual void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) = 0; + virtual void truncate(const std::string& cfname) = 0; + virtual void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) = 0; + virtual void describe_keyspaces(std::vector<KsDef> & _return) = 0; + virtual void describe_cluster_name(std::string& _return) = 0; + virtual void describe_version(std::string& _return) = 0; + virtual void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace) = 0; + virtual void describe_token_map(std::map<std::string, std::string> & _return) = 0; + virtual void describe_partitioner(std::string& _return) = 0; + virtual void describe_snitch(std::string& _return) = 0; + virtual void describe_keyspace(KsDef& _return, const std::string& keyspace) = 0; + virtual void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) = 0; + virtual void system_add_column_family(std::string& _return, const CfDef& cf_def) = 0; + virtual void system_drop_column_family(std::string& _return, const std::string& column_family) = 0; + virtual void system_add_keyspace(std::string& _return, const KsDef& ks_def) = 0; + virtual void system_drop_keyspace(std::string& _return, const std::string& keyspace) = 0; + virtual void system_update_keyspace(std::string& _return, const KsDef& ks_def) = 0; + virtual void system_update_column_family(std::string& _return, const CfDef& cf_def) = 0; + virtual void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression) = 0; + virtual void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression) = 0; + virtual void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values) = 0; + virtual void set_cql_version(const std::string& version) = 0; +}; + +class CassandraIfFactory { + public: + typedef CassandraIf Handler; + + virtual ~CassandraIfFactory() {} + + virtual CassandraIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; + virtual void releaseHandler(CassandraIf* /* handler */) = 0; +}; + +class CassandraIfSingletonFactory : virtual public CassandraIfFactory { + public: + CassandraIfSingletonFactory(const boost::shared_ptr<CassandraIf>& iface) : iface_(iface) {} + virtual ~CassandraIfSingletonFactory() {} + + virtual CassandraIf* getHandler(const ::apache::thrift::TConnectionInfo&) { + return iface_.get(); + } + virtual void releaseHandler(CassandraIf* /* handler */) {} + + protected: + boost::shared_ptr<CassandraIf> iface_; +}; + +class CassandraNull : virtual public CassandraIf { + public: + virtual ~CassandraNull() {} + void login(const AuthenticationRequest& /* auth_request */) { + return; + } + void set_keyspace(const std::string& /* keyspace */) { + return; + } + void get(ColumnOrSuperColumn& /* _return */, const std::string& /* key */, const ColumnPath& /* column_path */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void get_slice(std::vector<ColumnOrSuperColumn> & /* _return */, const std::string& /* key */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + int32_t get_count(const std::string& /* key */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) { + int32_t _return = 0; + return _return; + } + void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & /* _return */, const std::vector<std::string> & /* keys */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void multiget_count(std::map<std::string, int32_t> & /* _return */, const std::vector<std::string> & /* keys */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void get_range_slices(std::vector<KeySlice> & /* _return */, const ColumnParent& /* column_parent */, const SlicePredicate& /* predicate */, const KeyRange& /* range */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void get_paged_slice(std::vector<KeySlice> & /* _return */, const std::string& /* column_family */, const KeyRange& /* range */, const std::string& /* start_column */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void get_indexed_slices(std::vector<KeySlice> & /* _return */, const ColumnParent& /* column_parent */, const IndexClause& /* index_clause */, const SlicePredicate& /* column_predicate */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void insert(const std::string& /* key */, const ColumnParent& /* column_parent */, const Column& /* column */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void add(const std::string& /* key */, const ColumnParent& /* column_parent */, const CounterColumn& /* column */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void remove(const std::string& /* key */, const ColumnPath& /* column_path */, const int64_t /* timestamp */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void remove_counter(const std::string& /* key */, const ColumnPath& /* path */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & /* mutation_map */, const ConsistencyLevel::type /* consistency_level */) { + return; + } + void truncate(const std::string& /* cfname */) { + return; + } + void describe_schema_versions(std::map<std::string, std::vector<std::string> > & /* _return */) { + return; + } + void describe_keyspaces(std::vector<KsDef> & /* _return */) { + return; + } + void describe_cluster_name(std::string& /* _return */) { + return; + } + void describe_version(std::string& /* _return */) { + return; + } + void describe_ring(std::vector<TokenRange> & /* _return */, const std::string& /* keyspace */) { + return; + } + void describe_token_map(std::map<std::string, std::string> & /* _return */) { + return; + } + void describe_partitioner(std::string& /* _return */) { + return; + } + void describe_snitch(std::string& /* _return */) { + return; + } + void describe_keyspace(KsDef& /* _return */, const std::string& /* keyspace */) { + return; + } + void describe_splits(std::vector<std::string> & /* _return */, const std::string& /* cfName */, const std::string& /* start_token */, const std::string& /* end_token */, const int32_t /* keys_per_split */) { + return; + } + void system_add_column_family(std::string& /* _return */, const CfDef& /* cf_def */) { + return; + } + void system_drop_column_family(std::string& /* _return */, const std::string& /* column_family */) { + return; + } + void system_add_keyspace(std::string& /* _return */, const KsDef& /* ks_def */) { + return; + } + void system_drop_keyspace(std::string& /* _return */, const std::string& /* keyspace */) { + return; + } + void system_update_keyspace(std::string& /* _return */, const KsDef& /* ks_def */) { + return; + } + void system_update_column_family(std::string& /* _return */, const CfDef& /* cf_def */) { + return; + } + void execute_cql_query(CqlResult& /* _return */, const std::string& /* query */, const Compression::type /* compression */) { + return; + } + void prepare_cql_query(CqlPreparedResult& /* _return */, const std::string& /* query */, const Compression::type /* compression */) { + return; + } + void execute_prepared_cql_query(CqlResult& /* _return */, const int32_t /* itemId */, const std::vector<std::string> & /* values */) { + return; + } + void set_cql_version(const std::string& /* version */) { + return; + } +}; + + +class Cassandra_login_args { + public: + + Cassandra_login_args() { + } + + virtual ~Cassandra_login_args() throw() {} + + AuthenticationRequest auth_request; + + void __set_auth_request(const AuthenticationRequest& val) { + auth_request = val; + } + + bool operator == (const Cassandra_login_args & rhs) const + { + if (!(auth_request == rhs.auth_request)) + return false; + return true; + } + bool operator != (const Cassandra_login_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_login_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_login_pargs { + public: + + + virtual ~Cassandra_login_pargs() throw() {} + + const AuthenticationRequest* auth_request; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_login_result__isset { + _Cassandra_login_result__isset() : authnx(false), authzx(false) {} + bool authnx; + bool authzx; +} _Cassandra_login_result__isset; + +class Cassandra_login_result { + public: + + Cassandra_login_result() { + } + + virtual ~Cassandra_login_result() throw() {} + + AuthenticationException authnx; + AuthorizationException authzx; + + _Cassandra_login_result__isset __isset; + + void __set_authnx(const AuthenticationException& val) { + authnx = val; + } + + void __set_authzx(const AuthorizationException& val) { + authzx = val; + } + + bool operator == (const Cassandra_login_result & rhs) const + { + if (!(authnx == rhs.authnx)) + return false; + if (!(authzx == rhs.authzx)) + return false; + return true; + } + bool operator != (const Cassandra_login_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_login_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_login_presult__isset { + _Cassandra_login_presult__isset() : authnx(false), authzx(false) {} + bool authnx; + bool authzx; +} _Cassandra_login_presult__isset; + +class Cassandra_login_presult { + public: + + + virtual ~Cassandra_login_presult() throw() {} + + AuthenticationException authnx; + AuthorizationException authzx; + + _Cassandra_login_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_set_keyspace_args { + public: + + Cassandra_set_keyspace_args() : keyspace("") { + } + + virtual ~Cassandra_set_keyspace_args() throw() {} + + std::string keyspace; + + void __set_keyspace(const std::string& val) { + keyspace = val; + } + + bool operator == (const Cassandra_set_keyspace_args & rhs) const + { + if (!(keyspace == rhs.keyspace)) + return false; + return true; + } + bool operator != (const Cassandra_set_keyspace_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_set_keyspace_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_set_keyspace_pargs { + public: + + + virtual ~Cassandra_set_keyspace_pargs() throw() {} + + const std::string* keyspace; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_set_keyspace_result__isset { + _Cassandra_set_keyspace_result__isset() : ire(false) {} + bool ire; +} _Cassandra_set_keyspace_result__isset; + +class Cassandra_set_keyspace_result { + public: + + Cassandra_set_keyspace_result() { + } + + virtual ~Cassandra_set_keyspace_result() throw() {} + + InvalidRequestException ire; + + _Cassandra_set_keyspace_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_set_keyspace_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_set_keyspace_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_set_keyspace_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_set_keyspace_presult__isset { + _Cassandra_set_keyspace_presult__isset() : ire(false) {} + bool ire; +} _Cassandra_set_keyspace_presult__isset; + +class Cassandra_set_keyspace_presult { + public: + + + virtual ~Cassandra_set_keyspace_presult() throw() {} + + InvalidRequestException ire; + + _Cassandra_set_keyspace_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_get_args { + public: + + Cassandra_get_args() : key(""), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_get_args() throw() {} + + std::string key; + ColumnPath column_path; + ConsistencyLevel::type consistency_level; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_column_path(const ColumnPath& val) { + column_path = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_get_args & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(column_path == rhs.column_path)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_get_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_get_pargs { + public: + + + virtual ~Cassandra_get_pargs() throw() {} + + const std::string* key; + const ColumnPath* column_path; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_result__isset { + _Cassandra_get_result__isset() : success(false), ire(false), nfe(false), ue(false), te(false) {} + bool success; + bool ire; + bool nfe; + bool ue; + bool te; +} _Cassandra_get_result__isset; + +class Cassandra_get_result { + public: + + Cassandra_get_result() { + } + + virtual ~Cassandra_get_result() throw() {} + + ColumnOrSuperColumn success; + InvalidRequestException ire; + NotFoundException nfe; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_result__isset __isset; + + void __set_success(const ColumnOrSuperColumn& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_nfe(const NotFoundException& val) { + nfe = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_get_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(nfe == rhs.nfe)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_get_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_presult__isset { + _Cassandra_get_presult__isset() : success(false), ire(false), nfe(false), ue(false), te(false) {} + bool success; + bool ire; + bool nfe; + bool ue; + bool te; +} _Cassandra_get_presult__isset; + +class Cassandra_get_presult { + public: + + + virtual ~Cassandra_get_presult() throw() {} + + ColumnOrSuperColumn* success; + InvalidRequestException ire; + NotFoundException nfe; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_get_slice_args { + public: + + Cassandra_get_slice_args() : key(""), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_get_slice_args() throw() {} + + std::string key; + ColumnParent column_parent; + SlicePredicate predicate; + ConsistencyLevel::type consistency_level; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_predicate(const SlicePredicate& val) { + predicate = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_get_slice_args & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(column_parent == rhs.column_parent)) + return false; + if (!(predicate == rhs.predicate)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_get_slice_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_slice_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_get_slice_pargs { + public: + + + virtual ~Cassandra_get_slice_pargs() throw() {} + + const std::string* key; + const ColumnParent* column_parent; + const SlicePredicate* predicate; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_slice_result__isset { + _Cassandra_get_slice_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_slice_result__isset; + +class Cassandra_get_slice_result { + public: + + Cassandra_get_slice_result() { + } + + virtual ~Cassandra_get_slice_result() throw() {} + + std::vector<ColumnOrSuperColumn> success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_slice_result__isset __isset; + + void __set_success(const std::vector<ColumnOrSuperColumn> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_get_slice_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_get_slice_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_slice_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_slice_presult__isset { + _Cassandra_get_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_slice_presult__isset; + +class Cassandra_get_slice_presult { + public: + + + virtual ~Cassandra_get_slice_presult() throw() {} + + std::vector<ColumnOrSuperColumn> * success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_slice_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_get_count_args { + public: + + Cassandra_get_count_args() : key(""), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_get_count_args() throw() {} + + std::string key; + ColumnParent column_parent; + SlicePredicate predicate; + ConsistencyLevel::type consistency_level; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_predicate(const SlicePredicate& val) { + predicate = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_get_count_args & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(column_parent == rhs.column_parent)) + return false; + if (!(predicate == rhs.predicate)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_get_count_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_count_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_get_count_pargs { + public: + + + virtual ~Cassandra_get_count_pargs() throw() {} + + const std::string* key; + const ColumnParent* column_parent; + const SlicePredicate* predicate; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_count_result__isset { + _Cassandra_get_count_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_count_result__isset; + +class Cassandra_get_count_result { + public: + + Cassandra_get_count_result() : success(0) { + } + + virtual ~Cassandra_get_count_result() throw() {} + + int32_t success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_count_result__isset __isset; + + void __set_success(const int32_t val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_get_count_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_get_count_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_count_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_count_presult__isset { + _Cassandra_get_count_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_count_presult__isset; + +class Cassandra_get_count_presult { + public: + + + virtual ~Cassandra_get_count_presult() throw() {} + + int32_t* success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_count_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_multiget_slice_args { + public: + + Cassandra_multiget_slice_args() : consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_multiget_slice_args() throw() {} + + std::vector<std::string> keys; + ColumnParent column_parent; + SlicePredicate predicate; + ConsistencyLevel::type consistency_level; + + void __set_keys(const std::vector<std::string> & val) { + keys = val; + } + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_predicate(const SlicePredicate& val) { + predicate = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_multiget_slice_args & rhs) const + { + if (!(keys == rhs.keys)) + return false; + if (!(column_parent == rhs.column_parent)) + return false; + if (!(predicate == rhs.predicate)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_multiget_slice_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_multiget_slice_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_multiget_slice_pargs { + public: + + + virtual ~Cassandra_multiget_slice_pargs() throw() {} + + const std::vector<std::string> * keys; + const ColumnParent* column_parent; + const SlicePredicate* predicate; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_multiget_slice_result__isset { + _Cassandra_multiget_slice_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_slice_result__isset; + +class Cassandra_multiget_slice_result { + public: + + Cassandra_multiget_slice_result() { + } + + virtual ~Cassandra_multiget_slice_result() throw() {} + + std::map<std::string, std::vector<ColumnOrSuperColumn> > success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_multiget_slice_result__isset __isset; + + void __set_success(const std::map<std::string, std::vector<ColumnOrSuperColumn> > & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_multiget_slice_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_multiget_slice_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_multiget_slice_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_multiget_slice_presult__isset { + _Cassandra_multiget_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_slice_presult__isset; + +class Cassandra_multiget_slice_presult { + public: + + + virtual ~Cassandra_multiget_slice_presult() throw() {} + + std::map<std::string, std::vector<ColumnOrSuperColumn> > * success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_multiget_slice_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_multiget_count_args { + public: + + Cassandra_multiget_count_args() : consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_multiget_count_args() throw() {} + + std::vector<std::string> keys; + ColumnParent column_parent; + SlicePredicate predicate; + ConsistencyLevel::type consistency_level; + + void __set_keys(const std::vector<std::string> & val) { + keys = val; + } + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_predicate(const SlicePredicate& val) { + predicate = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_multiget_count_args & rhs) const + { + if (!(keys == rhs.keys)) + return false; + if (!(column_parent == rhs.column_parent)) + return false; + if (!(predicate == rhs.predicate)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_multiget_count_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_multiget_count_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_multiget_count_pargs { + public: + + + virtual ~Cassandra_multiget_count_pargs() throw() {} + + const std::vector<std::string> * keys; + const ColumnParent* column_parent; + const SlicePredicate* predicate; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_multiget_count_result__isset { + _Cassandra_multiget_count_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_count_result__isset; + +class Cassandra_multiget_count_result { + public: + + Cassandra_multiget_count_result() { + } + + virtual ~Cassandra_multiget_count_result() throw() {} + + std::map<std::string, int32_t> success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_multiget_count_result__isset __isset; + + void __set_success(const std::map<std::string, int32_t> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_multiget_count_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_multiget_count_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_multiget_count_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_multiget_count_presult__isset { + _Cassandra_multiget_count_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_multiget_count_presult__isset; + +class Cassandra_multiget_count_presult { + public: + + + virtual ~Cassandra_multiget_count_presult() throw() {} + + std::map<std::string, int32_t> * success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_multiget_count_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_get_range_slices_args { + public: + + Cassandra_get_range_slices_args() : consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_get_range_slices_args() throw() {} + + ColumnParent column_parent; + SlicePredicate predicate; + KeyRange range; + ConsistencyLevel::type consistency_level; + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_predicate(const SlicePredicate& val) { + predicate = val; + } + + void __set_range(const KeyRange& val) { + range = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_get_range_slices_args & rhs) const + { + if (!(column_parent == rhs.column_parent)) + return false; + if (!(predicate == rhs.predicate)) + return false; + if (!(range == rhs.range)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_get_range_slices_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_range_slices_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_get_range_slices_pargs { + public: + + + virtual ~Cassandra_get_range_slices_pargs() throw() {} + + const ColumnParent* column_parent; + const SlicePredicate* predicate; + const KeyRange* range; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_range_slices_result__isset { + _Cassandra_get_range_slices_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_range_slices_result__isset; + +class Cassandra_get_range_slices_result { + public: + + Cassandra_get_range_slices_result() { + } + + virtual ~Cassandra_get_range_slices_result() throw() {} + + std::vector<KeySlice> success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_range_slices_result__isset __isset; + + void __set_success(const std::vector<KeySlice> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_get_range_slices_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_get_range_slices_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_range_slices_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_range_slices_presult__isset { + _Cassandra_get_range_slices_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_range_slices_presult__isset; + +class Cassandra_get_range_slices_presult { + public: + + + virtual ~Cassandra_get_range_slices_presult() throw() {} + + std::vector<KeySlice> * success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_range_slices_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_get_paged_slice_args { + public: + + Cassandra_get_paged_slice_args() : column_family(""), start_column(""), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_get_paged_slice_args() throw() {} + + std::string column_family; + KeyRange range; + std::string start_column; + ConsistencyLevel::type consistency_level; + + void __set_column_family(const std::string& val) { + column_family = val; + } + + void __set_range(const KeyRange& val) { + range = val; + } + + void __set_start_column(const std::string& val) { + start_column = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_get_paged_slice_args & rhs) const + { + if (!(column_family == rhs.column_family)) + return false; + if (!(range == rhs.range)) + return false; + if (!(start_column == rhs.start_column)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_get_paged_slice_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_paged_slice_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_get_paged_slice_pargs { + public: + + + virtual ~Cassandra_get_paged_slice_pargs() throw() {} + + const std::string* column_family; + const KeyRange* range; + const std::string* start_column; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_paged_slice_result__isset { + _Cassandra_get_paged_slice_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_paged_slice_result__isset; + +class Cassandra_get_paged_slice_result { + public: + + Cassandra_get_paged_slice_result() { + } + + virtual ~Cassandra_get_paged_slice_result() throw() {} + + std::vector<KeySlice> success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_paged_slice_result__isset __isset; + + void __set_success(const std::vector<KeySlice> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_get_paged_slice_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_get_paged_slice_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_paged_slice_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_paged_slice_presult__isset { + _Cassandra_get_paged_slice_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_paged_slice_presult__isset; + +class Cassandra_get_paged_slice_presult { + public: + + + virtual ~Cassandra_get_paged_slice_presult() throw() {} + + std::vector<KeySlice> * success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_paged_slice_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_get_indexed_slices_args { + public: + + Cassandra_get_indexed_slices_args() : consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_get_indexed_slices_args() throw() {} + + ColumnParent column_parent; + IndexClause index_clause; + SlicePredicate column_predicate; + ConsistencyLevel::type consistency_level; + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_index_clause(const IndexClause& val) { + index_clause = val; + } + + void __set_column_predicate(const SlicePredicate& val) { + column_predicate = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_get_indexed_slices_args & rhs) const + { + if (!(column_parent == rhs.column_parent)) + return false; + if (!(index_clause == rhs.index_clause)) + return false; + if (!(column_predicate == rhs.column_predicate)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_get_indexed_slices_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_indexed_slices_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_get_indexed_slices_pargs { + public: + + + virtual ~Cassandra_get_indexed_slices_pargs() throw() {} + + const ColumnParent* column_parent; + const IndexClause* index_clause; + const SlicePredicate* column_predicate; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_indexed_slices_result__isset { + _Cassandra_get_indexed_slices_result__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_indexed_slices_result__isset; + +class Cassandra_get_indexed_slices_result { + public: + + Cassandra_get_indexed_slices_result() { + } + + virtual ~Cassandra_get_indexed_slices_result() throw() {} + + std::vector<KeySlice> success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_indexed_slices_result__isset __isset; + + void __set_success(const std::vector<KeySlice> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_get_indexed_slices_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_get_indexed_slices_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_get_indexed_slices_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_get_indexed_slices_presult__isset { + _Cassandra_get_indexed_slices_presult__isset() : success(false), ire(false), ue(false), te(false) {} + bool success; + bool ire; + bool ue; + bool te; +} _Cassandra_get_indexed_slices_presult__isset; + +class Cassandra_get_indexed_slices_presult { + public: + + + virtual ~Cassandra_get_indexed_slices_presult() throw() {} + + std::vector<KeySlice> * success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_get_indexed_slices_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_insert_args { + public: + + Cassandra_insert_args() : key(""), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_insert_args() throw() {} + + std::string key; + ColumnParent column_parent; + Column column; + ConsistencyLevel::type consistency_level; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_column(const Column& val) { + column = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_insert_args & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(column_parent == rhs.column_parent)) + return false; + if (!(column == rhs.column)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_insert_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_insert_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_insert_pargs { + public: + + + virtual ~Cassandra_insert_pargs() throw() {} + + const std::string* key; + const ColumnParent* column_parent; + const Column* column; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_insert_result__isset { + _Cassandra_insert_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_insert_result__isset; + +class Cassandra_insert_result { + public: + + Cassandra_insert_result() { + } + + virtual ~Cassandra_insert_result() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_insert_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_insert_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_insert_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_insert_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_insert_presult__isset { + _Cassandra_insert_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_insert_presult__isset; + +class Cassandra_insert_presult { + public: + + + virtual ~Cassandra_insert_presult() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_insert_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_add_args { + public: + + Cassandra_add_args() : key(""), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_add_args() throw() {} + + std::string key; + ColumnParent column_parent; + CounterColumn column; + ConsistencyLevel::type consistency_level; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_column_parent(const ColumnParent& val) { + column_parent = val; + } + + void __set_column(const CounterColumn& val) { + column = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_add_args & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(column_parent == rhs.column_parent)) + return false; + if (!(column == rhs.column)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_add_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_add_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_add_pargs { + public: + + + virtual ~Cassandra_add_pargs() throw() {} + + const std::string* key; + const ColumnParent* column_parent; + const CounterColumn* column; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_add_result__isset { + _Cassandra_add_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_add_result__isset; + +class Cassandra_add_result { + public: + + Cassandra_add_result() { + } + + virtual ~Cassandra_add_result() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_add_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_add_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_add_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_add_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_add_presult__isset { + _Cassandra_add_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_add_presult__isset; + +class Cassandra_add_presult { + public: + + + virtual ~Cassandra_add_presult() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_add_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _Cassandra_remove_args__isset { + _Cassandra_remove_args__isset() : consistency_level(false) {} + bool consistency_level; +} _Cassandra_remove_args__isset; + +class Cassandra_remove_args { + public: + + Cassandra_remove_args() : key(""), timestamp(0), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_remove_args() throw() {} + + std::string key; + ColumnPath column_path; + int64_t timestamp; + ConsistencyLevel::type consistency_level; + + _Cassandra_remove_args__isset __isset; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_column_path(const ColumnPath& val) { + column_path = val; + } + + void __set_timestamp(const int64_t val) { + timestamp = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_remove_args & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(column_path == rhs.column_path)) + return false; + if (!(timestamp == rhs.timestamp)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_remove_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_remove_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_remove_pargs { + public: + + + virtual ~Cassandra_remove_pargs() throw() {} + + const std::string* key; + const ColumnPath* column_path; + const int64_t* timestamp; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_remove_result__isset { + _Cassandra_remove_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_remove_result__isset; + +class Cassandra_remove_result { + public: + + Cassandra_remove_result() { + } + + virtual ~Cassandra_remove_result() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_remove_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_remove_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_remove_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_remove_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_remove_presult__isset { + _Cassandra_remove_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_remove_presult__isset; + +class Cassandra_remove_presult { + public: + + + virtual ~Cassandra_remove_presult() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_remove_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_remove_counter_args { + public: + + Cassandra_remove_counter_args() : key(""), consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_remove_counter_args() throw() {} + + std::string key; + ColumnPath path; + ConsistencyLevel::type consistency_level; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_path(const ColumnPath& val) { + path = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_remove_counter_args & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(path == rhs.path)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_remove_counter_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_remove_counter_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_remove_counter_pargs { + public: + + + virtual ~Cassandra_remove_counter_pargs() throw() {} + + const std::string* key; + const ColumnPath* path; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_remove_counter_result__isset { + _Cassandra_remove_counter_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_remove_counter_result__isset; + +class Cassandra_remove_counter_result { + public: + + Cassandra_remove_counter_result() { + } + + virtual ~Cassandra_remove_counter_result() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_remove_counter_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_remove_counter_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_remove_counter_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_remove_counter_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_remove_counter_presult__isset { + _Cassandra_remove_counter_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_remove_counter_presult__isset; + +class Cassandra_remove_counter_presult { + public: + + + virtual ~Cassandra_remove_counter_presult() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_remove_counter_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_batch_mutate_args { + public: + + Cassandra_batch_mutate_args() : consistency_level((ConsistencyLevel::type)1) { + consistency_level = (ConsistencyLevel::type)1; + + } + + virtual ~Cassandra_batch_mutate_args() throw() {} + + std::map<std::string, std::map<std::string, std::vector<Mutation> > > mutation_map; + ConsistencyLevel::type consistency_level; + + void __set_mutation_map(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & val) { + mutation_map = val; + } + + void __set_consistency_level(const ConsistencyLevel::type val) { + consistency_level = val; + } + + bool operator == (const Cassandra_batch_mutate_args & rhs) const + { + if (!(mutation_map == rhs.mutation_map)) + return false; + if (!(consistency_level == rhs.consistency_level)) + return false; + return true; + } + bool operator != (const Cassandra_batch_mutate_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_batch_mutate_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_batch_mutate_pargs { + public: + + + virtual ~Cassandra_batch_mutate_pargs() throw() {} + + const std::map<std::string, std::map<std::string, std::vector<Mutation> > > * mutation_map; + const ConsistencyLevel::type* consistency_level; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_batch_mutate_result__isset { + _Cassandra_batch_mutate_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_batch_mutate_result__isset; + +class Cassandra_batch_mutate_result { + public: + + Cassandra_batch_mutate_result() { + } + + virtual ~Cassandra_batch_mutate_result() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_batch_mutate_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_batch_mutate_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_batch_mutate_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_batch_mutate_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_batch_mutate_presult__isset { + _Cassandra_batch_mutate_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_batch_mutate_presult__isset; + +class Cassandra_batch_mutate_presult { + public: + + + virtual ~Cassandra_batch_mutate_presult() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_batch_mutate_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_truncate_args { + public: + + Cassandra_truncate_args() : cfname("") { + } + + virtual ~Cassandra_truncate_args() throw() {} + + std::string cfname; + + void __set_cfname(const std::string& val) { + cfname = val; + } + + bool operator == (const Cassandra_truncate_args & rhs) const + { + if (!(cfname == rhs.cfname)) + return false; + return true; + } + bool operator != (const Cassandra_truncate_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_truncate_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_truncate_pargs { + public: + + + virtual ~Cassandra_truncate_pargs() throw() {} + + const std::string* cfname; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_truncate_result__isset { + _Cassandra_truncate_result__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_truncate_result__isset; + +class Cassandra_truncate_result { + public: + + Cassandra_truncate_result() { + } + + virtual ~Cassandra_truncate_result() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_truncate_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + bool operator == (const Cassandra_truncate_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + return true; + } + bool operator != (const Cassandra_truncate_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_truncate_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_truncate_presult__isset { + _Cassandra_truncate_presult__isset() : ire(false), ue(false), te(false) {} + bool ire; + bool ue; + bool te; +} _Cassandra_truncate_presult__isset; + +class Cassandra_truncate_presult { + public: + + + virtual ~Cassandra_truncate_presult() throw() {} + + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + + _Cassandra_truncate_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_schema_versions_args { + public: + + Cassandra_describe_schema_versions_args() { + } + + virtual ~Cassandra_describe_schema_versions_args() throw() {} + + + bool operator == (const Cassandra_describe_schema_versions_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_schema_versions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_schema_versions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_schema_versions_pargs { + public: + + + virtual ~Cassandra_describe_schema_versions_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_schema_versions_result__isset { + _Cassandra_describe_schema_versions_result__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_schema_versions_result__isset; + +class Cassandra_describe_schema_versions_result { + public: + + Cassandra_describe_schema_versions_result() { + } + + virtual ~Cassandra_describe_schema_versions_result() throw() {} + + std::map<std::string, std::vector<std::string> > success; + InvalidRequestException ire; + + _Cassandra_describe_schema_versions_result__isset __isset; + + void __set_success(const std::map<std::string, std::vector<std::string> > & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_describe_schema_versions_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_describe_schema_versions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_schema_versions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_schema_versions_presult__isset { + _Cassandra_describe_schema_versions_presult__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_schema_versions_presult__isset; + +class Cassandra_describe_schema_versions_presult { + public: + + + virtual ~Cassandra_describe_schema_versions_presult() throw() {} + + std::map<std::string, std::vector<std::string> > * success; + InvalidRequestException ire; + + _Cassandra_describe_schema_versions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_keyspaces_args { + public: + + Cassandra_describe_keyspaces_args() { + } + + virtual ~Cassandra_describe_keyspaces_args() throw() {} + + + bool operator == (const Cassandra_describe_keyspaces_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_keyspaces_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_keyspaces_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_keyspaces_pargs { + public: + + + virtual ~Cassandra_describe_keyspaces_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_keyspaces_result__isset { + _Cassandra_describe_keyspaces_result__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_keyspaces_result__isset; + +class Cassandra_describe_keyspaces_result { + public: + + Cassandra_describe_keyspaces_result() { + } + + virtual ~Cassandra_describe_keyspaces_result() throw() {} + + std::vector<KsDef> success; + InvalidRequestException ire; + + _Cassandra_describe_keyspaces_result__isset __isset; + + void __set_success(const std::vector<KsDef> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_describe_keyspaces_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_describe_keyspaces_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_keyspaces_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_keyspaces_presult__isset { + _Cassandra_describe_keyspaces_presult__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_keyspaces_presult__isset; + +class Cassandra_describe_keyspaces_presult { + public: + + + virtual ~Cassandra_describe_keyspaces_presult() throw() {} + + std::vector<KsDef> * success; + InvalidRequestException ire; + + _Cassandra_describe_keyspaces_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_cluster_name_args { + public: + + Cassandra_describe_cluster_name_args() { + } + + virtual ~Cassandra_describe_cluster_name_args() throw() {} + + + bool operator == (const Cassandra_describe_cluster_name_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_cluster_name_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_cluster_name_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_cluster_name_pargs { + public: + + + virtual ~Cassandra_describe_cluster_name_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_cluster_name_result__isset { + _Cassandra_describe_cluster_name_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_cluster_name_result__isset; + +class Cassandra_describe_cluster_name_result { + public: + + Cassandra_describe_cluster_name_result() : success("") { + } + + virtual ~Cassandra_describe_cluster_name_result() throw() {} + + std::string success; + + _Cassandra_describe_cluster_name_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + bool operator == (const Cassandra_describe_cluster_name_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const Cassandra_describe_cluster_name_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_cluster_name_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_cluster_name_presult__isset { + _Cassandra_describe_cluster_name_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_cluster_name_presult__isset; + +class Cassandra_describe_cluster_name_presult { + public: + + + virtual ~Cassandra_describe_cluster_name_presult() throw() {} + + std::string* success; + + _Cassandra_describe_cluster_name_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_version_args { + public: + + Cassandra_describe_version_args() { + } + + virtual ~Cassandra_describe_version_args() throw() {} + + + bool operator == (const Cassandra_describe_version_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_version_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_version_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_version_pargs { + public: + + + virtual ~Cassandra_describe_version_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_version_result__isset { + _Cassandra_describe_version_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_version_result__isset; + +class Cassandra_describe_version_result { + public: + + Cassandra_describe_version_result() : success("") { + } + + virtual ~Cassandra_describe_version_result() throw() {} + + std::string success; + + _Cassandra_describe_version_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + bool operator == (const Cassandra_describe_version_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const Cassandra_describe_version_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_version_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_version_presult__isset { + _Cassandra_describe_version_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_version_presult__isset; + +class Cassandra_describe_version_presult { + public: + + + virtual ~Cassandra_describe_version_presult() throw() {} + + std::string* success; + + _Cassandra_describe_version_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_ring_args { + public: + + Cassandra_describe_ring_args() : keyspace("") { + } + + virtual ~Cassandra_describe_ring_args() throw() {} + + std::string keyspace; + + void __set_keyspace(const std::string& val) { + keyspace = val; + } + + bool operator == (const Cassandra_describe_ring_args & rhs) const + { + if (!(keyspace == rhs.keyspace)) + return false; + return true; + } + bool operator != (const Cassandra_describe_ring_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_ring_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_ring_pargs { + public: + + + virtual ~Cassandra_describe_ring_pargs() throw() {} + + const std::string* keyspace; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_ring_result__isset { + _Cassandra_describe_ring_result__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_ring_result__isset; + +class Cassandra_describe_ring_result { + public: + + Cassandra_describe_ring_result() { + } + + virtual ~Cassandra_describe_ring_result() throw() {} + + std::vector<TokenRange> success; + InvalidRequestException ire; + + _Cassandra_describe_ring_result__isset __isset; + + void __set_success(const std::vector<TokenRange> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_describe_ring_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_describe_ring_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_ring_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_ring_presult__isset { + _Cassandra_describe_ring_presult__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_ring_presult__isset; + +class Cassandra_describe_ring_presult { + public: + + + virtual ~Cassandra_describe_ring_presult() throw() {} + + std::vector<TokenRange> * success; + InvalidRequestException ire; + + _Cassandra_describe_ring_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_token_map_args { + public: + + Cassandra_describe_token_map_args() { + } + + virtual ~Cassandra_describe_token_map_args() throw() {} + + + bool operator == (const Cassandra_describe_token_map_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_token_map_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_token_map_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_token_map_pargs { + public: + + + virtual ~Cassandra_describe_token_map_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_token_map_result__isset { + _Cassandra_describe_token_map_result__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_token_map_result__isset; + +class Cassandra_describe_token_map_result { + public: + + Cassandra_describe_token_map_result() { + } + + virtual ~Cassandra_describe_token_map_result() throw() {} + + std::map<std::string, std::string> success; + InvalidRequestException ire; + + _Cassandra_describe_token_map_result__isset __isset; + + void __set_success(const std::map<std::string, std::string> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_describe_token_map_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_describe_token_map_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_token_map_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_token_map_presult__isset { + _Cassandra_describe_token_map_presult__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_token_map_presult__isset; + +class Cassandra_describe_token_map_presult { + public: + + + virtual ~Cassandra_describe_token_map_presult() throw() {} + + std::map<std::string, std::string> * success; + InvalidRequestException ire; + + _Cassandra_describe_token_map_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_partitioner_args { + public: + + Cassandra_describe_partitioner_args() { + } + + virtual ~Cassandra_describe_partitioner_args() throw() {} + + + bool operator == (const Cassandra_describe_partitioner_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_partitioner_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_partitioner_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_partitioner_pargs { + public: + + + virtual ~Cassandra_describe_partitioner_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_partitioner_result__isset { + _Cassandra_describe_partitioner_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_partitioner_result__isset; + +class Cassandra_describe_partitioner_result { + public: + + Cassandra_describe_partitioner_result() : success("") { + } + + virtual ~Cassandra_describe_partitioner_result() throw() {} + + std::string success; + + _Cassandra_describe_partitioner_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + bool operator == (const Cassandra_describe_partitioner_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const Cassandra_describe_partitioner_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_partitioner_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_partitioner_presult__isset { + _Cassandra_describe_partitioner_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_partitioner_presult__isset; + +class Cassandra_describe_partitioner_presult { + public: + + + virtual ~Cassandra_describe_partitioner_presult() throw() {} + + std::string* success; + + _Cassandra_describe_partitioner_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_snitch_args { + public: + + Cassandra_describe_snitch_args() { + } + + virtual ~Cassandra_describe_snitch_args() throw() {} + + + bool operator == (const Cassandra_describe_snitch_args & /* rhs */) const + { + return true; + } + bool operator != (const Cassandra_describe_snitch_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_snitch_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_snitch_pargs { + public: + + + virtual ~Cassandra_describe_snitch_pargs() throw() {} + + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_snitch_result__isset { + _Cassandra_describe_snitch_result__isset() : success(false) {} + bool success; +} _Cassandra_describe_snitch_result__isset; + +class Cassandra_describe_snitch_result { + public: + + Cassandra_describe_snitch_result() : success("") { + } + + virtual ~Cassandra_describe_snitch_result() throw() {} + + std::string success; + + _Cassandra_describe_snitch_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + bool operator == (const Cassandra_describe_snitch_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const Cassandra_describe_snitch_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_snitch_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_snitch_presult__isset { + _Cassandra_describe_snitch_presult__isset() : success(false) {} + bool success; +} _Cassandra_describe_snitch_presult__isset; + +class Cassandra_describe_snitch_presult { + public: + + + virtual ~Cassandra_describe_snitch_presult() throw() {} + + std::string* success; + + _Cassandra_describe_snitch_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_keyspace_args { + public: + + Cassandra_describe_keyspace_args() : keyspace("") { + } + + virtual ~Cassandra_describe_keyspace_args() throw() {} + + std::string keyspace; + + void __set_keyspace(const std::string& val) { + keyspace = val; + } + + bool operator == (const Cassandra_describe_keyspace_args & rhs) const + { + if (!(keyspace == rhs.keyspace)) + return false; + return true; + } + bool operator != (const Cassandra_describe_keyspace_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_keyspace_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_keyspace_pargs { + public: + + + virtual ~Cassandra_describe_keyspace_pargs() throw() {} + + const std::string* keyspace; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_keyspace_result__isset { + _Cassandra_describe_keyspace_result__isset() : success(false), nfe(false), ire(false) {} + bool success; + bool nfe; + bool ire; +} _Cassandra_describe_keyspace_result__isset; + +class Cassandra_describe_keyspace_result { + public: + + Cassandra_describe_keyspace_result() { + } + + virtual ~Cassandra_describe_keyspace_result() throw() {} + + KsDef success; + NotFoundException nfe; + InvalidRequestException ire; + + _Cassandra_describe_keyspace_result__isset __isset; + + void __set_success(const KsDef& val) { + success = val; + } + + void __set_nfe(const NotFoundException& val) { + nfe = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_describe_keyspace_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(nfe == rhs.nfe)) + return false; + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_describe_keyspace_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_keyspace_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_keyspace_presult__isset { + _Cassandra_describe_keyspace_presult__isset() : success(false), nfe(false), ire(false) {} + bool success; + bool nfe; + bool ire; +} _Cassandra_describe_keyspace_presult__isset; + +class Cassandra_describe_keyspace_presult { + public: + + + virtual ~Cassandra_describe_keyspace_presult() throw() {} + + KsDef* success; + NotFoundException nfe; + InvalidRequestException ire; + + _Cassandra_describe_keyspace_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_describe_splits_args { + public: + + Cassandra_describe_splits_args() : cfName(""), start_token(""), end_token(""), keys_per_split(0) { + } + + virtual ~Cassandra_describe_splits_args() throw() {} + + std::string cfName; + std::string start_token; + std::string end_token; + int32_t keys_per_split; + + void __set_cfName(const std::string& val) { + cfName = val; + } + + void __set_start_token(const std::string& val) { + start_token = val; + } + + void __set_end_token(const std::string& val) { + end_token = val; + } + + void __set_keys_per_split(const int32_t val) { + keys_per_split = val; + } + + bool operator == (const Cassandra_describe_splits_args & rhs) const + { + if (!(cfName == rhs.cfName)) + return false; + if (!(start_token == rhs.start_token)) + return false; + if (!(end_token == rhs.end_token)) + return false; + if (!(keys_per_split == rhs.keys_per_split)) + return false; + return true; + } + bool operator != (const Cassandra_describe_splits_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_splits_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_describe_splits_pargs { + public: + + + virtual ~Cassandra_describe_splits_pargs() throw() {} + + const std::string* cfName; + const std::string* start_token; + const std::string* end_token; + const int32_t* keys_per_split; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_splits_result__isset { + _Cassandra_describe_splits_result__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_splits_result__isset; + +class Cassandra_describe_splits_result { + public: + + Cassandra_describe_splits_result() { + } + + virtual ~Cassandra_describe_splits_result() throw() {} + + std::vector<std::string> success; + InvalidRequestException ire; + + _Cassandra_describe_splits_result__isset __isset; + + void __set_success(const std::vector<std::string> & val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_describe_splits_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_describe_splits_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_describe_splits_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_describe_splits_presult__isset { + _Cassandra_describe_splits_presult__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_describe_splits_presult__isset; + +class Cassandra_describe_splits_presult { + public: + + + virtual ~Cassandra_describe_splits_presult() throw() {} + + std::vector<std::string> * success; + InvalidRequestException ire; + + _Cassandra_describe_splits_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_system_add_column_family_args { + public: + + Cassandra_system_add_column_family_args() { + } + + virtual ~Cassandra_system_add_column_family_args() throw() {} + + CfDef cf_def; + + void __set_cf_def(const CfDef& val) { + cf_def = val; + } + + bool operator == (const Cassandra_system_add_column_family_args & rhs) const + { + if (!(cf_def == rhs.cf_def)) + return false; + return true; + } + bool operator != (const Cassandra_system_add_column_family_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_add_column_family_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_system_add_column_family_pargs { + public: + + + virtual ~Cassandra_system_add_column_family_pargs() throw() {} + + const CfDef* cf_def; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_add_column_family_result__isset { + _Cassandra_system_add_column_family_result__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_add_column_family_result__isset; + +class Cassandra_system_add_column_family_result { + public: + + Cassandra_system_add_column_family_result() : success("") { + } + + virtual ~Cassandra_system_add_column_family_result() throw() {} + + std::string success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_add_column_family_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_system_add_column_family_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_system_add_column_family_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_add_column_family_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_add_column_family_presult__isset { + _Cassandra_system_add_column_family_presult__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_add_column_family_presult__isset; + +class Cassandra_system_add_column_family_presult { + public: + + + virtual ~Cassandra_system_add_column_family_presult() throw() {} + + std::string* success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_add_column_family_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_system_drop_column_family_args { + public: + + Cassandra_system_drop_column_family_args() : column_family("") { + } + + virtual ~Cassandra_system_drop_column_family_args() throw() {} + + std::string column_family; + + void __set_column_family(const std::string& val) { + column_family = val; + } + + bool operator == (const Cassandra_system_drop_column_family_args & rhs) const + { + if (!(column_family == rhs.column_family)) + return false; + return true; + } + bool operator != (const Cassandra_system_drop_column_family_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_drop_column_family_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_system_drop_column_family_pargs { + public: + + + virtual ~Cassandra_system_drop_column_family_pargs() throw() {} + + const std::string* column_family; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_drop_column_family_result__isset { + _Cassandra_system_drop_column_family_result__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_drop_column_family_result__isset; + +class Cassandra_system_drop_column_family_result { + public: + + Cassandra_system_drop_column_family_result() : success("") { + } + + virtual ~Cassandra_system_drop_column_family_result() throw() {} + + std::string success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_drop_column_family_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_system_drop_column_family_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_system_drop_column_family_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_drop_column_family_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_drop_column_family_presult__isset { + _Cassandra_system_drop_column_family_presult__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_drop_column_family_presult__isset; + +class Cassandra_system_drop_column_family_presult { + public: + + + virtual ~Cassandra_system_drop_column_family_presult() throw() {} + + std::string* success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_drop_column_family_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_system_add_keyspace_args { + public: + + Cassandra_system_add_keyspace_args() { + } + + virtual ~Cassandra_system_add_keyspace_args() throw() {} + + KsDef ks_def; + + void __set_ks_def(const KsDef& val) { + ks_def = val; + } + + bool operator == (const Cassandra_system_add_keyspace_args & rhs) const + { + if (!(ks_def == rhs.ks_def)) + return false; + return true; + } + bool operator != (const Cassandra_system_add_keyspace_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_add_keyspace_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_system_add_keyspace_pargs { + public: + + + virtual ~Cassandra_system_add_keyspace_pargs() throw() {} + + const KsDef* ks_def; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_add_keyspace_result__isset { + _Cassandra_system_add_keyspace_result__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_add_keyspace_result__isset; + +class Cassandra_system_add_keyspace_result { + public: + + Cassandra_system_add_keyspace_result() : success("") { + } + + virtual ~Cassandra_system_add_keyspace_result() throw() {} + + std::string success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_add_keyspace_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_system_add_keyspace_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_system_add_keyspace_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_add_keyspace_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_add_keyspace_presult__isset { + _Cassandra_system_add_keyspace_presult__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_add_keyspace_presult__isset; + +class Cassandra_system_add_keyspace_presult { + public: + + + virtual ~Cassandra_system_add_keyspace_presult() throw() {} + + std::string* success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_add_keyspace_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_system_drop_keyspace_args { + public: + + Cassandra_system_drop_keyspace_args() : keyspace("") { + } + + virtual ~Cassandra_system_drop_keyspace_args() throw() {} + + std::string keyspace; + + void __set_keyspace(const std::string& val) { + keyspace = val; + } + + bool operator == (const Cassandra_system_drop_keyspace_args & rhs) const + { + if (!(keyspace == rhs.keyspace)) + return false; + return true; + } + bool operator != (const Cassandra_system_drop_keyspace_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_drop_keyspace_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_system_drop_keyspace_pargs { + public: + + + virtual ~Cassandra_system_drop_keyspace_pargs() throw() {} + + const std::string* keyspace; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_drop_keyspace_result__isset { + _Cassandra_system_drop_keyspace_result__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_drop_keyspace_result__isset; + +class Cassandra_system_drop_keyspace_result { + public: + + Cassandra_system_drop_keyspace_result() : success("") { + } + + virtual ~Cassandra_system_drop_keyspace_result() throw() {} + + std::string success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_drop_keyspace_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_system_drop_keyspace_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_system_drop_keyspace_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_drop_keyspace_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_drop_keyspace_presult__isset { + _Cassandra_system_drop_keyspace_presult__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_drop_keyspace_presult__isset; + +class Cassandra_system_drop_keyspace_presult { + public: + + + virtual ~Cassandra_system_drop_keyspace_presult() throw() {} + + std::string* success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_drop_keyspace_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_system_update_keyspace_args { + public: + + Cassandra_system_update_keyspace_args() { + } + + virtual ~Cassandra_system_update_keyspace_args() throw() {} + + KsDef ks_def; + + void __set_ks_def(const KsDef& val) { + ks_def = val; + } + + bool operator == (const Cassandra_system_update_keyspace_args & rhs) const + { + if (!(ks_def == rhs.ks_def)) + return false; + return true; + } + bool operator != (const Cassandra_system_update_keyspace_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_update_keyspace_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_system_update_keyspace_pargs { + public: + + + virtual ~Cassandra_system_update_keyspace_pargs() throw() {} + + const KsDef* ks_def; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_update_keyspace_result__isset { + _Cassandra_system_update_keyspace_result__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_update_keyspace_result__isset; + +class Cassandra_system_update_keyspace_result { + public: + + Cassandra_system_update_keyspace_result() : success("") { + } + + virtual ~Cassandra_system_update_keyspace_result() throw() {} + + std::string success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_update_keyspace_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_system_update_keyspace_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_system_update_keyspace_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_update_keyspace_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_update_keyspace_presult__isset { + _Cassandra_system_update_keyspace_presult__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_update_keyspace_presult__isset; + +class Cassandra_system_update_keyspace_presult { + public: + + + virtual ~Cassandra_system_update_keyspace_presult() throw() {} + + std::string* success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_update_keyspace_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_system_update_column_family_args { + public: + + Cassandra_system_update_column_family_args() { + } + + virtual ~Cassandra_system_update_column_family_args() throw() {} + + CfDef cf_def; + + void __set_cf_def(const CfDef& val) { + cf_def = val; + } + + bool operator == (const Cassandra_system_update_column_family_args & rhs) const + { + if (!(cf_def == rhs.cf_def)) + return false; + return true; + } + bool operator != (const Cassandra_system_update_column_family_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_update_column_family_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_system_update_column_family_pargs { + public: + + + virtual ~Cassandra_system_update_column_family_pargs() throw() {} + + const CfDef* cf_def; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_update_column_family_result__isset { + _Cassandra_system_update_column_family_result__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_update_column_family_result__isset; + +class Cassandra_system_update_column_family_result { + public: + + Cassandra_system_update_column_family_result() : success("") { + } + + virtual ~Cassandra_system_update_column_family_result() throw() {} + + std::string success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_update_column_family_result__isset __isset; + + void __set_success(const std::string& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_system_update_column_family_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_system_update_column_family_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_system_update_column_family_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_system_update_column_family_presult__isset { + _Cassandra_system_update_column_family_presult__isset() : success(false), ire(false), sde(false) {} + bool success; + bool ire; + bool sde; +} _Cassandra_system_update_column_family_presult__isset; + +class Cassandra_system_update_column_family_presult { + public: + + + virtual ~Cassandra_system_update_column_family_presult() throw() {} + + std::string* success; + InvalidRequestException ire; + SchemaDisagreementException sde; + + _Cassandra_system_update_column_family_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_execute_cql_query_args { + public: + + Cassandra_execute_cql_query_args() : query(""), compression((Compression::type)0) { + } + + virtual ~Cassandra_execute_cql_query_args() throw() {} + + std::string query; + Compression::type compression; + + void __set_query(const std::string& val) { + query = val; + } + + void __set_compression(const Compression::type val) { + compression = val; + } + + bool operator == (const Cassandra_execute_cql_query_args & rhs) const + { + if (!(query == rhs.query)) + return false; + if (!(compression == rhs.compression)) + return false; + return true; + } + bool operator != (const Cassandra_execute_cql_query_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_execute_cql_query_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_execute_cql_query_pargs { + public: + + + virtual ~Cassandra_execute_cql_query_pargs() throw() {} + + const std::string* query; + const Compression::type* compression; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_execute_cql_query_result__isset { + _Cassandra_execute_cql_query_result__isset() : success(false), ire(false), ue(false), te(false), sde(false) {} + bool success; + bool ire; + bool ue; + bool te; + bool sde; +} _Cassandra_execute_cql_query_result__isset; + +class Cassandra_execute_cql_query_result { + public: + + Cassandra_execute_cql_query_result() { + } + + virtual ~Cassandra_execute_cql_query_result() throw() {} + + CqlResult success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + SchemaDisagreementException sde; + + _Cassandra_execute_cql_query_result__isset __isset; + + void __set_success(const CqlResult& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_execute_cql_query_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_execute_cql_query_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_execute_cql_query_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_execute_cql_query_presult__isset { + _Cassandra_execute_cql_query_presult__isset() : success(false), ire(false), ue(false), te(false), sde(false) {} + bool success; + bool ire; + bool ue; + bool te; + bool sde; +} _Cassandra_execute_cql_query_presult__isset; + +class Cassandra_execute_cql_query_presult { + public: + + + virtual ~Cassandra_execute_cql_query_presult() throw() {} + + CqlResult* success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + SchemaDisagreementException sde; + + _Cassandra_execute_cql_query_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_prepare_cql_query_args { + public: + + Cassandra_prepare_cql_query_args() : query(""), compression((Compression::type)0) { + } + + virtual ~Cassandra_prepare_cql_query_args() throw() {} + + std::string query; + Compression::type compression; + + void __set_query(const std::string& val) { + query = val; + } + + void __set_compression(const Compression::type val) { + compression = val; + } + + bool operator == (const Cassandra_prepare_cql_query_args & rhs) const + { + if (!(query == rhs.query)) + return false; + if (!(compression == rhs.compression)) + return false; + return true; + } + bool operator != (const Cassandra_prepare_cql_query_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_prepare_cql_query_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_prepare_cql_query_pargs { + public: + + + virtual ~Cassandra_prepare_cql_query_pargs() throw() {} + + const std::string* query; + const Compression::type* compression; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_prepare_cql_query_result__isset { + _Cassandra_prepare_cql_query_result__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_prepare_cql_query_result__isset; + +class Cassandra_prepare_cql_query_result { + public: + + Cassandra_prepare_cql_query_result() { + } + + virtual ~Cassandra_prepare_cql_query_result() throw() {} + + CqlPreparedResult success; + InvalidRequestException ire; + + _Cassandra_prepare_cql_query_result__isset __isset; + + void __set_success(const CqlPreparedResult& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_prepare_cql_query_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_prepare_cql_query_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_prepare_cql_query_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_prepare_cql_query_presult__isset { + _Cassandra_prepare_cql_query_presult__isset() : success(false), ire(false) {} + bool success; + bool ire; +} _Cassandra_prepare_cql_query_presult__isset; + +class Cassandra_prepare_cql_query_presult { + public: + + + virtual ~Cassandra_prepare_cql_query_presult() throw() {} + + CqlPreparedResult* success; + InvalidRequestException ire; + + _Cassandra_prepare_cql_query_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_execute_prepared_cql_query_args { + public: + + Cassandra_execute_prepared_cql_query_args() : itemId(0) { + } + + virtual ~Cassandra_execute_prepared_cql_query_args() throw() {} + + int32_t itemId; + std::vector<std::string> values; + + void __set_itemId(const int32_t val) { + itemId = val; + } + + void __set_values(const std::vector<std::string> & val) { + values = val; + } + + bool operator == (const Cassandra_execute_prepared_cql_query_args & rhs) const + { + if (!(itemId == rhs.itemId)) + return false; + if (!(values == rhs.values)) + return false; + return true; + } + bool operator != (const Cassandra_execute_prepared_cql_query_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_execute_prepared_cql_query_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_execute_prepared_cql_query_pargs { + public: + + + virtual ~Cassandra_execute_prepared_cql_query_pargs() throw() {} + + const int32_t* itemId; + const std::vector<std::string> * values; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_execute_prepared_cql_query_result__isset { + _Cassandra_execute_prepared_cql_query_result__isset() : success(false), ire(false), ue(false), te(false), sde(false) {} + bool success; + bool ire; + bool ue; + bool te; + bool sde; +} _Cassandra_execute_prepared_cql_query_result__isset; + +class Cassandra_execute_prepared_cql_query_result { + public: + + Cassandra_execute_prepared_cql_query_result() { + } + + virtual ~Cassandra_execute_prepared_cql_query_result() throw() {} + + CqlResult success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + SchemaDisagreementException sde; + + _Cassandra_execute_prepared_cql_query_result__isset __isset; + + void __set_success(const CqlResult& val) { + success = val; + } + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + void __set_ue(const UnavailableException& val) { + ue = val; + } + + void __set_te(const TimedOutException& val) { + te = val; + } + + void __set_sde(const SchemaDisagreementException& val) { + sde = val; + } + + bool operator == (const Cassandra_execute_prepared_cql_query_result & rhs) const + { + if (!(success == rhs.success)) + return false; + if (!(ire == rhs.ire)) + return false; + if (!(ue == rhs.ue)) + return false; + if (!(te == rhs.te)) + return false; + if (!(sde == rhs.sde)) + return false; + return true; + } + bool operator != (const Cassandra_execute_prepared_cql_query_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_execute_prepared_cql_query_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_execute_prepared_cql_query_presult__isset { + _Cassandra_execute_prepared_cql_query_presult__isset() : success(false), ire(false), ue(false), te(false), sde(false) {} + bool success; + bool ire; + bool ue; + bool te; + bool sde; +} _Cassandra_execute_prepared_cql_query_presult__isset; + +class Cassandra_execute_prepared_cql_query_presult { + public: + + + virtual ~Cassandra_execute_prepared_cql_query_presult() throw() {} + + CqlResult* success; + InvalidRequestException ire; + UnavailableException ue; + TimedOutException te; + SchemaDisagreementException sde; + + _Cassandra_execute_prepared_cql_query_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + + +class Cassandra_set_cql_version_args { + public: + + Cassandra_set_cql_version_args() : version("") { + } + + virtual ~Cassandra_set_cql_version_args() throw() {} + + std::string version; + + void __set_version(const std::string& val) { + version = val; + } + + bool operator == (const Cassandra_set_cql_version_args & rhs) const + { + if (!(version == rhs.version)) + return false; + return true; + } + bool operator != (const Cassandra_set_cql_version_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_set_cql_version_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class Cassandra_set_cql_version_pargs { + public: + + + virtual ~Cassandra_set_cql_version_pargs() throw() {} + + const std::string* version; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_set_cql_version_result__isset { + _Cassandra_set_cql_version_result__isset() : ire(false) {} + bool ire; +} _Cassandra_set_cql_version_result__isset; + +class Cassandra_set_cql_version_result { + public: + + Cassandra_set_cql_version_result() { + } + + virtual ~Cassandra_set_cql_version_result() throw() {} + + InvalidRequestException ire; + + _Cassandra_set_cql_version_result__isset __isset; + + void __set_ire(const InvalidRequestException& val) { + ire = val; + } + + bool operator == (const Cassandra_set_cql_version_result & rhs) const + { + if (!(ire == rhs.ire)) + return false; + return true; + } + bool operator != (const Cassandra_set_cql_version_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Cassandra_set_cql_version_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Cassandra_set_cql_version_presult__isset { + _Cassandra_set_cql_version_presult__isset() : ire(false) {} + bool ire; +} _Cassandra_set_cql_version_presult__isset; + +class Cassandra_set_cql_version_presult { + public: + + + virtual ~Cassandra_set_cql_version_presult() throw() {} + + InvalidRequestException ire; + + _Cassandra_set_cql_version_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +class CassandraClient : virtual public CassandraIf { + public: + CassandraClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) : + piprot_(prot), + poprot_(prot) { + iprot_ = prot.get(); + oprot_ = prot.get(); + } + CassandraClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) : + piprot_(iprot), + poprot_(oprot) { + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + void login(const AuthenticationRequest& auth_request); + void send_login(const AuthenticationRequest& auth_request); + void recv_login(); + void set_keyspace(const std::string& keyspace); + void send_set_keyspace(const std::string& keyspace); + void recv_set_keyspace(); + void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level); + void send_get(const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level); + void recv_get(ColumnOrSuperColumn& _return); + void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + void send_get_slice(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + void recv_get_slice(std::vector<ColumnOrSuperColumn> & _return); + int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + void send_get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + int32_t recv_get_count(); + void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + void send_multiget_slice(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + void recv_multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return); + void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + void send_multiget_count(const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level); + void recv_multiget_count(std::map<std::string, int32_t> & _return); + void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level); + void send_get_range_slices(const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level); + void recv_get_range_slices(std::vector<KeySlice> & _return); + void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level); + void send_get_paged_slice(const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level); + void recv_get_paged_slice(std::vector<KeySlice> & _return); + void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level); + void send_get_indexed_slices(const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level); + void recv_get_indexed_slices(std::vector<KeySlice> & _return); + void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level); + void send_insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level); + void recv_insert(); + void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level); + void send_add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level); + void recv_add(); + void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level); + void send_remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level); + void recv_remove(); + void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level); + void send_remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level); + void recv_remove_counter(); + void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level); + void send_batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level); + void recv_batch_mutate(); + void truncate(const std::string& cfname); + void send_truncate(const std::string& cfname); + void recv_truncate(); + void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return); + void send_describe_schema_versions(); + void recv_describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return); + void describe_keyspaces(std::vector<KsDef> & _return); + void send_describe_keyspaces(); + void recv_describe_keyspaces(std::vector<KsDef> & _return); + void describe_cluster_name(std::string& _return); + void send_describe_cluster_name(); + void recv_describe_cluster_name(std::string& _return); + void describe_version(std::string& _return); + void send_describe_version(); + void recv_describe_version(std::string& _return); + void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace); + void send_describe_ring(const std::string& keyspace); + void recv_describe_ring(std::vector<TokenRange> & _return); + void describe_token_map(std::map<std::string, std::string> & _return); + void send_describe_token_map(); + void recv_describe_token_map(std::map<std::string, std::string> & _return); + void describe_partitioner(std::string& _return); + void send_describe_partitioner(); + void recv_describe_partitioner(std::string& _return); + void describe_snitch(std::string& _return); + void send_describe_snitch(); + void recv_describe_snitch(std::string& _return); + void describe_keyspace(KsDef& _return, const std::string& keyspace); + void send_describe_keyspace(const std::string& keyspace); + void recv_describe_keyspace(KsDef& _return); + void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split); + void send_describe_splits(const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split); + void recv_describe_splits(std::vector<std::string> & _return); + void system_add_column_family(std::string& _return, const CfDef& cf_def); + void send_system_add_column_family(const CfDef& cf_def); + void recv_system_add_column_family(std::string& _return); + void system_drop_column_family(std::string& _return, const std::string& column_family); + void send_system_drop_column_family(const std::string& column_family); + void recv_system_drop_column_family(std::string& _return); + void system_add_keyspace(std::string& _return, const KsDef& ks_def); + void send_system_add_keyspace(const KsDef& ks_def); + void recv_system_add_keyspace(std::string& _return); + void system_drop_keyspace(std::string& _return, const std::string& keyspace); + void send_system_drop_keyspace(const std::string& keyspace); + void recv_system_drop_keyspace(std::string& _return); + void system_update_keyspace(std::string& _return, const KsDef& ks_def); + void send_system_update_keyspace(const KsDef& ks_def); + void recv_system_update_keyspace(std::string& _return); + void system_update_column_family(std::string& _return, const CfDef& cf_def); + void send_system_update_column_family(const CfDef& cf_def); + void recv_system_update_column_family(std::string& _return); + void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression); + void send_execute_cql_query(const std::string& query, const Compression::type compression); + void recv_execute_cql_query(CqlResult& _return); + void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression); + void send_prepare_cql_query(const std::string& query, const Compression::type compression); + void recv_prepare_cql_query(CqlPreparedResult& _return); + void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values); + void send_execute_prepared_cql_query(const int32_t itemId, const std::vector<std::string> & values); + void recv_execute_prepared_cql_query(CqlResult& _return); + void set_cql_version(const std::string& version); + void send_set_cql_version(const std::string& version); + void recv_set_cql_version(); + protected: + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; +}; + +class CassandraProcessor : public ::apache::thrift::TProcessor { + protected: + boost::shared_ptr<CassandraIf> iface_; + virtual bool process_fn(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid, void* callContext); + private: + std::map<std::string, void (CassandraProcessor::*)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*)> processMap_; + void process_login(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_multiget_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_multiget_count(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_range_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_paged_slice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_get_indexed_slices(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_insert(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_add(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_remove(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_remove_counter(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_batch_mutate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_truncate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_schema_versions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_keyspaces(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_cluster_name(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_ring(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_token_map(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_partitioner(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_snitch(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_describe_splits(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_add_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_drop_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_add_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_drop_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_update_keyspace(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_system_update_column_family(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_execute_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_prepare_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_execute_prepared_cql_query(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_set_cql_version(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + public: + CassandraProcessor(boost::shared_ptr<CassandraIf> iface) : + iface_(iface) { + processMap_["login"] = &CassandraProcessor::process_login; + processMap_["set_keyspace"] = &CassandraProcessor::process_set_keyspace; + processMap_["get"] = &CassandraProcessor::process_get; + processMap_["get_slice"] = &CassandraProcessor::process_get_slice; + processMap_["get_count"] = &CassandraProcessor::process_get_count; + processMap_["multiget_slice"] = &CassandraProcessor::process_multiget_slice; + processMap_["multiget_count"] = &CassandraProcessor::process_multiget_count; + processMap_["get_range_slices"] = &CassandraProcessor::process_get_range_slices; + processMap_["get_paged_slice"] = &CassandraProcessor::process_get_paged_slice; + processMap_["get_indexed_slices"] = &CassandraProcessor::process_get_indexed_slices; + processMap_["insert"] = &CassandraProcessor::process_insert; + processMap_["add"] = &CassandraProcessor::process_add; + processMap_["remove"] = &CassandraProcessor::process_remove; + processMap_["remove_counter"] = &CassandraProcessor::process_remove_counter; + processMap_["batch_mutate"] = &CassandraProcessor::process_batch_mutate; + processMap_["truncate"] = &CassandraProcessor::process_truncate; + processMap_["describe_schema_versions"] = &CassandraProcessor::process_describe_schema_versions; + processMap_["describe_keyspaces"] = &CassandraProcessor::process_describe_keyspaces; + processMap_["describe_cluster_name"] = &CassandraProcessor::process_describe_cluster_name; + processMap_["describe_version"] = &CassandraProcessor::process_describe_version; + processMap_["describe_ring"] = &CassandraProcessor::process_describe_ring; + processMap_["describe_token_map"] = &CassandraProcessor::process_describe_token_map; + processMap_["describe_partitioner"] = &CassandraProcessor::process_describe_partitioner; + processMap_["describe_snitch"] = &CassandraProcessor::process_describe_snitch; + processMap_["describe_keyspace"] = &CassandraProcessor::process_describe_keyspace; + processMap_["describe_splits"] = &CassandraProcessor::process_describe_splits; + processMap_["system_add_column_family"] = &CassandraProcessor::process_system_add_column_family; + processMap_["system_drop_column_family"] = &CassandraProcessor::process_system_drop_column_family; + processMap_["system_add_keyspace"] = &CassandraProcessor::process_system_add_keyspace; + processMap_["system_drop_keyspace"] = &CassandraProcessor::process_system_drop_keyspace; + processMap_["system_update_keyspace"] = &CassandraProcessor::process_system_update_keyspace; + processMap_["system_update_column_family"] = &CassandraProcessor::process_system_update_column_family; + processMap_["execute_cql_query"] = &CassandraProcessor::process_execute_cql_query; + processMap_["prepare_cql_query"] = &CassandraProcessor::process_prepare_cql_query; + processMap_["execute_prepared_cql_query"] = &CassandraProcessor::process_execute_prepared_cql_query; + processMap_["set_cql_version"] = &CassandraProcessor::process_set_cql_version; + } + + virtual bool process(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot, void* callContext); + virtual ~CassandraProcessor() {} +}; + +class CassandraProcessorFactory : public ::apache::thrift::TProcessorFactory { + public: + CassandraProcessorFactory(const ::boost::shared_ptr< CassandraIfFactory >& handlerFactory) : + handlerFactory_(handlerFactory) {} + + ::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); + + protected: + ::boost::shared_ptr< CassandraIfFactory > handlerFactory_; +}; + +class CassandraMultiface : virtual public CassandraIf { + public: + CassandraMultiface(std::vector<boost::shared_ptr<CassandraIf> >& ifaces) : ifaces_(ifaces) { + } + virtual ~CassandraMultiface() {} + protected: + std::vector<boost::shared_ptr<CassandraIf> > ifaces_; + CassandraMultiface() {} + void add(boost::shared_ptr<CassandraIf> iface) { + ifaces_.push_back(iface); + } + public: + void login(const AuthenticationRequest& auth_request) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->login(auth_request); + } + } + + void set_keyspace(const std::string& keyspace) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->set_keyspace(keyspace); + } + } + + void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get(_return, key, column_path, consistency_level); + return; + } else { + ifaces_[i]->get(_return, key, column_path, consistency_level); + } + } + } + + void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get_slice(_return, key, column_parent, predicate, consistency_level); + return; + } else { + ifaces_[i]->get_slice(_return, key, column_parent, predicate, consistency_level); + } + } + } + + int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + return ifaces_[i]->get_count(key, column_parent, predicate, consistency_level); + } else { + ifaces_[i]->get_count(key, column_parent, predicate, consistency_level); + } + } + return 0xDEADBEEF; //psergey: shut up the compiler + } + + void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->multiget_slice(_return, keys, column_parent, predicate, consistency_level); + return; + } else { + ifaces_[i]->multiget_slice(_return, keys, column_parent, predicate, consistency_level); + } + } + } + + void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->multiget_count(_return, keys, column_parent, predicate, consistency_level); + return; + } else { + ifaces_[i]->multiget_count(_return, keys, column_parent, predicate, consistency_level); + } + } + } + + void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get_range_slices(_return, column_parent, predicate, range, consistency_level); + return; + } else { + ifaces_[i]->get_range_slices(_return, column_parent, predicate, range, consistency_level); + } + } + } + + void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get_paged_slice(_return, column_family, range, start_column, consistency_level); + return; + } else { + ifaces_[i]->get_paged_slice(_return, column_family, range, start_column, consistency_level); + } + } + } + + void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->get_indexed_slices(_return, column_parent, index_clause, column_predicate, consistency_level); + return; + } else { + ifaces_[i]->get_indexed_slices(_return, column_parent, index_clause, column_predicate, consistency_level); + } + } + } + + void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->insert(key, column_parent, column, consistency_level); + } + } + + void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->add(key, column_parent, column, consistency_level); + } + } + + void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->remove(key, column_path, timestamp, consistency_level); + } + } + + void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->remove_counter(key, path, consistency_level); + } + } + + void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->batch_mutate(mutation_map, consistency_level); + } + } + + void truncate(const std::string& cfname) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->truncate(cfname); + } + } + + void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_schema_versions(_return); + return; + } else { + ifaces_[i]->describe_schema_versions(_return); + } + } + } + + void describe_keyspaces(std::vector<KsDef> & _return) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_keyspaces(_return); + return; + } else { + ifaces_[i]->describe_keyspaces(_return); + } + } + } + + void describe_cluster_name(std::string& _return) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_cluster_name(_return); + return; + } else { + ifaces_[i]->describe_cluster_name(_return); + } + } + } + + void describe_version(std::string& _return) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_version(_return); + return; + } else { + ifaces_[i]->describe_version(_return); + } + } + } + + void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_ring(_return, keyspace); + return; + } else { + ifaces_[i]->describe_ring(_return, keyspace); + } + } + } + + void describe_token_map(std::map<std::string, std::string> & _return) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_token_map(_return); + return; + } else { + ifaces_[i]->describe_token_map(_return); + } + } + } + + void describe_partitioner(std::string& _return) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_partitioner(_return); + return; + } else { + ifaces_[i]->describe_partitioner(_return); + } + } + } + + void describe_snitch(std::string& _return) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_snitch(_return); + return; + } else { + ifaces_[i]->describe_snitch(_return); + } + } + } + + void describe_keyspace(KsDef& _return, const std::string& keyspace) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_keyspace(_return, keyspace); + return; + } else { + ifaces_[i]->describe_keyspace(_return, keyspace); + } + } + } + + void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->describe_splits(_return, cfName, start_token, end_token, keys_per_split); + return; + } else { + ifaces_[i]->describe_splits(_return, cfName, start_token, end_token, keys_per_split); + } + } + } + + void system_add_column_family(std::string& _return, const CfDef& cf_def) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->system_add_column_family(_return, cf_def); + return; + } else { + ifaces_[i]->system_add_column_family(_return, cf_def); + } + } + } + + void system_drop_column_family(std::string& _return, const std::string& column_family) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->system_drop_column_family(_return, column_family); + return; + } else { + ifaces_[i]->system_drop_column_family(_return, column_family); + } + } + } + + void system_add_keyspace(std::string& _return, const KsDef& ks_def) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->system_add_keyspace(_return, ks_def); + return; + } else { + ifaces_[i]->system_add_keyspace(_return, ks_def); + } + } + } + + void system_drop_keyspace(std::string& _return, const std::string& keyspace) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->system_drop_keyspace(_return, keyspace); + return; + } else { + ifaces_[i]->system_drop_keyspace(_return, keyspace); + } + } + } + + void system_update_keyspace(std::string& _return, const KsDef& ks_def) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->system_update_keyspace(_return, ks_def); + return; + } else { + ifaces_[i]->system_update_keyspace(_return, ks_def); + } + } + } + + void system_update_column_family(std::string& _return, const CfDef& cf_def) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->system_update_column_family(_return, cf_def); + return; + } else { + ifaces_[i]->system_update_column_family(_return, cf_def); + } + } + } + + void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->execute_cql_query(_return, query, compression); + return; + } else { + ifaces_[i]->execute_cql_query(_return, query, compression); + } + } + } + + void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->prepare_cql_query(_return, query, compression); + return; + } else { + ifaces_[i]->prepare_cql_query(_return, query, compression); + } + } + } + + void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + if (i == sz - 1) { + ifaces_[i]->execute_prepared_cql_query(_return, itemId, values); + return; + } else { + ifaces_[i]->execute_prepared_cql_query(_return, itemId, values); + } + } + } + + void set_cql_version(const std::string& version) { + size_t sz = ifaces_.size(); + for (size_t i = 0; i < sz; ++i) { + ifaces_[i]->set_cql_version(version); + } + } + +}; + +}}} // namespace + +#endif diff --git a/storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp b/storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp new file mode 100644 index 00000000000..4d4e489ef4d --- /dev/null +++ b/storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp @@ -0,0 +1,219 @@ +// This autogenerated skeleton file illustrates how to build a server. +// You should copy it to another filename to avoid overwriting it. + +#include "Cassandra.h" +#include <protocol/TBinaryProtocol.h> +#include <server/TSimpleServer.h> +#include <transport/TServerSocket.h> +#include <transport/TBufferTransports.h> + +using namespace ::apache::thrift; +using namespace ::apache::thrift::protocol; +using namespace ::apache::thrift::transport; +using namespace ::apache::thrift::server; + +using boost::shared_ptr; + +using namespace ::org::apache::cassandra; + +class CassandraHandler : virtual public CassandraIf { + public: + CassandraHandler() { + // Your initialization goes here + } + + void login(const AuthenticationRequest& auth_request) { + // Your implementation goes here + printf("login\n"); + } + + void set_keyspace(const std::string& keyspace) { + // Your implementation goes here + printf("set_keyspace\n"); + } + + void get(ColumnOrSuperColumn& _return, const std::string& key, const ColumnPath& column_path, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("get\n"); + } + + void get_slice(std::vector<ColumnOrSuperColumn> & _return, const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("get_slice\n"); + } + + int32_t get_count(const std::string& key, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("get_count\n"); + } + + void multiget_slice(std::map<std::string, std::vector<ColumnOrSuperColumn> > & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("multiget_slice\n"); + } + + void multiget_count(std::map<std::string, int32_t> & _return, const std::vector<std::string> & keys, const ColumnParent& column_parent, const SlicePredicate& predicate, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("multiget_count\n"); + } + + void get_range_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const SlicePredicate& predicate, const KeyRange& range, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("get_range_slices\n"); + } + + void get_paged_slice(std::vector<KeySlice> & _return, const std::string& column_family, const KeyRange& range, const std::string& start_column, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("get_paged_slice\n"); + } + + void get_indexed_slices(std::vector<KeySlice> & _return, const ColumnParent& column_parent, const IndexClause& index_clause, const SlicePredicate& column_predicate, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("get_indexed_slices\n"); + } + + void insert(const std::string& key, const ColumnParent& column_parent, const Column& column, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("insert\n"); + } + + void add(const std::string& key, const ColumnParent& column_parent, const CounterColumn& column, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("add\n"); + } + + void remove(const std::string& key, const ColumnPath& column_path, const int64_t timestamp, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("remove\n"); + } + + void remove_counter(const std::string& key, const ColumnPath& path, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("remove_counter\n"); + } + + void batch_mutate(const std::map<std::string, std::map<std::string, std::vector<Mutation> > > & mutation_map, const ConsistencyLevel::type consistency_level) { + // Your implementation goes here + printf("batch_mutate\n"); + } + + void truncate(const std::string& cfname) { + // Your implementation goes here + printf("truncate\n"); + } + + void describe_schema_versions(std::map<std::string, std::vector<std::string> > & _return) { + // Your implementation goes here + printf("describe_schema_versions\n"); + } + + void describe_keyspaces(std::vector<KsDef> & _return) { + // Your implementation goes here + printf("describe_keyspaces\n"); + } + + void describe_cluster_name(std::string& _return) { + // Your implementation goes here + printf("describe_cluster_name\n"); + } + + void describe_version(std::string& _return) { + // Your implementation goes here + printf("describe_version\n"); + } + + void describe_ring(std::vector<TokenRange> & _return, const std::string& keyspace) { + // Your implementation goes here + printf("describe_ring\n"); + } + + void describe_token_map(std::map<std::string, std::string> & _return) { + // Your implementation goes here + printf("describe_token_map\n"); + } + + void describe_partitioner(std::string& _return) { + // Your implementation goes here + printf("describe_partitioner\n"); + } + + void describe_snitch(std::string& _return) { + // Your implementation goes here + printf("describe_snitch\n"); + } + + void describe_keyspace(KsDef& _return, const std::string& keyspace) { + // Your implementation goes here + printf("describe_keyspace\n"); + } + + void describe_splits(std::vector<std::string> & _return, const std::string& cfName, const std::string& start_token, const std::string& end_token, const int32_t keys_per_split) { + // Your implementation goes here + printf("describe_splits\n"); + } + + void system_add_column_family(std::string& _return, const CfDef& cf_def) { + // Your implementation goes here + printf("system_add_column_family\n"); + } + + void system_drop_column_family(std::string& _return, const std::string& column_family) { + // Your implementation goes here + printf("system_drop_column_family\n"); + } + + void system_add_keyspace(std::string& _return, const KsDef& ks_def) { + // Your implementation goes here + printf("system_add_keyspace\n"); + } + + void system_drop_keyspace(std::string& _return, const std::string& keyspace) { + // Your implementation goes here + printf("system_drop_keyspace\n"); + } + + void system_update_keyspace(std::string& _return, const KsDef& ks_def) { + // Your implementation goes here + printf("system_update_keyspace\n"); + } + + void system_update_column_family(std::string& _return, const CfDef& cf_def) { + // Your implementation goes here + printf("system_update_column_family\n"); + } + + void execute_cql_query(CqlResult& _return, const std::string& query, const Compression::type compression) { + // Your implementation goes here + printf("execute_cql_query\n"); + } + + void prepare_cql_query(CqlPreparedResult& _return, const std::string& query, const Compression::type compression) { + // Your implementation goes here + printf("prepare_cql_query\n"); + } + + void execute_prepared_cql_query(CqlResult& _return, const int32_t itemId, const std::vector<std::string> & values) { + // Your implementation goes here + printf("execute_prepared_cql_query\n"); + } + + void set_cql_version(const std::string& version) { + // Your implementation goes here + printf("set_cql_version\n"); + } + +}; + +int main(int argc, char **argv) { + int port = 9090; + shared_ptr<CassandraHandler> handler(new CassandraHandler()); + shared_ptr<TProcessor> processor(new CassandraProcessor(handler)); + shared_ptr<TServerTransport> serverTransport(new TServerSocket(port)); + shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory()); + shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory()); + + TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); + server.serve(); + return 0; +} + diff --git a/storage/cassandra/gen-cpp/cassandra_constants.cpp b/storage/cassandra/gen-cpp/cassandra_constants.cpp new file mode 100644 index 00000000000..49a01d2773e --- /dev/null +++ b/storage/cassandra/gen-cpp/cassandra_constants.cpp @@ -0,0 +1,18 @@ +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "cassandra_constants.h" + +namespace org { namespace apache { namespace cassandra { + +const cassandraConstants g_cassandra_constants; + +cassandraConstants::cassandraConstants() { + cassandra_const_VERSION = (char *)"19.32.0"; +} + +}}} // namespace + diff --git a/storage/cassandra/gen-cpp/cassandra_constants.h b/storage/cassandra/gen-cpp/cassandra_constants.h new file mode 100644 index 00000000000..fa12a1676ae --- /dev/null +++ b/storage/cassandra/gen-cpp/cassandra_constants.h @@ -0,0 +1,26 @@ +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef cassandra_CONSTANTS_H +#define cassandra_CONSTANTS_H + +#include "cassandra_types.h" + +namespace org { namespace apache { namespace cassandra { + +class cassandraConstants { + public: + cassandraConstants(); + +// std::string VERSION; + char* cassandra_const_VERSION; +}; + +extern const cassandraConstants g_cassandra_constants; + +}}} // namespace + +#endif diff --git a/storage/cassandra/gen-cpp/cassandra_types.cpp b/storage/cassandra/gen-cpp/cassandra_types.cpp new file mode 100644 index 00000000000..4b51c21a320 --- /dev/null +++ b/storage/cassandra/gen-cpp/cassandra_types.cpp @@ -0,0 +1,3512 @@ +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "cassandra_types.h" + +namespace org { namespace apache { namespace cassandra { + +int _kConsistencyLevelValues[] = { + ConsistencyLevel::ONE, + ConsistencyLevel::QUORUM, + ConsistencyLevel::LOCAL_QUORUM, + ConsistencyLevel::EACH_QUORUM, + ConsistencyLevel::ALL, + ConsistencyLevel::ANY, + ConsistencyLevel::TWO, + ConsistencyLevel::THREE +}; +const char* _kConsistencyLevelNames[] = { + "ONE", + "QUORUM", + "LOCAL_QUORUM", + "EACH_QUORUM", + "ALL", + "ANY", + "TWO", + "THREE" +}; +const std::map<int, const char*> _ConsistencyLevel_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(8, _kConsistencyLevelValues, _kConsistencyLevelNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +int _kIndexOperatorValues[] = { + IndexOperator::EQ, + IndexOperator::GTE, + IndexOperator::GT, + IndexOperator::LTE, + IndexOperator::LT +}; +const char* _kIndexOperatorNames[] = { + "EQ", + "GTE", + "GT", + "LTE", + "LT" +}; +const std::map<int, const char*> _IndexOperator_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kIndexOperatorValues, _kIndexOperatorNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +int _kIndexTypeValues[] = { + IndexType::KEYS, + IndexType::CUSTOM +}; +const char* _kIndexTypeNames[] = { + "KEYS", + "CUSTOM" +}; +const std::map<int, const char*> _IndexType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kIndexTypeValues, _kIndexTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +int _kCompressionValues[] = { + Compression::GZIP, + Compression::NONE +}; +const char* _kCompressionNames[] = { + "GZIP", + "NONE" +}; +const std::map<int, const char*> _Compression_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kCompressionValues, _kCompressionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +int _kCqlResultTypeValues[] = { + CqlResultType::ROWS, + CqlResultType::VOID, + CqlResultType::INT +}; +const char* _kCqlResultTypeNames[] = { + "ROWS", + "VOID", + "INT" +}; +const std::map<int, const char*> _CqlResultType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kCqlResultTypeValues, _kCqlResultTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +const char* Column::ascii_fingerprint = "3EE0E1C5C844001B62F08125068292CC"; +const uint8_t Column::binary_fingerprint[16] = {0x3E,0xE0,0xE1,0xC5,0xC8,0x44,0x00,0x1B,0x62,0xF0,0x81,0x25,0x06,0x82,0x92,0xCC}; + +uint32_t Column::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->timestamp); + this->__isset.timestamp = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->ttl); + this->__isset.ttl = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t Column::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Column"); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->name); + xfer += oprot->writeFieldEnd(); + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->value); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.timestamp) { + xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->timestamp); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.ttl) { + xfer += oprot->writeFieldBegin("ttl", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->ttl); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* SuperColumn::ascii_fingerprint = "470EFC558004E98D92D604898305C04E"; +const uint8_t SuperColumn::binary_fingerprint[16] = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E}; + +uint32_t SuperColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + bool isset_columns = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->columns.clear(); + uint32_t _size0; + ::apache::thrift::protocol::TType _etype3; + iprot->readListBegin(_etype3, _size0); + this->columns.resize(_size0); + uint32_t _i4; + for (_i4 = 0; _i4 < _size0; ++_i4) + { + xfer += this->columns[_i4].read(iprot); + } + iprot->readListEnd(); + } + isset_columns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_columns) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t SuperColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("SuperColumn"); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size())); + std::vector<Column> ::const_iterator _iter5; + for (_iter5 = this->columns.begin(); _iter5 != this->columns.end(); ++_iter5) + { + xfer += (*_iter5).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* CounterColumn::ascii_fingerprint = "1CCCF6FC31CFD1D61BBBB1BAF3590620"; +const uint8_t CounterColumn::binary_fingerprint[16] = {0x1C,0xCC,0xF6,0xFC,0x31,0xCF,0xD1,0xD6,0x1B,0xBB,0xB1,0xBA,0xF3,0x59,0x06,0x20}; + +uint32_t CounterColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + bool isset_value = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->value); + isset_value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_value) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CounterColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("CounterColumn"); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I64, 2); + xfer += oprot->writeI64(this->value); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* CounterSuperColumn::ascii_fingerprint = "CD4C8C4BF7753E46DE417CDE369343A4"; +const uint8_t CounterSuperColumn::binary_fingerprint[16] = {0xCD,0x4C,0x8C,0x4B,0xF7,0x75,0x3E,0x46,0xDE,0x41,0x7C,0xDE,0x36,0x93,0x43,0xA4}; + +uint32_t CounterSuperColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + bool isset_columns = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->columns.clear(); + uint32_t _size6; + ::apache::thrift::protocol::TType _etype9; + iprot->readListBegin(_etype9, _size6); + this->columns.resize(_size6); + uint32_t _i10; + for (_i10 = 0; _i10 < _size6; ++_i10) + { + xfer += this->columns[_i10].read(iprot); + } + iprot->readListEnd(); + } + isset_columns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_columns) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CounterSuperColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("CounterSuperColumn"); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size())); + std::vector<CounterColumn> ::const_iterator _iter11; + for (_iter11 = this->columns.begin(); _iter11 != this->columns.end(); ++_iter11) + { + xfer += (*_iter11).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* ColumnOrSuperColumn::ascii_fingerprint = "2B34AC9E80F1DAA3A2A63B1AB1841E61"; +const uint8_t ColumnOrSuperColumn::binary_fingerprint[16] = {0x2B,0x34,0xAC,0x9E,0x80,0xF1,0xDA,0xA3,0xA2,0xA6,0x3B,0x1A,0xB1,0x84,0x1E,0x61}; + +uint32_t ColumnOrSuperColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column.read(iprot); + this->__isset.column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->super_column.read(iprot); + this->__isset.super_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->counter_column.read(iprot); + this->__isset.counter_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->counter_super_column.read(iprot); + this->__isset.counter_super_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ColumnOrSuperColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ColumnOrSuperColumn"); + if (this->__isset.column) { + xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->column.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.super_column) { + xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->super_column.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.counter_column) { + xfer += oprot->writeFieldBegin("counter_column", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->counter_column.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.counter_super_column) { + xfer += oprot->writeFieldBegin("counter_super_column", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->counter_super_column.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* NotFoundException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B"; +const uint8_t NotFoundException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + +uint32_t NotFoundException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t NotFoundException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("NotFoundException"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* InvalidRequestException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1"; +const uint8_t InvalidRequestException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + +uint32_t InvalidRequestException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_why = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->why); + isset_why = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_why) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t InvalidRequestException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("InvalidRequestException"); + xfer += oprot->writeFieldBegin("why", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->why); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* UnavailableException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B"; +const uint8_t UnavailableException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + +uint32_t UnavailableException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t UnavailableException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("UnavailableException"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* TimedOutException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B"; +const uint8_t TimedOutException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + +uint32_t TimedOutException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TimedOutException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TimedOutException"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* AuthenticationException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1"; +const uint8_t AuthenticationException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + +uint32_t AuthenticationException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_why = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->why); + isset_why = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_why) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AuthenticationException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("AuthenticationException"); + xfer += oprot->writeFieldBegin("why", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->why); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* AuthorizationException::ascii_fingerprint = "EFB929595D312AC8F305D5A794CFEDA1"; +const uint8_t AuthorizationException::binary_fingerprint[16] = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + +uint32_t AuthorizationException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_why = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->why); + isset_why = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_why) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AuthorizationException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("AuthorizationException"); + xfer += oprot->writeFieldBegin("why", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->why); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* SchemaDisagreementException::ascii_fingerprint = "99914B932BD37A50B983C5E7C90AE93B"; +const uint8_t SchemaDisagreementException::binary_fingerprint[16] = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + +uint32_t SchemaDisagreementException::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SchemaDisagreementException::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("SchemaDisagreementException"); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* ColumnParent::ascii_fingerprint = "0A13AE61181713A4100DFFB3EC293822"; +const uint8_t ColumnParent::binary_fingerprint[16] = {0x0A,0x13,0xAE,0x61,0x18,0x17,0x13,0xA4,0x10,0x0D,0xFF,0xB3,0xEC,0x29,0x38,0x22}; + +uint32_t ColumnParent::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_column_family = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_family); + isset_column_family = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->super_column); + this->__isset.super_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_column_family) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ColumnParent::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ColumnParent"); + xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->column_family); + xfer += oprot->writeFieldEnd(); + if (this->__isset.super_column) { + xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeBinary(this->super_column); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* ColumnPath::ascii_fingerprint = "606212895BCF63C757913CF35AEB3462"; +const uint8_t ColumnPath::binary_fingerprint[16] = {0x60,0x62,0x12,0x89,0x5B,0xCF,0x63,0xC7,0x57,0x91,0x3C,0xF3,0x5A,0xEB,0x34,0x62}; + +uint32_t ColumnPath::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_column_family = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_family); + isset_column_family = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->super_column); + this->__isset.super_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->column); + this->__isset.column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_column_family) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ColumnPath::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ColumnPath"); + xfer += oprot->writeFieldBegin("column_family", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->column_family); + xfer += oprot->writeFieldEnd(); + if (this->__isset.super_column) { + xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeBinary(this->super_column); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.column) { + xfer += oprot->writeFieldBegin("column", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeBinary(this->column); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* SliceRange::ascii_fingerprint = "184D24C9A0B8D4415E234DB649CAE740"; +const uint8_t SliceRange::binary_fingerprint[16] = {0x18,0x4D,0x24,0xC9,0xA0,0xB8,0xD4,0x41,0x5E,0x23,0x4D,0xB6,0x49,0xCA,0xE7,0x40}; + +uint32_t SliceRange::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_start = false; + bool isset_finish = false; + bool isset_reversed = false; + bool isset_count = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->start); + isset_start = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->finish); + isset_finish = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->reversed); + isset_reversed = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->count); + isset_count = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_start) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_finish) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_reversed) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_count) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t SliceRange::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("SliceRange"); + xfer += oprot->writeFieldBegin("start", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->start); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("finish", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->finish); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("reversed", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->reversed); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->count); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* SlicePredicate::ascii_fingerprint = "F59D1D81C17DFFAF09988BF1C9CE5E27"; +const uint8_t SlicePredicate::binary_fingerprint[16] = {0xF5,0x9D,0x1D,0x81,0xC1,0x7D,0xFF,0xAF,0x09,0x98,0x8B,0xF1,0xC9,0xCE,0x5E,0x27}; + +uint32_t SlicePredicate::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->column_names.clear(); + uint32_t _size12; + ::apache::thrift::protocol::TType _etype15; + iprot->readListBegin(_etype15, _size12); + this->column_names.resize(_size12); + uint32_t _i16; + for (_i16 = 0; _i16 < _size12; ++_i16) + { + xfer += iprot->readBinary(this->column_names[_i16]); + } + iprot->readListEnd(); + } + this->__isset.column_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->slice_range.read(iprot); + this->__isset.slice_range = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t SlicePredicate::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("SlicePredicate"); + if (this->__isset.column_names) { + xfer += oprot->writeFieldBegin("column_names", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->column_names.size())); + std::vector<std::string> ::const_iterator _iter17; + for (_iter17 = this->column_names.begin(); _iter17 != this->column_names.end(); ++_iter17) + { + xfer += oprot->writeBinary((*_iter17)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.slice_range) { + xfer += oprot->writeFieldBegin("slice_range", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->slice_range.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* IndexExpression::ascii_fingerprint = "D9F4CFE2F293A8B1052FD3031DD2C847"; +const uint8_t IndexExpression::binary_fingerprint[16] = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47}; + +uint32_t IndexExpression::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_column_name = false; + bool isset_op = false; + bool isset_value = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->column_name); + isset_column_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast18; + xfer += iprot->readI32(ecast18); + this->op = (IndexOperator::type)ecast18; + isset_op = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->value); + isset_value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_column_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_op) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_value) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t IndexExpression::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("IndexExpression"); + xfer += oprot->writeFieldBegin("column_name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->column_name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("op", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->op); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeBinary(this->value); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* IndexClause::ascii_fingerprint = "9B551B9AB86120B0EEA9005C77FD3C1F"; +const uint8_t IndexClause::binary_fingerprint[16] = {0x9B,0x55,0x1B,0x9A,0xB8,0x61,0x20,0xB0,0xEE,0xA9,0x00,0x5C,0x77,0xFD,0x3C,0x1F}; + +uint32_t IndexClause::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_expressions = false; + bool isset_start_key = false; + bool isset_count = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->expressions.clear(); + uint32_t _size19; + ::apache::thrift::protocol::TType _etype22; + iprot->readListBegin(_etype22, _size19); + this->expressions.resize(_size19); + uint32_t _i23; + for (_i23 = 0; _i23 < _size19; ++_i23) + { + xfer += this->expressions[_i23].read(iprot); + } + iprot->readListEnd(); + } + isset_expressions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->start_key); + isset_start_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->count); + isset_count = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_expressions) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_start_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_count) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t IndexClause::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("IndexClause"); + xfer += oprot->writeFieldBegin("expressions", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->expressions.size())); + std::vector<IndexExpression> ::const_iterator _iter24; + for (_iter24 = this->expressions.begin(); _iter24 != this->expressions.end(); ++_iter24) + { + xfer += (*_iter24).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("start_key", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->start_key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->count); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* KeyRange::ascii_fingerprint = "A6EC82FA0980B91C7C8EB013C61CA1B0"; +const uint8_t KeyRange::binary_fingerprint[16] = {0xA6,0xEC,0x82,0xFA,0x09,0x80,0xB9,0x1C,0x7C,0x8E,0xB0,0x13,0xC6,0x1C,0xA1,0xB0}; + +uint32_t KeyRange::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_count = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->start_key); + this->__isset.start_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->end_key); + this->__isset.end_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->start_token); + this->__isset.start_token = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->end_token); + this->__isset.end_token = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->row_filter.clear(); + uint32_t _size25; + ::apache::thrift::protocol::TType _etype28; + iprot->readListBegin(_etype28, _size25); + this->row_filter.resize(_size25); + uint32_t _i29; + for (_i29 = 0; _i29 < _size25; ++_i29) + { + xfer += this->row_filter[_i29].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.row_filter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->count); + isset_count = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_count) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t KeyRange::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("KeyRange"); + if (this->__isset.start_key) { + xfer += oprot->writeFieldBegin("start_key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->start_key); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.end_key) { + xfer += oprot->writeFieldBegin("end_key", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->end_key); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.start_token) { + xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->start_token); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.end_token) { + xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->end_token); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->count); + xfer += oprot->writeFieldEnd(); + if (this->__isset.row_filter) { + xfer += oprot->writeFieldBegin("row_filter", ::apache::thrift::protocol::T_LIST, 6); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->row_filter.size())); + std::vector<IndexExpression> ::const_iterator _iter30; + for (_iter30 = this->row_filter.begin(); _iter30 != this->row_filter.end(); ++_iter30) + { + xfer += (*_iter30).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* KeySlice::ascii_fingerprint = "D1568675B0C135C909E3169B72A4DA3D"; +const uint8_t KeySlice::binary_fingerprint[16] = {0xD1,0x56,0x86,0x75,0xB0,0xC1,0x35,0xC9,0x09,0xE3,0x16,0x9B,0x72,0xA4,0xDA,0x3D}; + +uint32_t KeySlice::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_columns = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->columns.clear(); + uint32_t _size31; + ::apache::thrift::protocol::TType _etype34; + iprot->readListBegin(_etype34, _size31); + this->columns.resize(_size31); + uint32_t _i35; + for (_i35 = 0; _i35 < _size31; ++_i35) + { + xfer += this->columns[_i35].read(iprot); + } + iprot->readListEnd(); + } + isset_columns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_columns) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t KeySlice::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("KeySlice"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size())); + std::vector<ColumnOrSuperColumn> ::const_iterator _iter36; + for (_iter36 = this->columns.begin(); _iter36 != this->columns.end(); ++_iter36) + { + xfer += (*_iter36).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* KeyCount::ascii_fingerprint = "EEBC915CE44901401D881E6091423036"; +const uint8_t KeyCount::binary_fingerprint[16] = {0xEE,0xBC,0x91,0x5C,0xE4,0x49,0x01,0x40,0x1D,0x88,0x1E,0x60,0x91,0x42,0x30,0x36}; + +uint32_t KeyCount::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_count = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->count); + isset_count = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_count) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t KeyCount::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("KeyCount"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->count); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* Deletion::ascii_fingerprint = "40F33ECF1C932CA77C2414C4E6C60CBE"; +const uint8_t Deletion::binary_fingerprint[16] = {0x40,0xF3,0x3E,0xCF,0x1C,0x93,0x2C,0xA7,0x7C,0x24,0x14,0xC4,0xE6,0xC6,0x0C,0xBE}; + +uint32_t Deletion::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->timestamp); + this->__isset.timestamp = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->super_column); + this->__isset.super_column = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->predicate.read(iprot); + this->__isset.predicate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Deletion::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Deletion"); + if (this->__isset.timestamp) { + xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->timestamp); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.super_column) { + xfer += oprot->writeFieldBegin("super_column", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->super_column); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.predicate) { + xfer += oprot->writeFieldBegin("predicate", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->predicate.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* Mutation::ascii_fingerprint = "E8B65DF3979C6868F80DF81F8E769E63"; +const uint8_t Mutation::binary_fingerprint[16] = {0xE8,0xB6,0x5D,0xF3,0x97,0x9C,0x68,0x68,0xF8,0x0D,0xF8,0x1F,0x8E,0x76,0x9E,0x63}; + +uint32_t Mutation::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->column_or_supercolumn.read(iprot); + this->__isset.column_or_supercolumn = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->deletion.read(iprot); + this->__isset.deletion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t Mutation::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("Mutation"); + if (this->__isset.column_or_supercolumn) { + xfer += oprot->writeFieldBegin("column_or_supercolumn", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->column_or_supercolumn.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.deletion) { + xfer += oprot->writeFieldBegin("deletion", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->deletion.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* EndpointDetails::ascii_fingerprint = "F4A50F0EC638C7F66026F9B6678FD89B"; +const uint8_t EndpointDetails::binary_fingerprint[16] = {0xF4,0xA5,0x0F,0x0E,0xC6,0x38,0xC7,0xF6,0x60,0x26,0xF9,0xB6,0x67,0x8F,0xD8,0x9B}; + +uint32_t EndpointDetails::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->host); + this->__isset.host = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->datacenter); + this->__isset.datacenter = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->rack); + this->__isset.rack = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t EndpointDetails::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("EndpointDetails"); + xfer += oprot->writeFieldBegin("host", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->host); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("datacenter", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->datacenter); + xfer += oprot->writeFieldEnd(); + if (this->__isset.rack) { + xfer += oprot->writeFieldBegin("rack", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->rack); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* TokenRange::ascii_fingerprint = "832268DC4CD6B17EE8881FC57EA04679"; +const uint8_t TokenRange::binary_fingerprint[16] = {0x83,0x22,0x68,0xDC,0x4C,0xD6,0xB1,0x7E,0xE8,0x88,0x1F,0xC5,0x7E,0xA0,0x46,0x79}; + +uint32_t TokenRange::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_start_token = false; + bool isset_end_token = false; + bool isset_endpoints = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->start_token); + isset_start_token = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->end_token); + isset_end_token = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->endpoints.clear(); + uint32_t _size37; + ::apache::thrift::protocol::TType _etype40; + iprot->readListBegin(_etype40, _size37); + this->endpoints.resize(_size37); + uint32_t _i41; + for (_i41 = 0; _i41 < _size37; ++_i41) + { + xfer += iprot->readString(this->endpoints[_i41]); + } + iprot->readListEnd(); + } + isset_endpoints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->rpc_endpoints.clear(); + uint32_t _size42; + ::apache::thrift::protocol::TType _etype45; + iprot->readListBegin(_etype45, _size42); + this->rpc_endpoints.resize(_size42); + uint32_t _i46; + for (_i46 = 0; _i46 < _size42; ++_i46) + { + xfer += iprot->readString(this->rpc_endpoints[_i46]); + } + iprot->readListEnd(); + } + this->__isset.rpc_endpoints = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->endpoint_details.clear(); + uint32_t _size47; + ::apache::thrift::protocol::TType _etype50; + iprot->readListBegin(_etype50, _size47); + this->endpoint_details.resize(_size47); + uint32_t _i51; + for (_i51 = 0; _i51 < _size47; ++_i51) + { + xfer += this->endpoint_details[_i51].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.endpoint_details = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_start_token) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_end_token) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_endpoints) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TokenRange::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("TokenRange"); + xfer += oprot->writeFieldBegin("start_token", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->start_token); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("end_token", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->end_token); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("endpoints", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->endpoints.size())); + std::vector<std::string> ::const_iterator _iter52; + for (_iter52 = this->endpoints.begin(); _iter52 != this->endpoints.end(); ++_iter52) + { + xfer += oprot->writeString((*_iter52)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + if (this->__isset.rpc_endpoints) { + xfer += oprot->writeFieldBegin("rpc_endpoints", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->rpc_endpoints.size())); + std::vector<std::string> ::const_iterator _iter53; + for (_iter53 = this->rpc_endpoints.begin(); _iter53 != this->rpc_endpoints.end(); ++_iter53) + { + xfer += oprot->writeString((*_iter53)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.endpoint_details) { + xfer += oprot->writeFieldBegin("endpoint_details", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->endpoint_details.size())); + std::vector<EndpointDetails> ::const_iterator _iter54; + for (_iter54 = this->endpoint_details.begin(); _iter54 != this->endpoint_details.end(); ++_iter54) + { + xfer += (*_iter54).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* AuthenticationRequest::ascii_fingerprint = "5EA2D527ECA3BA20C77AFC023EE8C05F"; +const uint8_t AuthenticationRequest::binary_fingerprint[16] = {0x5E,0xA2,0xD5,0x27,0xEC,0xA3,0xBA,0x20,0xC7,0x7A,0xFC,0x02,0x3E,0xE8,0xC0,0x5F}; + +uint32_t AuthenticationRequest::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_credentials = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->credentials.clear(); + uint32_t _size55; + ::apache::thrift::protocol::TType _ktype56; + ::apache::thrift::protocol::TType _vtype57; + iprot->readMapBegin(_ktype56, _vtype57, _size55); + uint32_t _i59; + for (_i59 = 0; _i59 < _size55; ++_i59) + { + std::string _key60; + xfer += iprot->readString(_key60); + std::string& _val61 = this->credentials[_key60]; + xfer += iprot->readString(_val61); + } + iprot->readMapEnd(); + } + isset_credentials = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_credentials) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t AuthenticationRequest::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("AuthenticationRequest"); + xfer += oprot->writeFieldBegin("credentials", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->credentials.size())); + std::map<std::string, std::string> ::const_iterator _iter62; + for (_iter62 = this->credentials.begin(); _iter62 != this->credentials.end(); ++_iter62) + { + xfer += oprot->writeString(_iter62->first); + xfer += oprot->writeString(_iter62->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* ColumnDef::ascii_fingerprint = "0D89CE83D7EDAD079AC3213ED1DCAA58"; +const uint8_t ColumnDef::binary_fingerprint[16] = {0x0D,0x89,0xCE,0x83,0xD7,0xED,0xAD,0x07,0x9A,0xC3,0x21,0x3E,0xD1,0xDC,0xAA,0x58}; + +uint32_t ColumnDef::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + bool isset_validation_class = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->validation_class); + isset_validation_class = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast63; + xfer += iprot->readI32(ecast63); + this->index_type = (IndexType::type)ecast63; + this->__isset.index_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->index_name); + this->__isset.index_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->index_options.clear(); + uint32_t _size64; + ::apache::thrift::protocol::TType _ktype65; + ::apache::thrift::protocol::TType _vtype66; + iprot->readMapBegin(_ktype65, _vtype66, _size64); + uint32_t _i68; + for (_i68 = 0; _i68 < _size64; ++_i68) + { + std::string _key69; + xfer += iprot->readString(_key69); + std::string& _val70 = this->index_options[_key69]; + xfer += iprot->readString(_val70); + } + iprot->readMapEnd(); + } + this->__isset.index_options = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_validation_class) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t ColumnDef::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ColumnDef"); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("validation_class", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->validation_class); + xfer += oprot->writeFieldEnd(); + if (this->__isset.index_type) { + xfer += oprot->writeFieldBegin("index_type", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32((int32_t)this->index_type); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.index_name) { + xfer += oprot->writeFieldBegin("index_name", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->index_name); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.index_options) { + xfer += oprot->writeFieldBegin("index_options", ::apache::thrift::protocol::T_MAP, 5); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->index_options.size())); + std::map<std::string, std::string> ::const_iterator _iter71; + for (_iter71 = this->index_options.begin(); _iter71 != this->index_options.end(); ++_iter71) + { + xfer += oprot->writeString(_iter71->first); + xfer += oprot->writeString(_iter71->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* CfDef::ascii_fingerprint = "231A260521B5DD99EFBCCBDD8768CA7D"; +const uint8_t CfDef::binary_fingerprint[16] = {0x23,0x1A,0x26,0x05,0x21,0xB5,0xDD,0x99,0xEF,0xBC,0xCB,0xDD,0x87,0x68,0xCA,0x7D}; + +uint32_t CfDef::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_keyspace = false; + bool isset_name = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->keyspace); + isset_keyspace = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->column_type); + this->__isset.column_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->comparator_type); + this->__isset.comparator_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->subcomparator_type); + this->__isset.subcomparator_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->comment); + this->__isset.comment = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 12: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->read_repair_chance); + this->__isset.read_repair_chance = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 13: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->column_metadata.clear(); + uint32_t _size72; + ::apache::thrift::protocol::TType _etype75; + iprot->readListBegin(_etype75, _size72); + this->column_metadata.resize(_size72); + uint32_t _i76; + for (_i76 = 0; _i76 < _size72; ++_i76) + { + xfer += this->column_metadata[_i76].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.column_metadata = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 14: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->gc_grace_seconds); + this->__isset.gc_grace_seconds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 15: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->default_validation_class); + this->__isset.default_validation_class = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 16: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->id); + this->__isset.id = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 17: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->min_compaction_threshold); + this->__isset.min_compaction_threshold = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 18: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->max_compaction_threshold); + this->__isset.max_compaction_threshold = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 24: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->replicate_on_write); + this->__isset.replicate_on_write = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 26: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->key_validation_class); + this->__isset.key_validation_class = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 28: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key_alias); + this->__isset.key_alias = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 29: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->compaction_strategy); + this->__isset.compaction_strategy = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 30: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->compaction_strategy_options.clear(); + uint32_t _size77; + ::apache::thrift::protocol::TType _ktype78; + ::apache::thrift::protocol::TType _vtype79; + iprot->readMapBegin(_ktype78, _vtype79, _size77); + uint32_t _i81; + for (_i81 = 0; _i81 < _size77; ++_i81) + { + std::string _key82; + xfer += iprot->readString(_key82); + std::string& _val83 = this->compaction_strategy_options[_key82]; + xfer += iprot->readString(_val83); + } + iprot->readMapEnd(); + } + this->__isset.compaction_strategy_options = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 32: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->compression_options.clear(); + uint32_t _size84; + ::apache::thrift::protocol::TType _ktype85; + ::apache::thrift::protocol::TType _vtype86; + iprot->readMapBegin(_ktype85, _vtype86, _size84); + uint32_t _i88; + for (_i88 = 0; _i88 < _size84; ++_i88) + { + std::string _key89; + xfer += iprot->readString(_key89); + std::string& _val90 = this->compression_options[_key89]; + xfer += iprot->readString(_val90); + } + iprot->readMapEnd(); + } + this->__isset.compression_options = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 33: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->bloom_filter_fp_chance); + this->__isset.bloom_filter_fp_chance = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 34: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->caching); + this->__isset.caching = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 37: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->dclocal_read_repair_chance); + this->__isset.dclocal_read_repair_chance = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->row_cache_size); + this->__isset.row_cache_size = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 11: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->key_cache_size); + this->__isset.key_cache_size = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 19: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->row_cache_save_period_in_seconds); + this->__isset.row_cache_save_period_in_seconds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 20: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->key_cache_save_period_in_seconds); + this->__isset.key_cache_save_period_in_seconds = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 21: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->memtable_flush_after_mins); + this->__isset.memtable_flush_after_mins = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 22: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->memtable_throughput_in_mb); + this->__isset.memtable_throughput_in_mb = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 23: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->memtable_operations_in_millions); + this->__isset.memtable_operations_in_millions = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 25: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->merge_shards_chance); + this->__isset.merge_shards_chance = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 27: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->row_cache_provider); + this->__isset.row_cache_provider = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 31: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->row_cache_keys_to_save); + this->__isset.row_cache_keys_to_save = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keyspace) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CfDef::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("CfDef"); + xfer += oprot->writeFieldBegin("keyspace", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->keyspace); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + if (this->__isset.column_type) { + xfer += oprot->writeFieldBegin("column_type", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->column_type); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.comparator_type) { + xfer += oprot->writeFieldBegin("comparator_type", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->comparator_type); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.subcomparator_type) { + xfer += oprot->writeFieldBegin("subcomparator_type", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->subcomparator_type); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.comment) { + xfer += oprot->writeFieldBegin("comment", ::apache::thrift::protocol::T_STRING, 8); + xfer += oprot->writeString(this->comment); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.row_cache_size) { + xfer += oprot->writeFieldBegin("row_cache_size", ::apache::thrift::protocol::T_DOUBLE, 9); + xfer += oprot->writeDouble(this->row_cache_size); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.key_cache_size) { + xfer += oprot->writeFieldBegin("key_cache_size", ::apache::thrift::protocol::T_DOUBLE, 11); + xfer += oprot->writeDouble(this->key_cache_size); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.read_repair_chance) { + xfer += oprot->writeFieldBegin("read_repair_chance", ::apache::thrift::protocol::T_DOUBLE, 12); + xfer += oprot->writeDouble(this->read_repair_chance); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.column_metadata) { + xfer += oprot->writeFieldBegin("column_metadata", ::apache::thrift::protocol::T_LIST, 13); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->column_metadata.size())); + std::vector<ColumnDef> ::const_iterator _iter91; + for (_iter91 = this->column_metadata.begin(); _iter91 != this->column_metadata.end(); ++_iter91) + { + xfer += (*_iter91).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.gc_grace_seconds) { + xfer += oprot->writeFieldBegin("gc_grace_seconds", ::apache::thrift::protocol::T_I32, 14); + xfer += oprot->writeI32(this->gc_grace_seconds); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.default_validation_class) { + xfer += oprot->writeFieldBegin("default_validation_class", ::apache::thrift::protocol::T_STRING, 15); + xfer += oprot->writeString(this->default_validation_class); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.id) { + xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I32, 16); + xfer += oprot->writeI32(this->id); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.min_compaction_threshold) { + xfer += oprot->writeFieldBegin("min_compaction_threshold", ::apache::thrift::protocol::T_I32, 17); + xfer += oprot->writeI32(this->min_compaction_threshold); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.max_compaction_threshold) { + xfer += oprot->writeFieldBegin("max_compaction_threshold", ::apache::thrift::protocol::T_I32, 18); + xfer += oprot->writeI32(this->max_compaction_threshold); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.row_cache_save_period_in_seconds) { + xfer += oprot->writeFieldBegin("row_cache_save_period_in_seconds", ::apache::thrift::protocol::T_I32, 19); + xfer += oprot->writeI32(this->row_cache_save_period_in_seconds); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.key_cache_save_period_in_seconds) { + xfer += oprot->writeFieldBegin("key_cache_save_period_in_seconds", ::apache::thrift::protocol::T_I32, 20); + xfer += oprot->writeI32(this->key_cache_save_period_in_seconds); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.memtable_flush_after_mins) { + xfer += oprot->writeFieldBegin("memtable_flush_after_mins", ::apache::thrift::protocol::T_I32, 21); + xfer += oprot->writeI32(this->memtable_flush_after_mins); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.memtable_throughput_in_mb) { + xfer += oprot->writeFieldBegin("memtable_throughput_in_mb", ::apache::thrift::protocol::T_I32, 22); + xfer += oprot->writeI32(this->memtable_throughput_in_mb); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.memtable_operations_in_millions) { + xfer += oprot->writeFieldBegin("memtable_operations_in_millions", ::apache::thrift::protocol::T_DOUBLE, 23); + xfer += oprot->writeDouble(this->memtable_operations_in_millions); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.replicate_on_write) { + xfer += oprot->writeFieldBegin("replicate_on_write", ::apache::thrift::protocol::T_BOOL, 24); + xfer += oprot->writeBool(this->replicate_on_write); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.merge_shards_chance) { + xfer += oprot->writeFieldBegin("merge_shards_chance", ::apache::thrift::protocol::T_DOUBLE, 25); + xfer += oprot->writeDouble(this->merge_shards_chance); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.key_validation_class) { + xfer += oprot->writeFieldBegin("key_validation_class", ::apache::thrift::protocol::T_STRING, 26); + xfer += oprot->writeString(this->key_validation_class); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.row_cache_provider) { + xfer += oprot->writeFieldBegin("row_cache_provider", ::apache::thrift::protocol::T_STRING, 27); + xfer += oprot->writeString(this->row_cache_provider); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.key_alias) { + xfer += oprot->writeFieldBegin("key_alias", ::apache::thrift::protocol::T_STRING, 28); + xfer += oprot->writeBinary(this->key_alias); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.compaction_strategy) { + xfer += oprot->writeFieldBegin("compaction_strategy", ::apache::thrift::protocol::T_STRING, 29); + xfer += oprot->writeString(this->compaction_strategy); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.compaction_strategy_options) { + xfer += oprot->writeFieldBegin("compaction_strategy_options", ::apache::thrift::protocol::T_MAP, 30); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->compaction_strategy_options.size())); + std::map<std::string, std::string> ::const_iterator _iter92; + for (_iter92 = this->compaction_strategy_options.begin(); _iter92 != this->compaction_strategy_options.end(); ++_iter92) + { + xfer += oprot->writeString(_iter92->first); + xfer += oprot->writeString(_iter92->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.row_cache_keys_to_save) { + xfer += oprot->writeFieldBegin("row_cache_keys_to_save", ::apache::thrift::protocol::T_I32, 31); + xfer += oprot->writeI32(this->row_cache_keys_to_save); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.compression_options) { + xfer += oprot->writeFieldBegin("compression_options", ::apache::thrift::protocol::T_MAP, 32); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->compression_options.size())); + std::map<std::string, std::string> ::const_iterator _iter93; + for (_iter93 = this->compression_options.begin(); _iter93 != this->compression_options.end(); ++_iter93) + { + xfer += oprot->writeString(_iter93->first); + xfer += oprot->writeString(_iter93->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.bloom_filter_fp_chance) { + xfer += oprot->writeFieldBegin("bloom_filter_fp_chance", ::apache::thrift::protocol::T_DOUBLE, 33); + xfer += oprot->writeDouble(this->bloom_filter_fp_chance); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.caching) { + xfer += oprot->writeFieldBegin("caching", ::apache::thrift::protocol::T_STRING, 34); + xfer += oprot->writeString(this->caching); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.dclocal_read_repair_chance) { + xfer += oprot->writeFieldBegin("dclocal_read_repair_chance", ::apache::thrift::protocol::T_DOUBLE, 37); + xfer += oprot->writeDouble(this->dclocal_read_repair_chance); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* KsDef::ascii_fingerprint = "0767851B6476EB3777A21E59E912E11A"; +const uint8_t KsDef::binary_fingerprint[16] = {0x07,0x67,0x85,0x1B,0x64,0x76,0xEB,0x37,0x77,0xA2,0x1E,0x59,0xE9,0x12,0xE1,0x1A}; + +uint32_t KsDef::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name = false; + bool isset_strategy_class = false; + bool isset_cf_defs = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->name); + isset_name = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->strategy_class); + isset_strategy_class = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->strategy_options.clear(); + uint32_t _size94; + ::apache::thrift::protocol::TType _ktype95; + ::apache::thrift::protocol::TType _vtype96; + iprot->readMapBegin(_ktype95, _vtype96, _size94); + uint32_t _i98; + for (_i98 = 0; _i98 < _size94; ++_i98) + { + std::string _key99; + xfer += iprot->readString(_key99); + std::string& _val100 = this->strategy_options[_key99]; + xfer += iprot->readString(_val100); + } + iprot->readMapEnd(); + } + this->__isset.strategy_options = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->replication_factor); + this->__isset.replication_factor = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->cf_defs.clear(); + uint32_t _size101; + ::apache::thrift::protocol::TType _etype104; + iprot->readListBegin(_etype104, _size101); + this->cf_defs.resize(_size101); + uint32_t _i105; + for (_i105 = 0; _i105 < _size101; ++_i105) + { + xfer += this->cf_defs[_i105].read(iprot); + } + iprot->readListEnd(); + } + isset_cf_defs = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->durable_writes); + this->__isset.durable_writes = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_strategy_class) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_cf_defs) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t KsDef::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("KsDef"); + xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->name); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("strategy_class", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->strategy_class); + xfer += oprot->writeFieldEnd(); + if (this->__isset.strategy_options) { + xfer += oprot->writeFieldBegin("strategy_options", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->strategy_options.size())); + std::map<std::string, std::string> ::const_iterator _iter106; + for (_iter106 = this->strategy_options.begin(); _iter106 != this->strategy_options.end(); ++_iter106) + { + xfer += oprot->writeString(_iter106->first); + xfer += oprot->writeString(_iter106->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.replication_factor) { + xfer += oprot->writeFieldBegin("replication_factor", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->replication_factor); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("cf_defs", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->cf_defs.size())); + std::vector<CfDef> ::const_iterator _iter107; + for (_iter107 = this->cf_defs.begin(); _iter107 != this->cf_defs.end(); ++_iter107) + { + xfer += (*_iter107).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + if (this->__isset.durable_writes) { + xfer += oprot->writeFieldBegin("durable_writes", ::apache::thrift::protocol::T_BOOL, 6); + xfer += oprot->writeBool(this->durable_writes); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* CqlRow::ascii_fingerprint = "470EFC558004E98D92D604898305C04E"; +const uint8_t CqlRow::binary_fingerprint[16] = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E}; + +uint32_t CqlRow::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_key = false; + bool isset_columns = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->key); + isset_key = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->columns.clear(); + uint32_t _size108; + ::apache::thrift::protocol::TType _etype111; + iprot->readListBegin(_etype111, _size108); + this->columns.resize(_size108); + uint32_t _i112; + for (_i112 = 0; _i112 < _size108; ++_i112) + { + xfer += this->columns[_i112].read(iprot); + } + iprot->readListEnd(); + } + isset_columns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_key) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_columns) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CqlRow::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("CqlRow"); + xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->key); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->columns.size())); + std::vector<Column> ::const_iterator _iter113; + for (_iter113 = this->columns.begin(); _iter113 != this->columns.end(); ++_iter113) + { + xfer += (*_iter113).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* CqlMetadata::ascii_fingerprint = "B7C5A4AA9652C744A48EBC1C12D531E7"; +const uint8_t CqlMetadata::binary_fingerprint[16] = {0xB7,0xC5,0xA4,0xAA,0x96,0x52,0xC7,0x44,0xA4,0x8E,0xBC,0x1C,0x12,0xD5,0x31,0xE7}; + +uint32_t CqlMetadata::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_name_types = false; + bool isset_value_types = false; + bool isset_default_name_type = false; + bool isset_default_value_type = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->name_types.clear(); + uint32_t _size114; + ::apache::thrift::protocol::TType _ktype115; + ::apache::thrift::protocol::TType _vtype116; + iprot->readMapBegin(_ktype115, _vtype116, _size114); + uint32_t _i118; + for (_i118 = 0; _i118 < _size114; ++_i118) + { + std::string _key119; + xfer += iprot->readBinary(_key119); + std::string& _val120 = this->name_types[_key119]; + xfer += iprot->readString(_val120); + } + iprot->readMapEnd(); + } + isset_name_types = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->value_types.clear(); + uint32_t _size121; + ::apache::thrift::protocol::TType _ktype122; + ::apache::thrift::protocol::TType _vtype123; + iprot->readMapBegin(_ktype122, _vtype123, _size121); + uint32_t _i125; + for (_i125 = 0; _i125 < _size121; ++_i125) + { + std::string _key126; + xfer += iprot->readBinary(_key126); + std::string& _val127 = this->value_types[_key126]; + xfer += iprot->readString(_val127); + } + iprot->readMapEnd(); + } + isset_value_types = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->default_name_type); + isset_default_name_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->default_value_type); + isset_default_value_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_name_types) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_value_types) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_default_name_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_default_value_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CqlMetadata::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("CqlMetadata"); + xfer += oprot->writeFieldBegin("name_types", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->name_types.size())); + std::map<std::string, std::string> ::const_iterator _iter128; + for (_iter128 = this->name_types.begin(); _iter128 != this->name_types.end(); ++_iter128) + { + xfer += oprot->writeBinary(_iter128->first); + xfer += oprot->writeString(_iter128->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("value_types", ::apache::thrift::protocol::T_MAP, 2); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->value_types.size())); + std::map<std::string, std::string> ::const_iterator _iter129; + for (_iter129 = this->value_types.begin(); _iter129 != this->value_types.end(); ++_iter129) + { + xfer += oprot->writeBinary(_iter129->first); + xfer += oprot->writeString(_iter129->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("default_name_type", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->default_name_type); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("default_value_type", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->default_value_type); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* CqlResult::ascii_fingerprint = "521B9CE5AF77539F7267F6952B609E81"; +const uint8_t CqlResult::binary_fingerprint[16] = {0x52,0x1B,0x9C,0xE5,0xAF,0x77,0x53,0x9F,0x72,0x67,0xF6,0x95,0x2B,0x60,0x9E,0x81}; + +uint32_t CqlResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_type = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast130; + xfer += iprot->readI32(ecast130); + this->type = (CqlResultType::type)ecast130; + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->rows.clear(); + uint32_t _size131; + ::apache::thrift::protocol::TType _etype134; + iprot->readListBegin(_etype134, _size131); + this->rows.resize(_size131); + uint32_t _i135; + for (_i135 = 0; _i135 < _size131; ++_i135) + { + xfer += this->rows[_i135].read(iprot); + } + iprot->readListEnd(); + } + this->__isset.rows = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->num); + this->__isset.num = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->schema.read(iprot); + this->__isset.schema = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CqlResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("CqlResult"); + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((int32_t)this->type); + xfer += oprot->writeFieldEnd(); + if (this->__isset.rows) { + xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->rows.size())); + std::vector<CqlRow> ::const_iterator _iter136; + for (_iter136 = this->rows.begin(); _iter136 != this->rows.end(); ++_iter136) + { + xfer += (*_iter136).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.num) { + xfer += oprot->writeFieldBegin("num", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->num); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schema) { + xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->schema.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +const char* CqlPreparedResult::ascii_fingerprint = "7E1663EC688DFDC28722BF36F9F64E6F"; +const uint8_t CqlPreparedResult::binary_fingerprint[16] = {0x7E,0x16,0x63,0xEC,0x68,0x8D,0xFD,0xC2,0x87,0x22,0xBF,0x36,0xF9,0xF6,0x4E,0x6F}; + +uint32_t CqlPreparedResult::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + bool isset_itemId = false; + bool isset_count = false; + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->itemId); + isset_itemId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->count); + isset_count = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->variable_types.clear(); + uint32_t _size137; + ::apache::thrift::protocol::TType _etype140; + iprot->readListBegin(_etype140, _size137); + this->variable_types.resize(_size137); + uint32_t _i141; + for (_i141 = 0; _i141 < _size137; ++_i141) + { + xfer += iprot->readString(this->variable_types[_i141]); + } + iprot->readListEnd(); + } + this->__isset.variable_types = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->variable_names.clear(); + uint32_t _size142; + ::apache::thrift::protocol::TType _etype145; + iprot->readListBegin(_etype145, _size142); + this->variable_names.resize(_size142); + uint32_t _i146; + for (_i146 = 0; _i146 < _size142; ++_i146) + { + xfer += iprot->readString(this->variable_names[_i146]); + } + iprot->readListEnd(); + } + this->__isset.variable_names = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_itemId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_count) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t CqlPreparedResult::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("CqlPreparedResult"); + xfer += oprot->writeFieldBegin("itemId", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->itemId); + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("count", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->count); + xfer += oprot->writeFieldEnd(); + if (this->__isset.variable_types) { + xfer += oprot->writeFieldBegin("variable_types", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->variable_types.size())); + std::vector<std::string> ::const_iterator _iter147; + for (_iter147 = this->variable_types.begin(); _iter147 != this->variable_types.end(); ++_iter147) + { + xfer += oprot->writeString((*_iter147)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.variable_names) { + xfer += oprot->writeFieldBegin("variable_names", ::apache::thrift::protocol::T_LIST, 4); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->variable_names.size())); + std::vector<std::string> ::const_iterator _iter148; + for (_iter148 = this->variable_names.begin(); _iter148 != this->variable_names.end(); ++_iter148) + { + xfer += oprot->writeString((*_iter148)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +}}} // namespace diff --git a/storage/cassandra/gen-cpp/cassandra_types.h b/storage/cassandra/gen-cpp/cassandra_types.h new file mode 100644 index 00000000000..d675198dcc8 --- /dev/null +++ b/storage/cassandra/gen-cpp/cassandra_types.h @@ -0,0 +1,2149 @@ +/** + * Autogenerated by Thrift Compiler (0.8.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef cassandra_TYPES_H +#define cassandra_TYPES_H + +#include <inttypes.h> +#include <netinet/in.h> + +#include <Thrift.h> +#include <TApplicationException.h> +#include <protocol/TProtocol.h> +#include <transport/TTransport.h> + + + +namespace org { namespace apache { namespace cassandra { + +struct ConsistencyLevel { + enum type { + ONE = 1, + QUORUM = 2, + LOCAL_QUORUM = 3, + EACH_QUORUM = 4, + ALL = 5, + ANY = 6, + TWO = 7, + THREE = 8 + }; +}; + +extern const std::map<int, const char*> _ConsistencyLevel_VALUES_TO_NAMES; + +struct IndexOperator { + enum type { + EQ = 0, + GTE = 1, + GT = 2, + LTE = 3, + LT = 4 + }; +}; + +extern const std::map<int, const char*> _IndexOperator_VALUES_TO_NAMES; + +struct IndexType { + enum type { + KEYS = 0, + CUSTOM = 1 + }; +}; + +extern const std::map<int, const char*> _IndexType_VALUES_TO_NAMES; + +struct Compression { + enum type { + GZIP = 1, + NONE = 2 + }; +}; + +extern const std::map<int, const char*> _Compression_VALUES_TO_NAMES; + +struct CqlResultType { + enum type { + ROWS = 1, + VOID = 2, + INT = 3 + }; +}; + +extern const std::map<int, const char*> _CqlResultType_VALUES_TO_NAMES; + +typedef struct _Column__isset { + _Column__isset() : value(false), timestamp(false), ttl(false) {} + bool value; + bool timestamp; + bool ttl; +} _Column__isset; + +class Column { + public: + + static const char* ascii_fingerprint; // = "3EE0E1C5C844001B62F08125068292CC"; + static const uint8_t binary_fingerprint[16]; // = {0x3E,0xE0,0xE1,0xC5,0xC8,0x44,0x00,0x1B,0x62,0xF0,0x81,0x25,0x06,0x82,0x92,0xCC}; + + Column() : name(""), value(""), timestamp(0), ttl(0) { + } + + virtual ~Column() throw() {} + + std::string name; + std::string value; + int64_t timestamp; + int32_t ttl; + + _Column__isset __isset; + + void __set_name(const std::string& val) { + name = val; + } + + void __set_value(const std::string& val) { + value = val; + __isset.value = true; + } + + void __set_timestamp(const int64_t val) { + timestamp = val; + __isset.timestamp = true; + } + + void __set_ttl(const int32_t val) { + ttl = val; + __isset.ttl = true; + } + + bool operator == (const Column & rhs) const + { + if (!(name == rhs.name)) + return false; + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + if (__isset.timestamp != rhs.__isset.timestamp) + return false; + else if (__isset.timestamp && !(timestamp == rhs.timestamp)) + return false; + if (__isset.ttl != rhs.__isset.ttl) + return false; + else if (__isset.ttl && !(ttl == rhs.ttl)) + return false; + return true; + } + bool operator != (const Column &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Column & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class SuperColumn { + public: + + static const char* ascii_fingerprint; // = "470EFC558004E98D92D604898305C04E"; + static const uint8_t binary_fingerprint[16]; // = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E}; + + SuperColumn() : name("") { + } + + virtual ~SuperColumn() throw() {} + + std::string name; + std::vector<Column> columns; + + void __set_name(const std::string& val) { + name = val; + } + + void __set_columns(const std::vector<Column> & val) { + columns = val; + } + + bool operator == (const SuperColumn & rhs) const + { + if (!(name == rhs.name)) + return false; + if (!(columns == rhs.columns)) + return false; + return true; + } + bool operator != (const SuperColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SuperColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class CounterColumn { + public: + + static const char* ascii_fingerprint; // = "1CCCF6FC31CFD1D61BBBB1BAF3590620"; + static const uint8_t binary_fingerprint[16]; // = {0x1C,0xCC,0xF6,0xFC,0x31,0xCF,0xD1,0xD6,0x1B,0xBB,0xB1,0xBA,0xF3,0x59,0x06,0x20}; + + CounterColumn() : name(""), value(0) { + } + + virtual ~CounterColumn() throw() {} + + std::string name; + int64_t value; + + void __set_name(const std::string& val) { + name = val; + } + + void __set_value(const int64_t val) { + value = val; + } + + bool operator == (const CounterColumn & rhs) const + { + if (!(name == rhs.name)) + return false; + if (!(value == rhs.value)) + return false; + return true; + } + bool operator != (const CounterColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CounterColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class CounterSuperColumn { + public: + + static const char* ascii_fingerprint; // = "CD4C8C4BF7753E46DE417CDE369343A4"; + static const uint8_t binary_fingerprint[16]; // = {0xCD,0x4C,0x8C,0x4B,0xF7,0x75,0x3E,0x46,0xDE,0x41,0x7C,0xDE,0x36,0x93,0x43,0xA4}; + + CounterSuperColumn() : name("") { + } + + virtual ~CounterSuperColumn() throw() {} + + std::string name; + std::vector<CounterColumn> columns; + + void __set_name(const std::string& val) { + name = val; + } + + void __set_columns(const std::vector<CounterColumn> & val) { + columns = val; + } + + bool operator == (const CounterSuperColumn & rhs) const + { + if (!(name == rhs.name)) + return false; + if (!(columns == rhs.columns)) + return false; + return true; + } + bool operator != (const CounterSuperColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CounterSuperColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ColumnOrSuperColumn__isset { + _ColumnOrSuperColumn__isset() : column(false), super_column(false), counter_column(false), counter_super_column(false) {} + bool column; + bool super_column; + bool counter_column; + bool counter_super_column; +} _ColumnOrSuperColumn__isset; + +class ColumnOrSuperColumn { + public: + + static const char* ascii_fingerprint; // = "2B34AC9E80F1DAA3A2A63B1AB1841E61"; + static const uint8_t binary_fingerprint[16]; // = {0x2B,0x34,0xAC,0x9E,0x80,0xF1,0xDA,0xA3,0xA2,0xA6,0x3B,0x1A,0xB1,0x84,0x1E,0x61}; + + ColumnOrSuperColumn() { + } + + virtual ~ColumnOrSuperColumn() throw() {} + + Column column; + SuperColumn super_column; + CounterColumn counter_column; + CounterSuperColumn counter_super_column; + + _ColumnOrSuperColumn__isset __isset; + + void __set_column(const Column& val) { + column = val; + __isset.column = true; + } + + void __set_super_column(const SuperColumn& val) { + super_column = val; + __isset.super_column = true; + } + + void __set_counter_column(const CounterColumn& val) { + counter_column = val; + __isset.counter_column = true; + } + + void __set_counter_super_column(const CounterSuperColumn& val) { + counter_super_column = val; + __isset.counter_super_column = true; + } + + bool operator == (const ColumnOrSuperColumn & rhs) const + { + if (__isset.column != rhs.__isset.column) + return false; + else if (__isset.column && !(column == rhs.column)) + return false; + if (__isset.super_column != rhs.__isset.super_column) + return false; + else if (__isset.super_column && !(super_column == rhs.super_column)) + return false; + if (__isset.counter_column != rhs.__isset.counter_column) + return false; + else if (__isset.counter_column && !(counter_column == rhs.counter_column)) + return false; + if (__isset.counter_super_column != rhs.__isset.counter_super_column) + return false; + else if (__isset.counter_super_column && !(counter_super_column == rhs.counter_super_column)) + return false; + return true; + } + bool operator != (const ColumnOrSuperColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnOrSuperColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class NotFoundException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B"; + static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + + NotFoundException() { + } + + virtual ~NotFoundException() throw() {} + + + bool operator == (const NotFoundException & /* rhs */) const + { + return true; + } + bool operator != (const NotFoundException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const NotFoundException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class InvalidRequestException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1"; + static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + + InvalidRequestException() : why("") { + } + + virtual ~InvalidRequestException() throw() {} + + std::string why; + + void __set_why(const std::string& val) { + why = val; + } + + bool operator == (const InvalidRequestException & rhs) const + { + if (!(why == rhs.why)) + return false; + return true; + } + bool operator != (const InvalidRequestException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const InvalidRequestException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class UnavailableException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B"; + static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + + UnavailableException() { + } + + virtual ~UnavailableException() throw() {} + + + bool operator == (const UnavailableException & /* rhs */) const + { + return true; + } + bool operator != (const UnavailableException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const UnavailableException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TimedOutException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B"; + static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + + TimedOutException() { + } + + virtual ~TimedOutException() throw() {} + + + bool operator == (const TimedOutException & /* rhs */) const + { + return true; + } + bool operator != (const TimedOutException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TimedOutException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class AuthenticationException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1"; + static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + + AuthenticationException() : why("") { + } + + virtual ~AuthenticationException() throw() {} + + std::string why; + + void __set_why(const std::string& val) { + why = val; + } + + bool operator == (const AuthenticationException & rhs) const + { + if (!(why == rhs.why)) + return false; + return true; + } + bool operator != (const AuthenticationException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AuthenticationException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class AuthorizationException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "EFB929595D312AC8F305D5A794CFEDA1"; + static const uint8_t binary_fingerprint[16]; // = {0xEF,0xB9,0x29,0x59,0x5D,0x31,0x2A,0xC8,0xF3,0x05,0xD5,0xA7,0x94,0xCF,0xED,0xA1}; + + AuthorizationException() : why("") { + } + + virtual ~AuthorizationException() throw() {} + + std::string why; + + void __set_why(const std::string& val) { + why = val; + } + + bool operator == (const AuthorizationException & rhs) const + { + if (!(why == rhs.why)) + return false; + return true; + } + bool operator != (const AuthorizationException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AuthorizationException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class SchemaDisagreementException : public ::apache::thrift::TException { + public: + + static const char* ascii_fingerprint; // = "99914B932BD37A50B983C5E7C90AE93B"; + static const uint8_t binary_fingerprint[16]; // = {0x99,0x91,0x4B,0x93,0x2B,0xD3,0x7A,0x50,0xB9,0x83,0xC5,0xE7,0xC9,0x0A,0xE9,0x3B}; + + SchemaDisagreementException() { + } + + virtual ~SchemaDisagreementException() throw() {} + + + bool operator == (const SchemaDisagreementException & /* rhs */) const + { + return true; + } + bool operator != (const SchemaDisagreementException &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SchemaDisagreementException & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ColumnParent__isset { + _ColumnParent__isset() : super_column(false) {} + bool super_column; +} _ColumnParent__isset; + +class ColumnParent { + public: + + static const char* ascii_fingerprint; // = "0A13AE61181713A4100DFFB3EC293822"; + static const uint8_t binary_fingerprint[16]; // = {0x0A,0x13,0xAE,0x61,0x18,0x17,0x13,0xA4,0x10,0x0D,0xFF,0xB3,0xEC,0x29,0x38,0x22}; + + ColumnParent() : column_family(""), super_column("") { + } + + virtual ~ColumnParent() throw() {} + + std::string column_family; + std::string super_column; + + _ColumnParent__isset __isset; + + void __set_column_family(const std::string& val) { + column_family = val; + } + + void __set_super_column(const std::string& val) { + super_column = val; + __isset.super_column = true; + } + + bool operator == (const ColumnParent & rhs) const + { + if (!(column_family == rhs.column_family)) + return false; + if (__isset.super_column != rhs.__isset.super_column) + return false; + else if (__isset.super_column && !(super_column == rhs.super_column)) + return false; + return true; + } + bool operator != (const ColumnParent &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnParent & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ColumnPath__isset { + _ColumnPath__isset() : super_column(false), column(false) {} + bool super_column; + bool column; +} _ColumnPath__isset; + +class ColumnPath { + public: + + static const char* ascii_fingerprint; // = "606212895BCF63C757913CF35AEB3462"; + static const uint8_t binary_fingerprint[16]; // = {0x60,0x62,0x12,0x89,0x5B,0xCF,0x63,0xC7,0x57,0x91,0x3C,0xF3,0x5A,0xEB,0x34,0x62}; + + ColumnPath() : column_family(""), super_column(""), column("") { + } + + virtual ~ColumnPath() throw() {} + + std::string column_family; + std::string super_column; + std::string column; + + _ColumnPath__isset __isset; + + void __set_column_family(const std::string& val) { + column_family = val; + } + + void __set_super_column(const std::string& val) { + super_column = val; + __isset.super_column = true; + } + + void __set_column(const std::string& val) { + column = val; + __isset.column = true; + } + + bool operator == (const ColumnPath & rhs) const + { + if (!(column_family == rhs.column_family)) + return false; + if (__isset.super_column != rhs.__isset.super_column) + return false; + else if (__isset.super_column && !(super_column == rhs.super_column)) + return false; + if (__isset.column != rhs.__isset.column) + return false; + else if (__isset.column && !(column == rhs.column)) + return false; + return true; + } + bool operator != (const ColumnPath &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnPath & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class SliceRange { + public: + + static const char* ascii_fingerprint; // = "184D24C9A0B8D4415E234DB649CAE740"; + static const uint8_t binary_fingerprint[16]; // = {0x18,0x4D,0x24,0xC9,0xA0,0xB8,0xD4,0x41,0x5E,0x23,0x4D,0xB6,0x49,0xCA,0xE7,0x40}; + + SliceRange() : start(""), finish(""), reversed(false), count(100) { + } + + virtual ~SliceRange() throw() {} + + std::string start; + std::string finish; + bool reversed; + int32_t count; + + void __set_start(const std::string& val) { + start = val; + } + + void __set_finish(const std::string& val) { + finish = val; + } + + void __set_reversed(const bool val) { + reversed = val; + } + + void __set_count(const int32_t val) { + count = val; + } + + bool operator == (const SliceRange & rhs) const + { + if (!(start == rhs.start)) + return false; + if (!(finish == rhs.finish)) + return false; + if (!(reversed == rhs.reversed)) + return false; + if (!(count == rhs.count)) + return false; + return true; + } + bool operator != (const SliceRange &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SliceRange & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _SlicePredicate__isset { + _SlicePredicate__isset() : column_names(false), slice_range(false) {} + bool column_names; + bool slice_range; +} _SlicePredicate__isset; + +class SlicePredicate { + public: + + static const char* ascii_fingerprint; // = "F59D1D81C17DFFAF09988BF1C9CE5E27"; + static const uint8_t binary_fingerprint[16]; // = {0xF5,0x9D,0x1D,0x81,0xC1,0x7D,0xFF,0xAF,0x09,0x98,0x8B,0xF1,0xC9,0xCE,0x5E,0x27}; + + SlicePredicate() { + } + + virtual ~SlicePredicate() throw() {} + + std::vector<std::string> column_names; + SliceRange slice_range; + + _SlicePredicate__isset __isset; + + void __set_column_names(const std::vector<std::string> & val) { + column_names = val; + __isset.column_names = true; + } + + void __set_slice_range(const SliceRange& val) { + slice_range = val; + __isset.slice_range = true; + } + + bool operator == (const SlicePredicate & rhs) const + { + if (__isset.column_names != rhs.__isset.column_names) + return false; + else if (__isset.column_names && !(column_names == rhs.column_names)) + return false; + if (__isset.slice_range != rhs.__isset.slice_range) + return false; + else if (__isset.slice_range && !(slice_range == rhs.slice_range)) + return false; + return true; + } + bool operator != (const SlicePredicate &rhs) const { + return !(*this == rhs); + } + + bool operator < (const SlicePredicate & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class IndexExpression { + public: + + static const char* ascii_fingerprint; // = "D9F4CFE2F293A8B1052FD3031DD2C847"; + static const uint8_t binary_fingerprint[16]; // = {0xD9,0xF4,0xCF,0xE2,0xF2,0x93,0xA8,0xB1,0x05,0x2F,0xD3,0x03,0x1D,0xD2,0xC8,0x47}; + + IndexExpression() : column_name(""), op((IndexOperator::type)0), value("") { + } + + virtual ~IndexExpression() throw() {} + + std::string column_name; + IndexOperator::type op; + std::string value; + + void __set_column_name(const std::string& val) { + column_name = val; + } + + void __set_op(const IndexOperator::type val) { + op = val; + } + + void __set_value(const std::string& val) { + value = val; + } + + bool operator == (const IndexExpression & rhs) const + { + if (!(column_name == rhs.column_name)) + return false; + if (!(op == rhs.op)) + return false; + if (!(value == rhs.value)) + return false; + return true; + } + bool operator != (const IndexExpression &rhs) const { + return !(*this == rhs); + } + + bool operator < (const IndexExpression & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class IndexClause { + public: + + static const char* ascii_fingerprint; // = "9B551B9AB86120B0EEA9005C77FD3C1F"; + static const uint8_t binary_fingerprint[16]; // = {0x9B,0x55,0x1B,0x9A,0xB8,0x61,0x20,0xB0,0xEE,0xA9,0x00,0x5C,0x77,0xFD,0x3C,0x1F}; + + IndexClause() : start_key(""), count(100) { + } + + virtual ~IndexClause() throw() {} + + std::vector<IndexExpression> expressions; + std::string start_key; + int32_t count; + + void __set_expressions(const std::vector<IndexExpression> & val) { + expressions = val; + } + + void __set_start_key(const std::string& val) { + start_key = val; + } + + void __set_count(const int32_t val) { + count = val; + } + + bool operator == (const IndexClause & rhs) const + { + if (!(expressions == rhs.expressions)) + return false; + if (!(start_key == rhs.start_key)) + return false; + if (!(count == rhs.count)) + return false; + return true; + } + bool operator != (const IndexClause &rhs) const { + return !(*this == rhs); + } + + bool operator < (const IndexClause & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _KeyRange__isset { + _KeyRange__isset() : start_key(false), end_key(false), start_token(false), end_token(false), row_filter(false) {} + bool start_key; + bool end_key; + bool start_token; + bool end_token; + bool row_filter; +} _KeyRange__isset; + +class KeyRange { + public: + + static const char* ascii_fingerprint; // = "A6EC82FA0980B91C7C8EB013C61CA1B0"; + static const uint8_t binary_fingerprint[16]; // = {0xA6,0xEC,0x82,0xFA,0x09,0x80,0xB9,0x1C,0x7C,0x8E,0xB0,0x13,0xC6,0x1C,0xA1,0xB0}; + + KeyRange() : start_key(""), end_key(""), start_token(""), end_token(""), count(100) { + } + + virtual ~KeyRange() throw() {} + + std::string start_key; + std::string end_key; + std::string start_token; + std::string end_token; + std::vector<IndexExpression> row_filter; + int32_t count; + + _KeyRange__isset __isset; + + void __set_start_key(const std::string& val) { + start_key = val; + __isset.start_key = true; + } + + void __set_end_key(const std::string& val) { + end_key = val; + __isset.end_key = true; + } + + void __set_start_token(const std::string& val) { + start_token = val; + __isset.start_token = true; + } + + void __set_end_token(const std::string& val) { + end_token = val; + __isset.end_token = true; + } + + void __set_row_filter(const std::vector<IndexExpression> & val) { + row_filter = val; + __isset.row_filter = true; + } + + void __set_count(const int32_t val) { + count = val; + } + + bool operator == (const KeyRange & rhs) const + { + if (__isset.start_key != rhs.__isset.start_key) + return false; + else if (__isset.start_key && !(start_key == rhs.start_key)) + return false; + if (__isset.end_key != rhs.__isset.end_key) + return false; + else if (__isset.end_key && !(end_key == rhs.end_key)) + return false; + if (__isset.start_token != rhs.__isset.start_token) + return false; + else if (__isset.start_token && !(start_token == rhs.start_token)) + return false; + if (__isset.end_token != rhs.__isset.end_token) + return false; + else if (__isset.end_token && !(end_token == rhs.end_token)) + return false; + if (__isset.row_filter != rhs.__isset.row_filter) + return false; + else if (__isset.row_filter && !(row_filter == rhs.row_filter)) + return false; + if (!(count == rhs.count)) + return false; + return true; + } + bool operator != (const KeyRange &rhs) const { + return !(*this == rhs); + } + + bool operator < (const KeyRange & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class KeySlice { + public: + + static const char* ascii_fingerprint; // = "D1568675B0C135C909E3169B72A4DA3D"; + static const uint8_t binary_fingerprint[16]; // = {0xD1,0x56,0x86,0x75,0xB0,0xC1,0x35,0xC9,0x09,0xE3,0x16,0x9B,0x72,0xA4,0xDA,0x3D}; + + KeySlice() : key("") { + } + + virtual ~KeySlice() throw() {} + + std::string key; + std::vector<ColumnOrSuperColumn> columns; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_columns(const std::vector<ColumnOrSuperColumn> & val) { + columns = val; + } + + bool operator == (const KeySlice & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(columns == rhs.columns)) + return false; + return true; + } + bool operator != (const KeySlice &rhs) const { + return !(*this == rhs); + } + + bool operator < (const KeySlice & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class KeyCount { + public: + + static const char* ascii_fingerprint; // = "EEBC915CE44901401D881E6091423036"; + static const uint8_t binary_fingerprint[16]; // = {0xEE,0xBC,0x91,0x5C,0xE4,0x49,0x01,0x40,0x1D,0x88,0x1E,0x60,0x91,0x42,0x30,0x36}; + + KeyCount() : key(""), count(0) { + } + + virtual ~KeyCount() throw() {} + + std::string key; + int32_t count; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_count(const int32_t val) { + count = val; + } + + bool operator == (const KeyCount & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(count == rhs.count)) + return false; + return true; + } + bool operator != (const KeyCount &rhs) const { + return !(*this == rhs); + } + + bool operator < (const KeyCount & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Deletion__isset { + _Deletion__isset() : timestamp(false), super_column(false), predicate(false) {} + bool timestamp; + bool super_column; + bool predicate; +} _Deletion__isset; + +class Deletion { + public: + + static const char* ascii_fingerprint; // = "40F33ECF1C932CA77C2414C4E6C60CBE"; + static const uint8_t binary_fingerprint[16]; // = {0x40,0xF3,0x3E,0xCF,0x1C,0x93,0x2C,0xA7,0x7C,0x24,0x14,0xC4,0xE6,0xC6,0x0C,0xBE}; + + Deletion() : timestamp(0), super_column("") { + } + + virtual ~Deletion() throw() {} + + int64_t timestamp; + std::string super_column; + SlicePredicate predicate; + + _Deletion__isset __isset; + + void __set_timestamp(const int64_t val) { + timestamp = val; + __isset.timestamp = true; + } + + void __set_super_column(const std::string& val) { + super_column = val; + __isset.super_column = true; + } + + void __set_predicate(const SlicePredicate& val) { + predicate = val; + __isset.predicate = true; + } + + bool operator == (const Deletion & rhs) const + { + if (__isset.timestamp != rhs.__isset.timestamp) + return false; + else if (__isset.timestamp && !(timestamp == rhs.timestamp)) + return false; + if (__isset.super_column != rhs.__isset.super_column) + return false; + else if (__isset.super_column && !(super_column == rhs.super_column)) + return false; + if (__isset.predicate != rhs.__isset.predicate) + return false; + else if (__isset.predicate && !(predicate == rhs.predicate)) + return false; + return true; + } + bool operator != (const Deletion &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Deletion & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _Mutation__isset { + _Mutation__isset() : column_or_supercolumn(false), deletion(false) {} + bool column_or_supercolumn; + bool deletion; +} _Mutation__isset; + +class Mutation { + public: + + static const char* ascii_fingerprint; // = "E8B65DF3979C6868F80DF81F8E769E63"; + static const uint8_t binary_fingerprint[16]; // = {0xE8,0xB6,0x5D,0xF3,0x97,0x9C,0x68,0x68,0xF8,0x0D,0xF8,0x1F,0x8E,0x76,0x9E,0x63}; + + Mutation() { + } + + virtual ~Mutation() throw() {} + + ColumnOrSuperColumn column_or_supercolumn; + Deletion deletion; + + _Mutation__isset __isset; + + void __set_column_or_supercolumn(const ColumnOrSuperColumn& val) { + column_or_supercolumn = val; + __isset.column_or_supercolumn = true; + } + + void __set_deletion(const Deletion& val) { + deletion = val; + __isset.deletion = true; + } + + bool operator == (const Mutation & rhs) const + { + if (__isset.column_or_supercolumn != rhs.__isset.column_or_supercolumn) + return false; + else if (__isset.column_or_supercolumn && !(column_or_supercolumn == rhs.column_or_supercolumn)) + return false; + if (__isset.deletion != rhs.__isset.deletion) + return false; + else if (__isset.deletion && !(deletion == rhs.deletion)) + return false; + return true; + } + bool operator != (const Mutation &rhs) const { + return !(*this == rhs); + } + + bool operator < (const Mutation & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _EndpointDetails__isset { + _EndpointDetails__isset() : host(false), datacenter(false), rack(false) {} + bool host; + bool datacenter; + bool rack; +} _EndpointDetails__isset; + +class EndpointDetails { + public: + + static const char* ascii_fingerprint; // = "F4A50F0EC638C7F66026F9B6678FD89B"; + static const uint8_t binary_fingerprint[16]; // = {0xF4,0xA5,0x0F,0x0E,0xC6,0x38,0xC7,0xF6,0x60,0x26,0xF9,0xB6,0x67,0x8F,0xD8,0x9B}; + + EndpointDetails() : host(""), datacenter(""), rack("") { + } + + virtual ~EndpointDetails() throw() {} + + std::string host; + std::string datacenter; + std::string rack; + + _EndpointDetails__isset __isset; + + void __set_host(const std::string& val) { + host = val; + } + + void __set_datacenter(const std::string& val) { + datacenter = val; + } + + void __set_rack(const std::string& val) { + rack = val; + __isset.rack = true; + } + + bool operator == (const EndpointDetails & rhs) const + { + if (!(host == rhs.host)) + return false; + if (!(datacenter == rhs.datacenter)) + return false; + if (__isset.rack != rhs.__isset.rack) + return false; + else if (__isset.rack && !(rack == rhs.rack)) + return false; + return true; + } + bool operator != (const EndpointDetails &rhs) const { + return !(*this == rhs); + } + + bool operator < (const EndpointDetails & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TokenRange__isset { + _TokenRange__isset() : rpc_endpoints(false), endpoint_details(false) {} + bool rpc_endpoints; + bool endpoint_details; +} _TokenRange__isset; + +class TokenRange { + public: + + static const char* ascii_fingerprint; // = "832268DC4CD6B17EE8881FC57EA04679"; + static const uint8_t binary_fingerprint[16]; // = {0x83,0x22,0x68,0xDC,0x4C,0xD6,0xB1,0x7E,0xE8,0x88,0x1F,0xC5,0x7E,0xA0,0x46,0x79}; + + TokenRange() : start_token(""), end_token("") { + } + + virtual ~TokenRange() throw() {} + + std::string start_token; + std::string end_token; + std::vector<std::string> endpoints; + std::vector<std::string> rpc_endpoints; + std::vector<EndpointDetails> endpoint_details; + + _TokenRange__isset __isset; + + void __set_start_token(const std::string& val) { + start_token = val; + } + + void __set_end_token(const std::string& val) { + end_token = val; + } + + void __set_endpoints(const std::vector<std::string> & val) { + endpoints = val; + } + + void __set_rpc_endpoints(const std::vector<std::string> & val) { + rpc_endpoints = val; + __isset.rpc_endpoints = true; + } + + void __set_endpoint_details(const std::vector<EndpointDetails> & val) { + endpoint_details = val; + __isset.endpoint_details = true; + } + + bool operator == (const TokenRange & rhs) const + { + if (!(start_token == rhs.start_token)) + return false; + if (!(end_token == rhs.end_token)) + return false; + if (!(endpoints == rhs.endpoints)) + return false; + if (__isset.rpc_endpoints != rhs.__isset.rpc_endpoints) + return false; + else if (__isset.rpc_endpoints && !(rpc_endpoints == rhs.rpc_endpoints)) + return false; + if (__isset.endpoint_details != rhs.__isset.endpoint_details) + return false; + else if (__isset.endpoint_details && !(endpoint_details == rhs.endpoint_details)) + return false; + return true; + } + bool operator != (const TokenRange &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TokenRange & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class AuthenticationRequest { + public: + + static const char* ascii_fingerprint; // = "5EA2D527ECA3BA20C77AFC023EE8C05F"; + static const uint8_t binary_fingerprint[16]; // = {0x5E,0xA2,0xD5,0x27,0xEC,0xA3,0xBA,0x20,0xC7,0x7A,0xFC,0x02,0x3E,0xE8,0xC0,0x5F}; + + AuthenticationRequest() { + } + + virtual ~AuthenticationRequest() throw() {} + + std::map<std::string, std::string> credentials; + + void __set_credentials(const std::map<std::string, std::string> & val) { + credentials = val; + } + + bool operator == (const AuthenticationRequest & rhs) const + { + if (!(credentials == rhs.credentials)) + return false; + return true; + } + bool operator != (const AuthenticationRequest &rhs) const { + return !(*this == rhs); + } + + bool operator < (const AuthenticationRequest & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _ColumnDef__isset { + _ColumnDef__isset() : index_type(false), index_name(false), index_options(false) {} + bool index_type; + bool index_name; + bool index_options; +} _ColumnDef__isset; + +class ColumnDef { + public: + + static const char* ascii_fingerprint; // = "0D89CE83D7EDAD079AC3213ED1DCAA58"; + static const uint8_t binary_fingerprint[16]; // = {0x0D,0x89,0xCE,0x83,0xD7,0xED,0xAD,0x07,0x9A,0xC3,0x21,0x3E,0xD1,0xDC,0xAA,0x58}; + + ColumnDef() : name(""), validation_class(""), index_type((IndexType::type)0), index_name("") { + } + + virtual ~ColumnDef() throw() {} + + std::string name; + std::string validation_class; + IndexType::type index_type; + std::string index_name; + std::map<std::string, std::string> index_options; + + _ColumnDef__isset __isset; + + void __set_name(const std::string& val) { + name = val; + } + + void __set_validation_class(const std::string& val) { + validation_class = val; + } + + void __set_index_type(const IndexType::type val) { + index_type = val; + __isset.index_type = true; + } + + void __set_index_name(const std::string& val) { + index_name = val; + __isset.index_name = true; + } + + void __set_index_options(const std::map<std::string, std::string> & val) { + index_options = val; + __isset.index_options = true; + } + + bool operator == (const ColumnDef & rhs) const + { + if (!(name == rhs.name)) + return false; + if (!(validation_class == rhs.validation_class)) + return false; + if (__isset.index_type != rhs.__isset.index_type) + return false; + else if (__isset.index_type && !(index_type == rhs.index_type)) + return false; + if (__isset.index_name != rhs.__isset.index_name) + return false; + else if (__isset.index_name && !(index_name == rhs.index_name)) + return false; + if (__isset.index_options != rhs.__isset.index_options) + return false; + else if (__isset.index_options && !(index_options == rhs.index_options)) + return false; + return true; + } + bool operator != (const ColumnDef &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ColumnDef & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _CfDef__isset { + _CfDef__isset() : column_type(false), comparator_type(false), subcomparator_type(false), comment(false), read_repair_chance(false), column_metadata(false), gc_grace_seconds(false), default_validation_class(false), id(false), min_compaction_threshold(false), max_compaction_threshold(false), replicate_on_write(false), key_validation_class(false), key_alias(false), compaction_strategy(false), compaction_strategy_options(false), compression_options(false), bloom_filter_fp_chance(false), caching(false), dclocal_read_repair_chance(false), row_cache_size(false), key_cache_size(false), row_cache_save_period_in_seconds(false), key_cache_save_period_in_seconds(false), memtable_flush_after_mins(false), memtable_throughput_in_mb(false), memtable_operations_in_millions(false), merge_shards_chance(false), row_cache_provider(false), row_cache_keys_to_save(false) {} + bool column_type; + bool comparator_type; + bool subcomparator_type; + bool comment; + bool read_repair_chance; + bool column_metadata; + bool gc_grace_seconds; + bool default_validation_class; + bool id; + bool min_compaction_threshold; + bool max_compaction_threshold; + bool replicate_on_write; + bool key_validation_class; + bool key_alias; + bool compaction_strategy; + bool compaction_strategy_options; + bool compression_options; + bool bloom_filter_fp_chance; + bool caching; + bool dclocal_read_repair_chance; + bool row_cache_size; + bool key_cache_size; + bool row_cache_save_period_in_seconds; + bool key_cache_save_period_in_seconds; + bool memtable_flush_after_mins; + bool memtable_throughput_in_mb; + bool memtable_operations_in_millions; + bool merge_shards_chance; + bool row_cache_provider; + bool row_cache_keys_to_save; +} _CfDef__isset; + +class CfDef { + public: + + static const char* ascii_fingerprint; // = "231A260521B5DD99EFBCCBDD8768CA7D"; + static const uint8_t binary_fingerprint[16]; // = {0x23,0x1A,0x26,0x05,0x21,0xB5,0xDD,0x99,0xEF,0xBC,0xCB,0xDD,0x87,0x68,0xCA,0x7D}; + + CfDef() : keyspace(""), name(""), column_type("Standard"), comparator_type("BytesType"), subcomparator_type(""), comment(""), read_repair_chance(0), gc_grace_seconds(0), default_validation_class(""), id(0), min_compaction_threshold(0), max_compaction_threshold(0), replicate_on_write(0), key_validation_class(""), key_alias(""), compaction_strategy(""), bloom_filter_fp_chance(0), caching("keys_only"), dclocal_read_repair_chance(0), row_cache_size(0), key_cache_size(0), row_cache_save_period_in_seconds(0), key_cache_save_period_in_seconds(0), memtable_flush_after_mins(0), memtable_throughput_in_mb(0), memtable_operations_in_millions(0), merge_shards_chance(0), row_cache_provider(""), row_cache_keys_to_save(0) { + } + + virtual ~CfDef() throw() {} + + std::string keyspace; + std::string name; + std::string column_type; + std::string comparator_type; + std::string subcomparator_type; + std::string comment; + double read_repair_chance; + std::vector<ColumnDef> column_metadata; + int32_t gc_grace_seconds; + std::string default_validation_class; + int32_t id; + int32_t min_compaction_threshold; + int32_t max_compaction_threshold; + bool replicate_on_write; + std::string key_validation_class; + std::string key_alias; + std::string compaction_strategy; + std::map<std::string, std::string> compaction_strategy_options; + std::map<std::string, std::string> compression_options; + double bloom_filter_fp_chance; + std::string caching; + double dclocal_read_repair_chance; + double row_cache_size; + double key_cache_size; + int32_t row_cache_save_period_in_seconds; + int32_t key_cache_save_period_in_seconds; + int32_t memtable_flush_after_mins; + int32_t memtable_throughput_in_mb; + double memtable_operations_in_millions; + double merge_shards_chance; + std::string row_cache_provider; + int32_t row_cache_keys_to_save; + + _CfDef__isset __isset; + + void __set_keyspace(const std::string& val) { + keyspace = val; + } + + void __set_name(const std::string& val) { + name = val; + } + + void __set_column_type(const std::string& val) { + column_type = val; + __isset.column_type = true; + } + + void __set_comparator_type(const std::string& val) { + comparator_type = val; + __isset.comparator_type = true; + } + + void __set_subcomparator_type(const std::string& val) { + subcomparator_type = val; + __isset.subcomparator_type = true; + } + + void __set_comment(const std::string& val) { + comment = val; + __isset.comment = true; + } + + void __set_read_repair_chance(const double val) { + read_repair_chance = val; + __isset.read_repair_chance = true; + } + + void __set_column_metadata(const std::vector<ColumnDef> & val) { + column_metadata = val; + __isset.column_metadata = true; + } + + void __set_gc_grace_seconds(const int32_t val) { + gc_grace_seconds = val; + __isset.gc_grace_seconds = true; + } + + void __set_default_validation_class(const std::string& val) { + default_validation_class = val; + __isset.default_validation_class = true; + } + + void __set_id(const int32_t val) { + id = val; + __isset.id = true; + } + + void __set_min_compaction_threshold(const int32_t val) { + min_compaction_threshold = val; + __isset.min_compaction_threshold = true; + } + + void __set_max_compaction_threshold(const int32_t val) { + max_compaction_threshold = val; + __isset.max_compaction_threshold = true; + } + + void __set_replicate_on_write(const bool val) { + replicate_on_write = val; + __isset.replicate_on_write = true; + } + + void __set_key_validation_class(const std::string& val) { + key_validation_class = val; + __isset.key_validation_class = true; + } + + void __set_key_alias(const std::string& val) { + key_alias = val; + __isset.key_alias = true; + } + + void __set_compaction_strategy(const std::string& val) { + compaction_strategy = val; + __isset.compaction_strategy = true; + } + + void __set_compaction_strategy_options(const std::map<std::string, std::string> & val) { + compaction_strategy_options = val; + __isset.compaction_strategy_options = true; + } + + void __set_compression_options(const std::map<std::string, std::string> & val) { + compression_options = val; + __isset.compression_options = true; + } + + void __set_bloom_filter_fp_chance(const double val) { + bloom_filter_fp_chance = val; + __isset.bloom_filter_fp_chance = true; + } + + void __set_caching(const std::string& val) { + caching = val; + __isset.caching = true; + } + + void __set_dclocal_read_repair_chance(const double val) { + dclocal_read_repair_chance = val; + __isset.dclocal_read_repair_chance = true; + } + + void __set_row_cache_size(const double val) { + row_cache_size = val; + __isset.row_cache_size = true; + } + + void __set_key_cache_size(const double val) { + key_cache_size = val; + __isset.key_cache_size = true; + } + + void __set_row_cache_save_period_in_seconds(const int32_t val) { + row_cache_save_period_in_seconds = val; + __isset.row_cache_save_period_in_seconds = true; + } + + void __set_key_cache_save_period_in_seconds(const int32_t val) { + key_cache_save_period_in_seconds = val; + __isset.key_cache_save_period_in_seconds = true; + } + + void __set_memtable_flush_after_mins(const int32_t val) { + memtable_flush_after_mins = val; + __isset.memtable_flush_after_mins = true; + } + + void __set_memtable_throughput_in_mb(const int32_t val) { + memtable_throughput_in_mb = val; + __isset.memtable_throughput_in_mb = true; + } + + void __set_memtable_operations_in_millions(const double val) { + memtable_operations_in_millions = val; + __isset.memtable_operations_in_millions = true; + } + + void __set_merge_shards_chance(const double val) { + merge_shards_chance = val; + __isset.merge_shards_chance = true; + } + + void __set_row_cache_provider(const std::string& val) { + row_cache_provider = val; + __isset.row_cache_provider = true; + } + + void __set_row_cache_keys_to_save(const int32_t val) { + row_cache_keys_to_save = val; + __isset.row_cache_keys_to_save = true; + } + + bool operator == (const CfDef & rhs) const + { + if (!(keyspace == rhs.keyspace)) + return false; + if (!(name == rhs.name)) + return false; + if (__isset.column_type != rhs.__isset.column_type) + return false; + else if (__isset.column_type && !(column_type == rhs.column_type)) + return false; + if (__isset.comparator_type != rhs.__isset.comparator_type) + return false; + else if (__isset.comparator_type && !(comparator_type == rhs.comparator_type)) + return false; + if (__isset.subcomparator_type != rhs.__isset.subcomparator_type) + return false; + else if (__isset.subcomparator_type && !(subcomparator_type == rhs.subcomparator_type)) + return false; + if (__isset.comment != rhs.__isset.comment) + return false; + else if (__isset.comment && !(comment == rhs.comment)) + return false; + if (__isset.read_repair_chance != rhs.__isset.read_repair_chance) + return false; + else if (__isset.read_repair_chance && !(read_repair_chance == rhs.read_repair_chance)) + return false; + if (__isset.column_metadata != rhs.__isset.column_metadata) + return false; + else if (__isset.column_metadata && !(column_metadata == rhs.column_metadata)) + return false; + if (__isset.gc_grace_seconds != rhs.__isset.gc_grace_seconds) + return false; + else if (__isset.gc_grace_seconds && !(gc_grace_seconds == rhs.gc_grace_seconds)) + return false; + if (__isset.default_validation_class != rhs.__isset.default_validation_class) + return false; + else if (__isset.default_validation_class && !(default_validation_class == rhs.default_validation_class)) + return false; + if (__isset.id != rhs.__isset.id) + return false; + else if (__isset.id && !(id == rhs.id)) + return false; + if (__isset.min_compaction_threshold != rhs.__isset.min_compaction_threshold) + return false; + else if (__isset.min_compaction_threshold && !(min_compaction_threshold == rhs.min_compaction_threshold)) + return false; + if (__isset.max_compaction_threshold != rhs.__isset.max_compaction_threshold) + return false; + else if (__isset.max_compaction_threshold && !(max_compaction_threshold == rhs.max_compaction_threshold)) + return false; + if (__isset.replicate_on_write != rhs.__isset.replicate_on_write) + return false; + else if (__isset.replicate_on_write && !(replicate_on_write == rhs.replicate_on_write)) + return false; + if (__isset.key_validation_class != rhs.__isset.key_validation_class) + return false; + else if (__isset.key_validation_class && !(key_validation_class == rhs.key_validation_class)) + return false; + if (__isset.key_alias != rhs.__isset.key_alias) + return false; + else if (__isset.key_alias && !(key_alias == rhs.key_alias)) + return false; + if (__isset.compaction_strategy != rhs.__isset.compaction_strategy) + return false; + else if (__isset.compaction_strategy && !(compaction_strategy == rhs.compaction_strategy)) + return false; + if (__isset.compaction_strategy_options != rhs.__isset.compaction_strategy_options) + return false; + else if (__isset.compaction_strategy_options && !(compaction_strategy_options == rhs.compaction_strategy_options)) + return false; + if (__isset.compression_options != rhs.__isset.compression_options) + return false; + else if (__isset.compression_options && !(compression_options == rhs.compression_options)) + return false; + if (__isset.bloom_filter_fp_chance != rhs.__isset.bloom_filter_fp_chance) + return false; + else if (__isset.bloom_filter_fp_chance && !(bloom_filter_fp_chance == rhs.bloom_filter_fp_chance)) + return false; + if (__isset.caching != rhs.__isset.caching) + return false; + else if (__isset.caching && !(caching == rhs.caching)) + return false; + if (__isset.dclocal_read_repair_chance != rhs.__isset.dclocal_read_repair_chance) + return false; + else if (__isset.dclocal_read_repair_chance && !(dclocal_read_repair_chance == rhs.dclocal_read_repair_chance)) + return false; + if (__isset.row_cache_size != rhs.__isset.row_cache_size) + return false; + else if (__isset.row_cache_size && !(row_cache_size == rhs.row_cache_size)) + return false; + if (__isset.key_cache_size != rhs.__isset.key_cache_size) + return false; + else if (__isset.key_cache_size && !(key_cache_size == rhs.key_cache_size)) + return false; + if (__isset.row_cache_save_period_in_seconds != rhs.__isset.row_cache_save_period_in_seconds) + return false; + else if (__isset.row_cache_save_period_in_seconds && !(row_cache_save_period_in_seconds == rhs.row_cache_save_period_in_seconds)) + return false; + if (__isset.key_cache_save_period_in_seconds != rhs.__isset.key_cache_save_period_in_seconds) + return false; + else if (__isset.key_cache_save_period_in_seconds && !(key_cache_save_period_in_seconds == rhs.key_cache_save_period_in_seconds)) + return false; + if (__isset.memtable_flush_after_mins != rhs.__isset.memtable_flush_after_mins) + return false; + else if (__isset.memtable_flush_after_mins && !(memtable_flush_after_mins == rhs.memtable_flush_after_mins)) + return false; + if (__isset.memtable_throughput_in_mb != rhs.__isset.memtable_throughput_in_mb) + return false; + else if (__isset.memtable_throughput_in_mb && !(memtable_throughput_in_mb == rhs.memtable_throughput_in_mb)) + return false; + if (__isset.memtable_operations_in_millions != rhs.__isset.memtable_operations_in_millions) + return false; + else if (__isset.memtable_operations_in_millions && !(memtable_operations_in_millions == rhs.memtable_operations_in_millions)) + return false; + if (__isset.merge_shards_chance != rhs.__isset.merge_shards_chance) + return false; + else if (__isset.merge_shards_chance && !(merge_shards_chance == rhs.merge_shards_chance)) + return false; + if (__isset.row_cache_provider != rhs.__isset.row_cache_provider) + return false; + else if (__isset.row_cache_provider && !(row_cache_provider == rhs.row_cache_provider)) + return false; + if (__isset.row_cache_keys_to_save != rhs.__isset.row_cache_keys_to_save) + return false; + else if (__isset.row_cache_keys_to_save && !(row_cache_keys_to_save == rhs.row_cache_keys_to_save)) + return false; + return true; + } + bool operator != (const CfDef &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CfDef & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _KsDef__isset { + _KsDef__isset() : strategy_options(false), replication_factor(false), durable_writes(false) {} + bool strategy_options; + bool replication_factor; + bool durable_writes; +} _KsDef__isset; + +class KsDef { + public: + + static const char* ascii_fingerprint; // = "0767851B6476EB3777A21E59E912E11A"; + static const uint8_t binary_fingerprint[16]; // = {0x07,0x67,0x85,0x1B,0x64,0x76,0xEB,0x37,0x77,0xA2,0x1E,0x59,0xE9,0x12,0xE1,0x1A}; + + KsDef() : name(""), strategy_class(""), replication_factor(0), durable_writes(true) { + } + + virtual ~KsDef() throw() {} + + std::string name; + std::string strategy_class; + std::map<std::string, std::string> strategy_options; + int32_t replication_factor; + std::vector<CfDef> cf_defs; + bool durable_writes; + + _KsDef__isset __isset; + + void __set_name(const std::string& val) { + name = val; + } + + void __set_strategy_class(const std::string& val) { + strategy_class = val; + } + + void __set_strategy_options(const std::map<std::string, std::string> & val) { + strategy_options = val; + __isset.strategy_options = true; + } + + void __set_replication_factor(const int32_t val) { + replication_factor = val; + __isset.replication_factor = true; + } + + void __set_cf_defs(const std::vector<CfDef> & val) { + cf_defs = val; + } + + void __set_durable_writes(const bool val) { + durable_writes = val; + __isset.durable_writes = true; + } + + bool operator == (const KsDef & rhs) const + { + if (!(name == rhs.name)) + return false; + if (!(strategy_class == rhs.strategy_class)) + return false; + if (__isset.strategy_options != rhs.__isset.strategy_options) + return false; + else if (__isset.strategy_options && !(strategy_options == rhs.strategy_options)) + return false; + if (__isset.replication_factor != rhs.__isset.replication_factor) + return false; + else if (__isset.replication_factor && !(replication_factor == rhs.replication_factor)) + return false; + if (!(cf_defs == rhs.cf_defs)) + return false; + if (__isset.durable_writes != rhs.__isset.durable_writes) + return false; + else if (__isset.durable_writes && !(durable_writes == rhs.durable_writes)) + return false; + return true; + } + bool operator != (const KsDef &rhs) const { + return !(*this == rhs); + } + + bool operator < (const KsDef & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class CqlRow { + public: + + static const char* ascii_fingerprint; // = "470EFC558004E98D92D604898305C04E"; + static const uint8_t binary_fingerprint[16]; // = {0x47,0x0E,0xFC,0x55,0x80,0x04,0xE9,0x8D,0x92,0xD6,0x04,0x89,0x83,0x05,0xC0,0x4E}; + + CqlRow() : key("") { + } + + virtual ~CqlRow() throw() {} + + std::string key; + std::vector<Column> columns; + + void __set_key(const std::string& val) { + key = val; + } + + void __set_columns(const std::vector<Column> & val) { + columns = val; + } + + bool operator == (const CqlRow & rhs) const + { + if (!(key == rhs.key)) + return false; + if (!(columns == rhs.columns)) + return false; + return true; + } + bool operator != (const CqlRow &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CqlRow & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class CqlMetadata { + public: + + static const char* ascii_fingerprint; // = "B7C5A4AA9652C744A48EBC1C12D531E7"; + static const uint8_t binary_fingerprint[16]; // = {0xB7,0xC5,0xA4,0xAA,0x96,0x52,0xC7,0x44,0xA4,0x8E,0xBC,0x1C,0x12,0xD5,0x31,0xE7}; + + CqlMetadata() : default_name_type(""), default_value_type("") { + } + + virtual ~CqlMetadata() throw() {} + + std::map<std::string, std::string> name_types; + std::map<std::string, std::string> value_types; + std::string default_name_type; + std::string default_value_type; + + void __set_name_types(const std::map<std::string, std::string> & val) { + name_types = val; + } + + void __set_value_types(const std::map<std::string, std::string> & val) { + value_types = val; + } + + void __set_default_name_type(const std::string& val) { + default_name_type = val; + } + + void __set_default_value_type(const std::string& val) { + default_value_type = val; + } + + bool operator == (const CqlMetadata & rhs) const + { + if (!(name_types == rhs.name_types)) + return false; + if (!(value_types == rhs.value_types)) + return false; + if (!(default_name_type == rhs.default_name_type)) + return false; + if (!(default_value_type == rhs.default_value_type)) + return false; + return true; + } + bool operator != (const CqlMetadata &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CqlMetadata & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _CqlResult__isset { + _CqlResult__isset() : rows(false), num(false), schema(false) {} + bool rows; + bool num; + bool schema; +} _CqlResult__isset; + +class CqlResult { + public: + + static const char* ascii_fingerprint; // = "521B9CE5AF77539F7267F6952B609E81"; + static const uint8_t binary_fingerprint[16]; // = {0x52,0x1B,0x9C,0xE5,0xAF,0x77,0x53,0x9F,0x72,0x67,0xF6,0x95,0x2B,0x60,0x9E,0x81}; + + CqlResult() : type((CqlResultType::type)0), num(0) { + } + + virtual ~CqlResult() throw() {} + + CqlResultType::type type; + std::vector<CqlRow> rows; + int32_t num; + CqlMetadata schema; + + _CqlResult__isset __isset; + + void __set_type(const CqlResultType::type val) { + type = val; + } + + void __set_rows(const std::vector<CqlRow> & val) { + rows = val; + __isset.rows = true; + } + + void __set_num(const int32_t val) { + num = val; + __isset.num = true; + } + + void __set_schema(const CqlMetadata& val) { + schema = val; + __isset.schema = true; + } + + bool operator == (const CqlResult & rhs) const + { + if (!(type == rhs.type)) + return false; + if (__isset.rows != rhs.__isset.rows) + return false; + else if (__isset.rows && !(rows == rhs.rows)) + return false; + if (__isset.num != rhs.__isset.num) + return false; + else if (__isset.num && !(num == rhs.num)) + return false; + if (__isset.schema != rhs.__isset.schema) + return false; + else if (__isset.schema && !(schema == rhs.schema)) + return false; + return true; + } + bool operator != (const CqlResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CqlResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _CqlPreparedResult__isset { + _CqlPreparedResult__isset() : variable_types(false), variable_names(false) {} + bool variable_types; + bool variable_names; +} _CqlPreparedResult__isset; + +class CqlPreparedResult { + public: + + static const char* ascii_fingerprint; // = "7E1663EC688DFDC28722BF36F9F64E6F"; + static const uint8_t binary_fingerprint[16]; // = {0x7E,0x16,0x63,0xEC,0x68,0x8D,0xFD,0xC2,0x87,0x22,0xBF,0x36,0xF9,0xF6,0x4E,0x6F}; + + CqlPreparedResult() : itemId(0), count(0) { + } + + virtual ~CqlPreparedResult() throw() {} + + int32_t itemId; + int32_t count; + std::vector<std::string> variable_types; + std::vector<std::string> variable_names; + + _CqlPreparedResult__isset __isset; + + void __set_itemId(const int32_t val) { + itemId = val; + } + + void __set_count(const int32_t val) { + count = val; + } + + void __set_variable_types(const std::vector<std::string> & val) { + variable_types = val; + __isset.variable_types = true; + } + + void __set_variable_names(const std::vector<std::string> & val) { + variable_names = val; + __isset.variable_names = true; + } + + bool operator == (const CqlPreparedResult & rhs) const + { + if (!(itemId == rhs.itemId)) + return false; + if (!(count == rhs.count)) + return false; + if (__isset.variable_types != rhs.__isset.variable_types) + return false; + else if (__isset.variable_types && !(variable_types == rhs.variable_types)) + return false; + if (__isset.variable_names != rhs.__isset.variable_names) + return false; + else if (__isset.variable_names && !(variable_names == rhs.variable_names)) + return false; + return true; + } + bool operator != (const CqlPreparedResult &rhs) const { + return !(*this == rhs); + } + + bool operator < (const CqlPreparedResult & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +}}} // namespace + +#endif diff --git a/storage/cassandra/ha_cassandra.cc b/storage/cassandra/ha_cassandra.cc new file mode 100644 index 00000000000..e8c5b844e3d --- /dev/null +++ b/storage/cassandra/ha_cassandra.cc @@ -0,0 +1,2619 @@ +/* + Copyright (c) 2012, Monty Program Ab + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef USE_PRAGMA_IMPLEMENTATION +#pragma implementation // gcc: Class implementation +#endif + +#include <mysql/plugin.h> +#include "ha_cassandra.h" +#include "sql_class.h" + +#define DYNCOL_USUAL 20 +#define DYNCOL_DELTA 100 +#define DYNCOL_USUAL_REC 1024 +#define DYNCOL_DELTA_REC 1024 + +static handler *cassandra_create_handler(handlerton *hton, + TABLE_SHARE *table, + MEM_ROOT *mem_root); + +extern int dynamic_column_error_message(enum_dyncol_func_result rc); + +handlerton *cassandra_hton; + + +/* + Hash used to track the number of open tables; variable for example share + methods +*/ +static HASH cassandra_open_tables; + +/* The mutex used to init the hash; variable for example share methods */ +mysql_mutex_t cassandra_mutex; + + +/** + Structure for CREATE TABLE options (table options). + It needs to be called ha_table_option_struct. + + The option values can be specified in the CREATE TABLE at the end: + CREATE TABLE ( ... ) *here* +*/ + +struct ha_table_option_struct +{ + const char *thrift_host; + int thrift_port; + const char *keyspace; + const char *column_family; +}; + + +ha_create_table_option cassandra_table_option_list[]= +{ + /* + one option that takes an arbitrary string + */ + HA_TOPTION_STRING("thrift_host", thrift_host), + HA_TOPTION_NUMBER("thrift_port", thrift_port, 9160, 1, 65535, 0), + HA_TOPTION_STRING("keyspace", keyspace), + HA_TOPTION_STRING("column_family", column_family), + HA_TOPTION_END +}; + +/** + Structure for CREATE TABLE options (field options). +*/ + +struct ha_field_option_struct +{ + bool dyncol_field; +}; + +ha_create_table_option cassandra_field_option_list[]= +{ + /* + Collect all other columns as dynamic here, + the valid values are YES/NO, ON/OFF, 1/0. + The default is 0, that is false, no, off. + */ + HA_FOPTION_BOOL("DYNAMIC_COLUMN_STORAGE", dyncol_field, 0), + HA_FOPTION_END +}; + +static MYSQL_THDVAR_ULONG(insert_batch_size, PLUGIN_VAR_RQCMDARG, + "Number of rows in an INSERT batch", + NULL, NULL, /*default*/ 100, /*min*/ 1, /*max*/ 1024*1024*1024, 0); + +static MYSQL_THDVAR_ULONG(multiget_batch_size, PLUGIN_VAR_RQCMDARG, + "Number of rows in a multiget(MRR) batch", + NULL, NULL, /*default*/ 100, /*min*/ 1, /*max*/ 1024*1024*1024, 0); + +static MYSQL_THDVAR_ULONG(rnd_batch_size, PLUGIN_VAR_RQCMDARG, + "Number of rows in an rnd_read (full scan) batch", + NULL, NULL, /*default*/ 10*1000, /*min*/ 1, /*max*/ 1024*1024*1024, 0); + +static MYSQL_THDVAR_ULONG(failure_retries, PLUGIN_VAR_RQCMDARG, + "Number of times to retry Cassandra calls that failed due to timeouts or " + "network communication problems. The default, 0, means not to retry.", + NULL, NULL, /*default*/ 0, /*min*/ 0, /*max*/ 1024*1024*1024, 0); + +/* These match values in enum_cassandra_consistency_level */ +const char *cassandra_consistency_level[] = +{ + "ONE", + "QUORUM", + "LOCAL_QUORUM", + "EACH_QUORUM", + "ALL", + "ANY", + "TWO", + "THREE", + NullS +}; + +TYPELIB cassandra_consistency_level_typelib= { + array_elements(cassandra_consistency_level) - 1, "", + cassandra_consistency_level, NULL +}; + + +static MYSQL_THDVAR_ENUM(write_consistency, PLUGIN_VAR_RQCMDARG, + "Cassandra consistency level to use for write operations", NULL, NULL, + ONE, &cassandra_consistency_level_typelib); + +static MYSQL_THDVAR_ENUM(read_consistency, PLUGIN_VAR_RQCMDARG, + "Cassandra consistency level to use for read operations", NULL, NULL, + ONE, &cassandra_consistency_level_typelib); + + +mysql_mutex_t cassandra_default_host_lock; +static char* cassandra_default_thrift_host = NULL; +static char cassandra_default_host_buf[256]=""; + +static void +cassandra_default_thrift_host_update(THD *thd, + struct st_mysql_sys_var* var, + void* var_ptr, /*!< out: where the + formal string goes */ + const void* save) /*!< in: immediate result + from check function */ +{ + const char *new_host= *((char**)save); + const size_t max_len= sizeof(cassandra_default_host_buf); + + mysql_mutex_lock(&cassandra_default_host_lock); + + if (new_host) + { + strncpy(cassandra_default_host_buf, new_host, max_len-1); + cassandra_default_host_buf[max_len-1]= 0; + cassandra_default_thrift_host= cassandra_default_host_buf; + } + else + { + cassandra_default_host_buf[0]= 0; + cassandra_default_thrift_host= NULL; + } + + *((const char**)var_ptr)= cassandra_default_thrift_host; + + mysql_mutex_unlock(&cassandra_default_host_lock); +} + + +static MYSQL_SYSVAR_STR(default_thrift_host, cassandra_default_thrift_host, + PLUGIN_VAR_RQCMDARG, + "Default host for Cassandra thrift connections", + /*check*/NULL, + cassandra_default_thrift_host_update, + /*default*/NULL); + +static struct st_mysql_sys_var* cassandra_system_variables[]= { + MYSQL_SYSVAR(insert_batch_size), + MYSQL_SYSVAR(multiget_batch_size), + MYSQL_SYSVAR(rnd_batch_size), + + MYSQL_SYSVAR(default_thrift_host), + MYSQL_SYSVAR(write_consistency), + MYSQL_SYSVAR(read_consistency), + MYSQL_SYSVAR(failure_retries), + NULL +}; + +Cassandra_status_vars cassandra_counters; + +/** + @brief + Function we use in the creation of our hash to get key. +*/ + +static uchar* cassandra_get_key(CASSANDRA_SHARE *share, size_t *length, + my_bool not_used __attribute__((unused))) +{ + *length=share->table_name_length; + return (uchar*) share->table_name; +} + +#ifdef HAVE_PSI_INTERFACE +static PSI_mutex_key ex_key_mutex_example, ex_key_mutex_CASSANDRA_SHARE_mutex; + +static PSI_mutex_info all_cassandra_mutexes[]= +{ + { &ex_key_mutex_example, "cassandra", PSI_FLAG_GLOBAL}, + { &ex_key_mutex_CASSANDRA_SHARE_mutex, "CASSANDRA_SHARE::mutex", 0} +}; + +static void init_cassandra_psi_keys() +{ + const char* category= "cassandra"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_cassandra_mutexes); + PSI_server->register_mutex(category, all_cassandra_mutexes, count); +} +#endif + +static int cassandra_init_func(void *p) +{ + DBUG_ENTER("cassandra_init_func"); + +#ifdef HAVE_PSI_INTERFACE + init_cassandra_psi_keys(); +#endif + + cassandra_hton= (handlerton *)p; + mysql_mutex_init(ex_key_mutex_example, &cassandra_mutex, MY_MUTEX_INIT_FAST); + (void) my_hash_init(&cassandra_open_tables,system_charset_info,32,0,0, + (my_hash_get_key) cassandra_get_key,0,0); + + cassandra_hton->state= SHOW_OPTION_YES; + cassandra_hton->create= cassandra_create_handler; + /* + Don't specify HTON_CAN_RECREATE in flags. re-create is used by TRUNCATE + TABLE to create an *empty* table from scratch. Cassandra table won't be + emptied if re-created. + */ + cassandra_hton->flags= 0; + cassandra_hton->table_options= cassandra_table_option_list; + cassandra_hton->field_options= cassandra_field_option_list; + + mysql_mutex_init(0 /* no instrumentation */, + &cassandra_default_host_lock, MY_MUTEX_INIT_FAST); + + DBUG_RETURN(0); +} + + +static int cassandra_done_func(void *p) +{ + int error= 0; + DBUG_ENTER("cassandra_done_func"); + if (cassandra_open_tables.records) + error= 1; + my_hash_free(&cassandra_open_tables); + mysql_mutex_destroy(&cassandra_mutex); + mysql_mutex_destroy(&cassandra_default_host_lock); + DBUG_RETURN(error); +} + + +/** + @brief + Example of simple lock controls. The "share" it creates is a + structure we will pass to each cassandra handler. Do you have to have + one of these? Well, you have pieces that are used for locking, and + they are needed to function. +*/ + +static CASSANDRA_SHARE *get_share(const char *table_name, TABLE *table) +{ + CASSANDRA_SHARE *share; + uint length; + char *tmp_name; + + mysql_mutex_lock(&cassandra_mutex); + length=(uint) strlen(table_name); + + if (!(share=(CASSANDRA_SHARE*) my_hash_search(&cassandra_open_tables, + (uchar*) table_name, + length))) + { + if (!(share=(CASSANDRA_SHARE *) + my_multi_malloc(MYF(MY_WME | MY_ZEROFILL), + &share, sizeof(*share), + &tmp_name, length+1, + NullS))) + { + mysql_mutex_unlock(&cassandra_mutex); + return NULL; + } + + share->use_count=0; + share->table_name_length=length; + share->table_name=tmp_name; + strmov(share->table_name,table_name); + if (my_hash_insert(&cassandra_open_tables, (uchar*) share)) + goto error; + thr_lock_init(&share->lock); + mysql_mutex_init(ex_key_mutex_CASSANDRA_SHARE_mutex, + &share->mutex, MY_MUTEX_INIT_FAST); + } + share->use_count++; + mysql_mutex_unlock(&cassandra_mutex); + + return share; + +error: + mysql_mutex_destroy(&share->mutex); + my_free(share); + + return NULL; +} + + +/** + @brief + Free lock controls. We call this whenever we close a table. If the table had + the last reference to the share, then we free memory associated with it. +*/ + +static int free_share(CASSANDRA_SHARE *share) +{ + mysql_mutex_lock(&cassandra_mutex); + if (!--share->use_count) + { + my_hash_delete(&cassandra_open_tables, (uchar*) share); + thr_lock_delete(&share->lock); + mysql_mutex_destroy(&share->mutex); + my_free(share); + } + mysql_mutex_unlock(&cassandra_mutex); + + return 0; +} + + +static handler* cassandra_create_handler(handlerton *hton, + TABLE_SHARE *table, + MEM_ROOT *mem_root) +{ + return new (mem_root) ha_cassandra(hton, table); +} + + +ha_cassandra::ha_cassandra(handlerton *hton, TABLE_SHARE *table_arg) + :handler(hton, table_arg), + se(NULL), field_converters(NULL), + special_type_field_converters(NULL), + special_type_field_names(NULL), n_special_type_fields(0), + rowkey_converter(NULL), + dyncol_field(0), dyncol_set(0) +{} + + +static const char *ha_cassandra_exts[] = { + NullS +}; + +const char **ha_cassandra::bas_ext() const +{ + return ha_cassandra_exts; +} + + +int ha_cassandra::connect_and_check_options(TABLE *table_arg) +{ + ha_table_option_struct *options= table_arg->s->option_struct; + int res; + DBUG_ENTER("ha_cassandra::connect_and_check_options"); + + if ((res= check_field_options(table_arg->s->field)) || + (res= check_table_options(options))) + DBUG_RETURN(res); + + se= create_cassandra_se(); + se->set_column_family(options->column_family); + const char *thrift_host= options->thrift_host? options->thrift_host: + cassandra_default_thrift_host; + if (se->connect(thrift_host, options->thrift_port, options->keyspace)) + { + my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), se->error_str()); + DBUG_RETURN(HA_ERR_NO_CONNECTION); + } + + if (setup_field_converters(table_arg->field, table_arg->s->fields)) + { + DBUG_RETURN(HA_ERR_NO_CONNECTION); + } + + DBUG_RETURN(0); +} + + +int ha_cassandra::check_field_options(Field **fields) +{ + Field **field; + uint i; + DBUG_ENTER("ha_cassandra::check_field_options"); + for (field= fields, i= 0; *field; field++, i++) + { + ha_field_option_struct *field_options= (*field)->option_struct; + if (field_options && field_options->dyncol_field) + { + if (dyncol_set || (*field)->type() != MYSQL_TYPE_BLOB) + { + my_error(ER_WRONG_FIELD_SPEC, MYF(0), (*field)->field_name); + DBUG_RETURN(HA_WRONG_CREATE_OPTION); + } + dyncol_set= 1; + dyncol_field= i; + bzero(&dynamic_values, sizeof(dynamic_values)); + bzero(&dynamic_names, sizeof(dynamic_names)); + bzero(&dynamic_rec, sizeof(dynamic_rec)); + } + } + DBUG_RETURN(0); +} + + +int ha_cassandra::open(const char *name, int mode, uint test_if_locked) +{ + DBUG_ENTER("ha_cassandra::open"); + + if (!(share = get_share(name, table))) + DBUG_RETURN(1); + thr_lock_data_init(&share->lock,&lock,NULL); + + DBUG_ASSERT(!se); + /* + Don't do the following on open: it prevents SHOW CREATE TABLE when the server + has gone away. + */ + /* + int res; + if ((res= connect_and_check_options(table))) + { + DBUG_RETURN(res); + } + */ + + info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST); + insert_lineno= 0; + + DBUG_RETURN(0); +} + + +int ha_cassandra::close(void) +{ + DBUG_ENTER("ha_cassandra::close"); + delete se; + se= NULL; + free_field_converters(); + DBUG_RETURN(free_share(share)); +} + + +int ha_cassandra::check_table_options(ha_table_option_struct *options) +{ + if (!options->thrift_host && (!cassandra_default_thrift_host || + !cassandra_default_thrift_host[0])) + { + my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), + "thrift_host table option must be specified, or " + "@@cassandra_default_thrift_host must be set"); + return HA_WRONG_CREATE_OPTION; + } + + if (!options->keyspace || !options->column_family) + { + my_error(ER_CONNECT_TO_FOREIGN_DATA_SOURCE, MYF(0), + "keyspace and column_family table options must be specified"); + return HA_WRONG_CREATE_OPTION; + } + return 0; +} + + +/** + @brief + create() is called to create a table. The variable name will have the name + of the table. + + @details + When create() is called you do not need to worry about + opening the table. Also, the .frm file will have already been + created so adjusting create_info is not necessary. You can overwrite + the .frm file at this point if you wish to change the table + definition, but there are no methods currently provided for doing + so. + + Called from handle.cc by ha_create_table(). + + @see + ha_create_table() in handle.cc +*/ + +int ha_cassandra::create(const char *name, TABLE *table_arg, + HA_CREATE_INFO *create_info) +{ + int res; + DBUG_ENTER("ha_cassandra::create"); + + if (table_arg->s->keys != 1 || table_arg->s->primary_key !=0 || + table_arg->key_info[0].key_parts != 1 || + table_arg->key_info[0].key_part[0].fieldnr != 1) + { + my_error(ER_WRONG_COLUMN_NAME, MYF(0), + "Table must have PRIMARY KEY defined over the first column"); + DBUG_RETURN(HA_WRONG_CREATE_OPTION); + } + + DBUG_ASSERT(!se); + if ((res= connect_and_check_options(table_arg))) + DBUG_RETURN(res); + + insert_lineno= 0; + DBUG_RETURN(0); +} + +/* + Mapping needs to + - copy value from MySQL record to Thrift buffer + - copy value from Thrift bufer to MySQL record.. + +*/ + +/* Converter base */ +class ColumnDataConverter +{ +public: + Field *field; + + /* This will save Cassandra's data in the Field */ + virtual int cassandra_to_mariadb(const char *cass_data, + int cass_data_len)=0; + + /* + This will get data from the Field pointer, store Cassandra's form + in internal buffer, and return pointer/size. + + @return + false - OK + true - Failed to convert value (completely, there is no value to insert + at all). + */ + virtual bool mariadb_to_cassandra(char **cass_data, int *cass_data_len)=0; + virtual ~ColumnDataConverter() {}; +}; + + +class DoubleDataConverter : public ColumnDataConverter +{ + double buf; +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + DBUG_ASSERT(cass_data_len == sizeof(double)); + double *pdata= (double*) cass_data; + field->store(*pdata); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + buf= field->val_real(); + *cass_data= (char*)&buf; + *cass_data_len=sizeof(double); + return false; + } + ~DoubleDataConverter(){} +}; + + +class FloatDataConverter : public ColumnDataConverter +{ + float buf; +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + DBUG_ASSERT(cass_data_len == sizeof(float)); + float *pdata= (float*) cass_data; + field->store(*pdata); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + buf= field->val_real(); + *cass_data= (char*)&buf; + *cass_data_len=sizeof(float); + return false; + } + ~FloatDataConverter(){} +}; + +static void flip64(const char *from, char* to) +{ + to[0]= from[7]; + to[1]= from[6]; + to[2]= from[5]; + to[3]= from[4]; + to[4]= from[3]; + to[5]= from[2]; + to[6]= from[1]; + to[7]= from[0]; +} + +class BigintDataConverter : public ColumnDataConverter +{ + longlong buf; + bool flip; /* is false when reading counter columns */ +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + longlong tmp; + DBUG_ASSERT(cass_data_len == sizeof(longlong)); + if (flip) + flip64(cass_data, (char*)&tmp); + else + memcpy(&tmp, cass_data, sizeof(longlong)); + field->store(tmp); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + longlong tmp= field->val_int(); + if (flip) + flip64((const char*)&tmp, (char*)&buf); + else + memcpy(&buf, &tmp, sizeof(longlong)); + *cass_data= (char*)&buf; + *cass_data_len=sizeof(longlong); + return false; + } + BigintDataConverter(bool flip_arg) : flip(flip_arg) {} + ~BigintDataConverter(){} +}; + +static void flip32(const char *from, char* to) +{ + to[0]= from[3]; + to[1]= from[2]; + to[2]= from[1]; + to[3]= from[0]; +} + + +class TinyintDataConverter : public ColumnDataConverter +{ + char buf; +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + DBUG_ASSERT(cass_data_len == 1); + field->store(cass_data[0]); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + buf= field->val_int()? 1 : 0; /* TODO: error handling? */ + *cass_data= (char*)&buf; + *cass_data_len= 1; + return false; + } + ~TinyintDataConverter(){} +}; + + +class Int32DataConverter : public ColumnDataConverter +{ + int32_t buf; +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + int32_t tmp; + DBUG_ASSERT(cass_data_len == sizeof(int32_t)); + flip32(cass_data, (char*)&tmp); + field->store(tmp); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + int32_t tmp= field->val_int(); + flip32((const char*)&tmp, (char*)&buf); + *cass_data= (char*)&buf; + *cass_data_len=sizeof(int32_t); + return false; + } + ~Int32DataConverter(){} +}; + + +class StringCopyConverter : public ColumnDataConverter +{ + String buf; + size_t max_length; +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + if ((size_t)cass_data_len > max_length) + return 1; + field->store(cass_data, cass_data_len,field->charset()); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + String *pstr= field->val_str(&buf); + *cass_data= (char*)pstr->ptr(); + *cass_data_len= pstr->length(); + return false; + } + StringCopyConverter(size_t max_length_arg) : max_length(max_length_arg) {} + ~StringCopyConverter(){} +}; + + +class TimestampDataConverter : public ColumnDataConverter +{ + int64_t buf; +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + /* Cassandra data is milliseconds-since-epoch in network byte order */ + int64_t tmp; + DBUG_ASSERT(cass_data_len==8); + flip64(cass_data, (char*)&tmp); + /* + store_TIME's arguments: + - seconds since epoch + - microsecond fraction of a second. + */ + ((Field_timestamp*)field)->store_TIME(tmp / 1000, (tmp % 1000)*1000); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + my_time_t ts_time; + ulong ts_microsec; + int64_t tmp; + ts_time= ((Field_timestamp*)field)->get_timestamp(&ts_microsec); + + /* Cassandra needs milliseconds-since-epoch */ + tmp= ((int64_t)ts_time) * 1000 + ts_microsec/1000; + flip64((const char*)&tmp, (char*)&buf); + + *cass_data= (char*)&buf; + *cass_data_len= 8; + return false; + } + ~TimestampDataConverter(){} +}; + + + +static int convert_hex_digit(const char c) +{ + int num; + if (c >= '0' && c <= '9') + num= c - '0'; + else if (c >= 'A' && c <= 'F') + num= c - 'A' + 10; + else if (c >= 'a' && c <= 'f') + num= c - 'a' + 10; + else + return -1; /* Couldn't convert */ + return num; +} + + +const char map2number[]="0123456789abcdef"; + +static void convert_uuid2string(char *str, const char *cass_data) +{ + char *ptr= str; + /* UUID arrives as 16-byte number in network byte order */ + for (uint i=0; i < 16; i++) + { + *(ptr++)= map2number[(cass_data[i] >> 4) & 0xF]; + *(ptr++)= map2number[cass_data[i] & 0xF]; + if (i == 3 || i == 5 || i == 7 || i == 9) + *(ptr++)= '-'; + } + *ptr= 0; +} + +static bool convert_string2uuid(char *buf, const char *str) +{ + int lower, upper; + for (uint i= 0; i < 16; i++) + { + if ((upper= convert_hex_digit(str[0])) == -1 || + (lower= convert_hex_digit(str[1])) == -1) + { + return true; + } + buf[i]= lower | (upper << 4); + str += 2; + if (i == 3 || i == 5 || i == 7 || i == 9) + { + if (str[0] != '-') + return true; + str++; + } + } + return false; +} + + +class UuidDataConverter : public ColumnDataConverter +{ + char buf[16]; /* Binary UUID representation */ + String str_buf; +public: + int cassandra_to_mariadb(const char *cass_data, int cass_data_len) + { + DBUG_ASSERT(cass_data_len==16); + char str[37]; + convert_uuid2string(str, cass_data); + field->store(str, 36,field->charset()); + return 0; + } + + bool mariadb_to_cassandra(char **cass_data, int *cass_data_len) + { + String *uuid_str= field->val_str(&str_buf); + + if (uuid_str->length() != 36) + return true; + + if (convert_string2uuid(buf, (char*)uuid_str->c_ptr())) + return true; + *cass_data= buf; + *cass_data_len= 16; + return false; + } + ~UuidDataConverter(){} +}; + +/** + Converting dynamic columns types to/from casandra types +*/ + + +/** + Check and initialize (if it is needed) string MEM_ROOT +*/ +static void alloc_strings_memroot(MEM_ROOT *mem_root) +{ + if (!alloc_root_inited(mem_root)) + { + /* + The mem_root used to allocate UUID (of length 36 + \0) so make + appropriate allocated size + */ + init_alloc_root(mem_root, + (36 + 1 + ALIGN_SIZE(sizeof(USED_MEM))) * 10 + + ALLOC_ROOT_MIN_BLOCK_SIZE, + (36 + 1 + ALIGN_SIZE(sizeof(USED_MEM))) * 10 + + ALLOC_ROOT_MIN_BLOCK_SIZE, MYF(MY_THREAD_SPECIFIC)); + } +} + +static void free_strings_memroot(MEM_ROOT *mem_root) +{ + if (alloc_root_inited(mem_root)) + free_root(mem_root, MYF(0)); +} + +bool cassandra_to_dyncol_intLong(const char *cass_data, + int cass_data_len __attribute__((unused)), + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + value->type= DYN_COL_INT; +#ifdef WORDS_BIGENDIAN + value->x.long_value= (longlong *)*cass_data; +#else + flip64(cass_data, (char *)&value->x.long_value); +#endif + return 0; +} + +bool dyncol_to_cassandraLong(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + longlong *tmp= (longlong *) buff; + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_long(tmp, value); + if (rc < 0) + return true; + *cass_data_len= sizeof(longlong); +#ifdef WORDS_BIGENDIAN + *cass_data= (char *)buff; +#else + flip64((char *)buff, (char *)buff + sizeof(longlong)); + *cass_data= (char *)buff + sizeof(longlong); +#endif + *freemem= NULL; + return false; +} + +bool cassandra_to_dyncol_intInt32(const char *cass_data, + int cass_data_len __attribute__((unused)), + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + int32 tmp; + value->type= DYN_COL_INT; +#ifdef WORDS_BIGENDIAN + tmp= *((int32 *)cass_data); +#else + flip32(cass_data, (char *)&tmp); +#endif + value->x.long_value= tmp; + return 0; +} + + +bool dyncol_to_cassandraInt32(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + longlong *tmp= (longlong *) ((char *)buff + sizeof(longlong)); + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_long(tmp, value); + if (rc < 0) + return true; + *cass_data_len= sizeof(int32); + *cass_data= (char *)buff; +#ifdef WORDS_BIGENDIAN + *((int32 *) buff) = (int32) *tmp; +#else + { + int32 tmp2= (int32) *tmp; + flip32((char *)&tmp2, (char *)buff); + } +#endif + *freemem= NULL; + return false; +} + + +bool cassandra_to_dyncol_intCounter(const char *cass_data, + int cass_data_len __attribute__((unused)), + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + value->type= DYN_COL_INT; + value->x.long_value= *((longlong *)cass_data); + return 0; +} + + +bool dyncol_to_cassandraCounter(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + longlong *tmp= (longlong *)buff; + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_long(tmp, value); + if (rc < 0) + return true; + *cass_data_len= sizeof(longlong); + *cass_data= (char *)buff; + *freemem= NULL; + return false; +} + +bool cassandra_to_dyncol_doubleFloat(const char *cass_data, + int cass_data_len __attribute__((unused)), + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + value->type= DYN_COL_DOUBLE; + value->x.double_value= *((float *)cass_data); + return 0; +} + +bool dyncol_to_cassandraFloat(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + double tmp; + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_double(&tmp, value); + if (rc < 0) + return true; + *((float *)buff)= (float) tmp; + *cass_data_len= sizeof(float); + *cass_data= (char *)buff; + *freemem= NULL; + return false; +} + +bool cassandra_to_dyncol_doubleDouble(const char *cass_data, + int cass_data_len __attribute__((unused)), + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root + __attribute__((unused))) +{ + value->type= DYN_COL_DOUBLE; + value->x.double_value= *((double *)cass_data); + return 0; +} + +bool dyncol_to_cassandraDouble(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + double *tmp= (double *)buff; + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_double(tmp, value); + if (rc < 0) + return true; + *cass_data_len= sizeof(double); + *cass_data= (char *)buff; + *freemem= NULL; + return false; +} + +bool cassandra_to_dyncol_strStr(const char *cass_data, + int cass_data_len, + DYNAMIC_COLUMN_VALUE *value, + CHARSET_INFO *cs) +{ + value->type= DYN_COL_STRING; + value->x.string.charset= cs; + value->x.string.value.str= (char *)cass_data; + value->x.string.value.length= cass_data_len; + return 0; +} + +bool dyncol_to_cassandraStr(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem, CHARSET_INFO *cs) +{ + DYNAMIC_STRING tmp; + if (init_dynamic_string(&tmp, NULL, 1024, 1024)) + return 1; + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_str(&tmp, value, cs, '\0'); + if (rc < 0) + { + dynstr_free(&tmp); + return 1; + } + *cass_data_len= tmp.length; + *(cass_data)= tmp.str; + *freemem= tmp.str; + return 0; +} + +bool cassandra_to_dyncol_strBytes(const char *cass_data, + int cass_data_len, + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + return cassandra_to_dyncol_strStr(cass_data, cass_data_len, value, + &my_charset_bin); +} + +bool dyncol_to_cassandraBytes(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + return dyncol_to_cassandraStr(value, cass_data, cass_data_len, + buff, freemem, &my_charset_bin); +} + +bool cassandra_to_dyncol_strAscii(const char *cass_data, + int cass_data_len, + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + return cassandra_to_dyncol_strStr(cass_data, cass_data_len, value, + &my_charset_latin1_bin); +} + +bool dyncol_to_cassandraAscii(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + return dyncol_to_cassandraStr(value, cass_data, cass_data_len, + buff, freemem, &my_charset_latin1_bin); +} + +bool cassandra_to_dyncol_strUTF8(const char *cass_data, + int cass_data_len, + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + return cassandra_to_dyncol_strStr(cass_data, cass_data_len, value, + &my_charset_utf8_unicode_ci); +} + +bool dyncol_to_cassandraUTF8(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + return dyncol_to_cassandraStr(value, cass_data, cass_data_len, + buff, freemem, &my_charset_utf8_unicode_ci); +} + +bool cassandra_to_dyncol_strUUID(const char *cass_data, + int cass_data_len, + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root) +{ + value->type= DYN_COL_STRING; + value->x.string.charset= &my_charset_bin; + alloc_strings_memroot(mem_root); + value->x.string.value.str= (char *)alloc_root(mem_root, 37); + if (!value->x.string.value.str) + { + value->x.string.value.length= 0; + return 1; + } + convert_uuid2string(value->x.string.value.str, cass_data); + value->x.string.value.length= 36; + return 0; +} + +bool dyncol_to_cassandraUUID(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + DYNAMIC_STRING tmp; + if (init_dynamic_string(&tmp, NULL, 1024, 1024)) + return true; + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_str(&tmp, value, &my_charset_latin1_bin, '\0'); + if (rc < 0 || tmp.length != 36 || convert_string2uuid((char *)buff, tmp.str)) + { + dynstr_free(&tmp); + return true; + } + + *cass_data_len= tmp.length; + *(cass_data)= tmp.str; + *freemem= tmp.str; + return 0; +} + +bool cassandra_to_dyncol_intBool(const char *cass_data, + int cass_data_len, + DYNAMIC_COLUMN_VALUE *value, + MEM_ROOT *mem_root __attribute__((unused))) +{ + value->type= DYN_COL_INT; + value->x.long_value= (cass_data[0] ? 1 : 0); + return 0; +} + +bool dyncol_to_cassandraBool(DYNAMIC_COLUMN_VALUE *value, + char **cass_data, int *cass_data_len, + void* buff, void **freemem) +{ + longlong tmp; + enum enum_dyncol_func_result rc= + mariadb_dyncol_val_long(&tmp, value); + if (rc < 0) + return true; + ((char *)buff)[0]= (tmp ? 1 : 0); + *cass_data_len= 1; + *(cass_data)= (char *)buff; + *freemem= 0; + return 0; +} + + +const char * const validator_bigint= "org.apache.cassandra.db.marshal.LongType"; +const char * const validator_int= "org.apache.cassandra.db.marshal.Int32Type"; +const char * const validator_counter= "org.apache.cassandra.db.marshal.CounterColumnType"; + +const char * const validator_float= "org.apache.cassandra.db.marshal.FloatType"; +const char * const validator_double= "org.apache.cassandra.db.marshal.DoubleType"; + +const char * const validator_blob= "org.apache.cassandra.db.marshal.BytesType"; +const char * const validator_ascii= "org.apache.cassandra.db.marshal.AsciiType"; +const char * const validator_text= "org.apache.cassandra.db.marshal.UTF8Type"; + +const char * const validator_timestamp="org.apache.cassandra.db.marshal.DateType"; + +const char * const validator_uuid= "org.apache.cassandra.db.marshal.UUIDType"; + +const char * const validator_boolean= "org.apache.cassandra.db.marshal.BooleanType"; + +/* VARINTs are stored as big-endian big numbers. */ +const char * const validator_varint= "org.apache.cassandra.db.marshal.IntegerType"; +const char * const validator_decimal= "org.apache.cassandra.db.marshal.DecimalType"; + + +static CASSANDRA_TYPE_DEF cassandra_types[]= +{ + { + validator_bigint, + &cassandra_to_dyncol_intLong, + &dyncol_to_cassandraLong + }, + { + validator_int, + &cassandra_to_dyncol_intInt32, + &dyncol_to_cassandraInt32 + }, + { + validator_counter, + cassandra_to_dyncol_intCounter, + &dyncol_to_cassandraCounter + }, + { + validator_float, + &cassandra_to_dyncol_doubleFloat, + &dyncol_to_cassandraFloat + }, + { + validator_double, + &cassandra_to_dyncol_doubleDouble, + &dyncol_to_cassandraDouble + }, + { + validator_blob, + &cassandra_to_dyncol_strBytes, + &dyncol_to_cassandraBytes + }, + { + validator_ascii, + &cassandra_to_dyncol_strAscii, + &dyncol_to_cassandraAscii + }, + { + validator_text, + &cassandra_to_dyncol_strUTF8, + &dyncol_to_cassandraUTF8 + }, + { + validator_timestamp, + &cassandra_to_dyncol_intLong, + &dyncol_to_cassandraLong + }, + { + validator_uuid, + &cassandra_to_dyncol_strUUID, + &dyncol_to_cassandraUUID + }, + { + validator_boolean, + &cassandra_to_dyncol_intBool, + &dyncol_to_cassandraBool + }, + { + validator_varint, + &cassandra_to_dyncol_strBytes, + &dyncol_to_cassandraBytes + }, + { + validator_decimal, + &cassandra_to_dyncol_strBytes, + &dyncol_to_cassandraBytes + } +}; + +CASSANDRA_TYPE get_cassandra_type(const char *validator) +{ + CASSANDRA_TYPE rc; + switch(validator[32]) + { + case 'L': + rc= CT_BIGINT; + break; + case 'I': + rc= (validator[35] == '3' ? CT_INT : CT_VARINT); + rc= CT_INT; + break; + case 'C': + rc= CT_COUNTER; + break; + case 'F': + rc= CT_FLOAT; + break; + case 'D': + switch (validator[33]) + { + case 'o': + rc= CT_DOUBLE; + break; + case 'a': + rc= CT_TIMESTAMP; + break; + case 'e': + rc= CT_DECIMAL; + break; + default: + rc= CT_BLOB; + break; + } + break; + case 'B': + rc= (validator[33] == 'o' ? CT_BOOLEAN : CT_BLOB); + break; + case 'A': + rc= CT_ASCII; + break; + case 'U': + rc= (validator[33] == 'T' ? CT_TEXT : CT_UUID); + break; + default: + rc= CT_BLOB; + } + DBUG_ASSERT(strcmp(cassandra_types[rc].name, validator) == 0); + return rc; +} + +ColumnDataConverter *map_field_to_validator(Field *field, const char *validator_name) +{ + ColumnDataConverter *res= NULL; + + switch(field->type()) { + case MYSQL_TYPE_TINY: + if (!strcmp(validator_name, validator_boolean)) + { + res= new TinyintDataConverter; + break; + } + /* fall through: */ + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_LONGLONG: + { + bool is_counter= false; + if (!strcmp(validator_name, validator_bigint) || + !strcmp(validator_name, validator_timestamp) || + (is_counter= !strcmp(validator_name, validator_counter))) + res= new BigintDataConverter(!is_counter); + break; + } + case MYSQL_TYPE_FLOAT: + if (!strcmp(validator_name, validator_float)) + res= new FloatDataConverter; + break; + + case MYSQL_TYPE_DOUBLE: + if (!strcmp(validator_name, validator_double)) + res= new DoubleDataConverter; + break; + + case MYSQL_TYPE_TIMESTAMP: + if (!strcmp(validator_name, validator_timestamp)) + res= new TimestampDataConverter; + break; + + case MYSQL_TYPE_STRING: // these are space padded CHAR(n) strings. + if (!strcmp(validator_name, validator_uuid) && + field->real_type() == MYSQL_TYPE_STRING && + field->field_length == 36) + { + // UUID maps to CHAR(36), its text representation + res= new UuidDataConverter; + break; + } + /* fall through: */ + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_VARCHAR: + { + /* + Cassandra's "varint" type is a binary-encoded arbitary-length + big-endian number. + - It can be mapped to VARBINARY(N), with sufficiently big N. + - If the value does not fit into N bytes, it is an error. We should not + truncate it, because that is just as good as returning garbage. + - varint should not be mapped to BINARY(N), because BINARY(N) values + are zero-padded, which will work as multiplying the value by + 2^k for some value of k. + */ + if (field->type() == MYSQL_TYPE_VARCHAR && + field->binary() && + (!strcmp(validator_name, validator_varint) || + !strcmp(validator_name, validator_decimal))) + { + res= new StringCopyConverter(field->field_length); + break; + } + + if (!strcmp(validator_name, validator_blob) || + !strcmp(validator_name, validator_ascii) || + !strcmp(validator_name, validator_text)) + { + res= new StringCopyConverter((size_t)-1); + } + break; + } + case MYSQL_TYPE_LONG: + if (!strcmp(validator_name, validator_int)) + res= new Int32DataConverter; + break; + + default:; + } + return res; +} + + +bool ha_cassandra::setup_field_converters(Field **field_arg, uint n_fields) +{ + char *col_name; + int col_name_len; + char *col_type; + int col_type_len; + size_t ddl_fields= se->get_ddl_size(); + const char *default_type= se->get_default_validator(); + uint max_non_default_fields; + DBUG_ENTER("ha_cassandra::setup_field_converters"); + DBUG_ASSERT(default_type); + + DBUG_ASSERT(!field_converters); + DBUG_ASSERT(dyncol_set == 0 || dyncol_set == 1); + + /* + We always should take into account that in case of using dynamic columns + sql description contain one field which does not described in + Cassandra DDL also key field is described separately. So that + is why we use "n_fields - dyncol_set - 1" or "ddl_fields + 2". + */ + max_non_default_fields= ddl_fields + 2 - n_fields; + if (ddl_fields < (n_fields - dyncol_set - 1)) + { + se->print_error("Some of SQL fields were not mapped to Cassandra's fields"); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + DBUG_RETURN(true); + } + + /* allocate memory in one chunk */ + size_t memsize= sizeof(ColumnDataConverter*) * n_fields + + (sizeof(LEX_STRING) + sizeof(CASSANDRA_TYPE_DEF))* + (dyncol_set ? max_non_default_fields : 0); + if (!(field_converters= (ColumnDataConverter**)my_malloc(memsize, MYF(0)))) + DBUG_RETURN(true); + bzero(field_converters, memsize); + n_field_converters= n_fields; + + if (dyncol_set) + { + special_type_field_converters= + (CASSANDRA_TYPE_DEF *)(field_converters + n_fields); + special_type_field_names= + ((LEX_STRING*)(special_type_field_converters + max_non_default_fields)); + + if (my_init_dynamic_array(&dynamic_values, + sizeof(DYNAMIC_COLUMN_VALUE), + DYNCOL_USUAL, DYNCOL_DELTA, MYF(0))) + DBUG_RETURN(true); + else + if (my_init_dynamic_array(&dynamic_names, + sizeof(LEX_STRING), + DYNCOL_USUAL, DYNCOL_DELTA,MYF(0))) + { + delete_dynamic(&dynamic_values); + DBUG_RETURN(true); + } + else + if (init_dynamic_string(&dynamic_rec, NULL, + DYNCOL_USUAL_REC, DYNCOL_DELTA_REC)) + { + delete_dynamic(&dynamic_values); + delete_dynamic(&dynamic_names); + DBUG_RETURN(true); + } + + /* Dynamic column field has special processing */ + field_converters[dyncol_field]= NULL; + + default_type_def= cassandra_types + get_cassandra_type(default_type); + } + + se->first_ddl_column(); + uint n_mapped= 0; + while (!se->next_ddl_column(&col_name, &col_name_len, &col_type, + &col_type_len)) + { + Field **field; + uint i; + /* Mapping for the 1st field is already known */ + for (field= field_arg + 1, i= 1; *field; field++, i++) + { + if ((!dyncol_set || dyncol_field != i) && + !strcmp((*field)->field_name, col_name)) + { + n_mapped++; + ColumnDataConverter **conv= field_converters + (*field)->field_index; + if (!(*conv= map_field_to_validator(*field, col_type))) + { + se->print_error("Failed to map column %s to datatype %s", + (*field)->field_name, col_type); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + DBUG_RETURN(true); + } + (*conv)->field= *field; + break; + } + } + if (dyncol_set && !(*field)) // is needed and not found + { + DBUG_PRINT("info",("Field not found: %s", col_name)); + if (strcmp(col_type, default_type)) + { + DBUG_PRINT("info",("Field '%s' non-default type: '%s'", + col_name, col_type)); + special_type_field_names[n_special_type_fields].length= col_name_len; + special_type_field_names[n_special_type_fields].str= col_name; + special_type_field_converters[n_special_type_fields]= + cassandra_types[get_cassandra_type(col_type)]; + n_special_type_fields++; + } + } + } + + if (n_mapped != n_fields - 1 - dyncol_set) + { + Field *first_unmapped= NULL; + /* Find the first field */ + for (uint i= 1; i < n_fields;i++) + { + if (!field_converters[i]) + { + first_unmapped= field_arg[i]; + break; + } + } + DBUG_ASSERT(first_unmapped); + + se->print_error("Field `%s` could not be mapped to any field in Cassandra", + first_unmapped->field_name); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + DBUG_RETURN(true); + } + + /* + Setup type conversion for row_key. + */ + se->get_rowkey_type(&col_name, &col_type); + if (col_name && strcmp(col_name, (*field_arg)->field_name)) + { + se->print_error("PRIMARY KEY column must match Cassandra's name '%s'", + col_name); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + DBUG_RETURN(true); + } + if (!col_name && strcmp("rowkey", (*field_arg)->field_name)) + { + se->print_error("target column family has no key_alias defined, " + "PRIMARY KEY column must be named 'rowkey'"); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + DBUG_RETURN(true); + } + + if (col_type != NULL) + { + if (!(rowkey_converter= map_field_to_validator(*field_arg, col_type))) + { + se->print_error("Failed to map PRIMARY KEY to datatype %s", col_type); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + DBUG_RETURN(true); + } + rowkey_converter->field= *field_arg; + } + else + { + se->print_error("Cassandra's rowkey has no defined datatype (todo: support this)"); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + DBUG_RETURN(true); + } + + DBUG_RETURN(false); +} + + +void ha_cassandra::free_field_converters() +{ + delete rowkey_converter; + rowkey_converter= NULL; + + if (dyncol_set) + { + delete_dynamic(&dynamic_values); + delete_dynamic(&dynamic_names); + dynstr_free(&dynamic_rec); + } + if (field_converters) + { + for (uint i=0; i < n_field_converters; i++) + if (field_converters[i]) + { + DBUG_ASSERT(!dyncol_set || i != dyncol_field); + delete field_converters[i]; + } + my_free(field_converters); + field_converters= NULL; + } +} + + +int ha_cassandra::index_init(uint idx, bool sorted) +{ + int ires; + if (!se && (ires= connect_and_check_options(table))) + return ires; + return 0; +} + +void store_key_image_to_rec(Field *field, uchar *ptr, uint len); + +int ha_cassandra::index_read_map(uchar *buf, const uchar *key, + key_part_map keypart_map, + enum ha_rkey_function find_flag) +{ + int rc= 0; + DBUG_ENTER("ha_cassandra::index_read_map"); + + if (find_flag != HA_READ_KEY_EXACT) + { + DBUG_ASSERT(0); /* Non-equality lookups should never be done */ + DBUG_RETURN(HA_ERR_WRONG_COMMAND); + } + + uint key_len= calculate_key_len(table, active_index, key, keypart_map); + store_key_image_to_rec(table->field[0], (uchar*)key, key_len); + + char *cass_key; + int cass_key_len; + my_bitmap_map *old_map; + + old_map= dbug_tmp_use_all_columns(table, table->read_set); + + if (rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len)) + { + /* We get here when making lookups like uuid_column='not-an-uuid' */ + dbug_tmp_restore_column_map(table->read_set, old_map); + DBUG_RETURN(HA_ERR_KEY_NOT_FOUND); + } + + dbug_tmp_restore_column_map(table->read_set, old_map); + + bool found; + if (se->get_slice(cass_key, cass_key_len, &found)) + { + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + rc= HA_ERR_INTERNAL_ERROR; + } + + /* TODO: what if we're not reading all columns?? */ + if (!found) + rc= HA_ERR_KEY_NOT_FOUND; + else + rc= read_cassandra_columns(false); + + DBUG_RETURN(rc); +} + + +void ha_cassandra::print_conversion_error(const char *field_name, + char *cass_value, + int cass_value_len) +{ + char buf[32]; + char *p= cass_value; + size_t i= 0; + for (; (i < sizeof(buf)-1) && (p < cass_value + cass_value_len); p++) + { + buf[i++]= map2number[(*p >> 4) & 0xF]; + buf[i++]= map2number[*p & 0xF]; + } + buf[i]=0; + + se->print_error("Unable to convert value for field `%s` from Cassandra's data" + " format. Source data is %d bytes, 0x%s%s", + field_name, cass_value_len, buf, + (i == sizeof(buf) - 1)? "..." : ""); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); +} + + + +CASSANDRA_TYPE_DEF * ha_cassandra::get_cassandra_field_def(char *cass_name, + int cass_name_len) +{ + CASSANDRA_TYPE_DEF *type= default_type_def; + for(uint i= 0; i < n_special_type_fields; i++) + { + if (cass_name_len == (int)special_type_field_names[i].length && + memcmp(cass_name, special_type_field_names[i].str, + cass_name_len) == 0) + { + type= special_type_field_converters + i; + break; + } + } + return type; +} + +int ha_cassandra::read_cassandra_columns(bool unpack_pk) +{ + MEM_ROOT strings_root; + char *cass_name; + char *cass_value; + int cass_value_len, cass_name_len; + Field **field; + int res= 0; + ulong total_name_len= 0; + + clear_alloc_root(&strings_root); + /* + cassandra_to_mariadb() calls will use field->store(...) methods, which + require that the column is in the table->write_set + */ + my_bitmap_map *old_map; + old_map= dbug_tmp_use_all_columns(table, table->write_set); + + /* Start with all fields being NULL */ + for (field= table->field + 1; *field; field++) + (*field)->set_null(); + + while (!se->get_next_read_column(&cass_name, &cass_name_len, + &cass_value, &cass_value_len)) + { + // map to our column. todo: use hash or something.. + bool found= 0; + for (field= table->field + 1; *field; field++) + { + uint fieldnr= (*field)->field_index; + if ((!dyncol_set || dyncol_field != fieldnr) && + !strcmp((*field)->field_name, cass_name)) + { + found= 1; + (*field)->set_notnull(); + if (field_converters[fieldnr]->cassandra_to_mariadb(cass_value, + cass_value_len)) + { + print_conversion_error((*field)->field_name, cass_value, + cass_value_len); + res=1; + goto err; + } + break; + } + } + if (dyncol_set && !found) + { + DYNAMIC_COLUMN_VALUE val; + LEX_STRING nm; + CASSANDRA_TYPE_DEF *type= get_cassandra_field_def(cass_name, + cass_name_len); + nm.str= cass_name; + nm.length= cass_name_len; + if (nm.length > MAX_NAME_LENGTH) + { + se->print_error("Unable to convert value for field `%s`" + " from Cassandra's data format. Name" + " length exceed limit of %u: '%s'", + table->field[dyncol_field]->field_name, + (uint)MAX_NAME_LENGTH, cass_name); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + res=1; + goto err; + } + total_name_len+= cass_name_len; + if (nm.length > MAX_TOTAL_NAME_LENGTH) + { + se->print_error("Unable to convert value for field `%s`" + " from Cassandra's data format. Sum of all names" + " length exceed limit of %lu", + table->field[dyncol_field]->field_name, + cass_name, (uint)MAX_TOTAL_NAME_LENGTH); + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + res=1; + goto err; + } + + if ((res= (*(type->cassandra_to_dynamic))(cass_value, + cass_value_len, &val, + &strings_root)) || + insert_dynamic(&dynamic_names, (uchar *) &nm) || + insert_dynamic(&dynamic_values, (uchar *) &val)) + { + if (res) + { + print_conversion_error(cass_name, cass_value, cass_value_len); + } + free_strings_memroot(&strings_root); + // EOM shouldm be already reported if happened + res= 1; + goto err; + } + } + } + + dynamic_rec.length= 0; + if (dyncol_set) + { + if (mariadb_dyncol_create_many_named(&dynamic_rec, + dynamic_names.elements, + (LEX_STRING *)dynamic_names.buffer, + (DYNAMIC_COLUMN_VALUE *) + dynamic_values.buffer, + FALSE) < 0) + dynamic_rec.length= 0; + + free_strings_memroot(&strings_root); + dynamic_values.elements= dynamic_names.elements= 0; + + if (dynamic_rec.length == 0) + table->field[dyncol_field]->set_null(); + else + { + Field_blob *blob= (Field_blob *)table->field[dyncol_field]; + blob->set_notnull(); + blob->store_length(dynamic_rec.length); + *((char **)(((char *)blob->ptr) + blob->pack_length_no_ptr()))= + dynamic_rec.str; + } + } + + if (unpack_pk) + { + /* Unpack rowkey to primary key */ + field= table->field; + (*field)->set_notnull(); + se->get_read_rowkey(&cass_value, &cass_value_len); + if (rowkey_converter->cassandra_to_mariadb(cass_value, cass_value_len)) + { + print_conversion_error((*field)->field_name, cass_value, cass_value_len); + res=1; + goto err; + } + } + +err: + dbug_tmp_restore_column_map(table->write_set, old_map); + return res; +} + +int ha_cassandra::read_dyncol(uint *count, + DYNAMIC_COLUMN_VALUE **vals, + LEX_STRING **names, + String *valcol) +{ + String *strcol; + DYNAMIC_COLUMN col; + + enum enum_dyncol_func_result rc; + DBUG_ENTER("ha_cassandra::read_dyncol"); + + Field *field= table->field[dyncol_field]; + DBUG_ASSERT(field->type() == MYSQL_TYPE_BLOB); + /* It is blob and it does not use buffer */ + strcol= field->val_str(NULL, valcol); + if (field->is_null()) + { + *count= 0; + *names= 0; + *vals= 0; + DBUG_RETURN(0); // nothing to write + } + /* + dynamic_column_vals only read the string so we can + cheat here with assignment + */ + bzero(&col, sizeof(col)); + col.str= (char *)strcol->ptr(); + col.length= strcol->length(); + if ((rc= mariadb_dyncol_unpack(&col, count, names, vals)) < 0) + { + dynamic_column_error_message(rc); + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } + DBUG_RETURN(0); +} + +int ha_cassandra::write_dynamic_row(uint count, + DYNAMIC_COLUMN_VALUE *vals, + LEX_STRING *names) +{ + uint i; + DBUG_ENTER("ha_cassandra::write_dynamic_row"); + DBUG_ASSERT(dyncol_set); + + + for (i= 0; i < count; i++) + { + char buff[16]; + CASSANDRA_TYPE_DEF *type; + void *freemem= NULL; + char *cass_data; + int cass_data_len; + + DBUG_PRINT("info", ("field %*s", (int)names[i].length, names[i].str)); + type= get_cassandra_field_def(names[i].str, (int) names[i].length); + if ((*type->dynamic_to_cassandra)(vals +i, &cass_data, &cass_data_len, + buff, &freemem)) + { + my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0), + names[i].str, insert_lineno); + DBUG_RETURN(HA_ERR_GENERIC); + } + se->add_insert_column(names[i].str, names[i].length, + cass_data, cass_data_len); + if (freemem) + my_free(freemem); + } + DBUG_RETURN(0); +} + +void ha_cassandra::free_dynamic_row(DYNAMIC_COLUMN_VALUE **vals, + LEX_STRING **names) +{ + if (*vals) + { + my_free(*vals); + *vals= 0; + } + if (*names) + { + my_free(*names); + *names= 0; + } +} + +int ha_cassandra::write_row(uchar *buf) +{ + my_bitmap_map *old_map; + int ires; + DBUG_ENTER("ha_cassandra::write_row"); + + if (!se && (ires= connect_and_check_options(table))) + DBUG_RETURN(ires); + + if (!doing_insert_batch) + se->clear_insert_buffer(); + + old_map= dbug_tmp_use_all_columns(table, table->read_set); + + insert_lineno++; + + /* Convert the key */ + char *cass_key; + int cass_key_len; + if (rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len)) + { + my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0), + rowkey_converter->field->field_name, insert_lineno); + dbug_tmp_restore_column_map(table->read_set, old_map); + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } + se->start_row_insert(cass_key, cass_key_len); + + /* Convert other fields */ + for (uint i= 1; i < table->s->fields; i++) + { + char *cass_data; + int cass_data_len; + if (dyncol_set && dyncol_field == i) + { + String valcol; + DYNAMIC_COLUMN_VALUE *vals; + LEX_STRING *names; + uint count; + int rc; + DBUG_ASSERT(field_converters[i] == NULL); + if (!(rc= read_dyncol(&count, &vals, &names, &valcol))) + rc= write_dynamic_row(count, vals, names); + free_dynamic_row(&vals, &names); + if (rc) + { + dbug_tmp_restore_column_map(table->read_set, old_map); + DBUG_RETURN(rc); + } + } + else + { + if (field_converters[i]->mariadb_to_cassandra(&cass_data, + &cass_data_len)) + { + my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0), + field_converters[i]->field->field_name, insert_lineno); + dbug_tmp_restore_column_map(table->read_set, old_map); + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } + se->add_insert_column(field_converters[i]->field->field_name, 0, + cass_data, cass_data_len); + } + } + + dbug_tmp_restore_column_map(table->read_set, old_map); + + bool res; + + if (doing_insert_batch) + { + res= 0; + if (++insert_rows_batched >= THDVAR(table->in_use, insert_batch_size)) + { + res= se->do_insert(); + insert_rows_batched= 0; + } + } + else + res= se->do_insert(); + + if (res) + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + + DBUG_RETURN(res? HA_ERR_INTERNAL_ERROR: 0); +} + + +void ha_cassandra::start_bulk_insert(ha_rows rows, uint flags) +{ + int ires; + if (!se && (ires= connect_and_check_options(table))) + return; + + doing_insert_batch= true; + insert_rows_batched= 0; + + se->clear_insert_buffer(); +} + + +int ha_cassandra::end_bulk_insert() +{ + DBUG_ENTER("ha_cassandra::end_bulk_insert"); + + /* Flush out the insert buffer */ + doing_insert_batch= false; + bool bres= se->do_insert(); + se->clear_insert_buffer(); + + DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0); +} + + +int ha_cassandra::rnd_init(bool scan) +{ + bool bres; + int ires; + DBUG_ENTER("ha_cassandra::rnd_init"); + + if (!se && (ires= connect_and_check_options(table))) + DBUG_RETURN(ires); + + if (!scan) + { + /* Prepare for rnd_pos() calls. We don't need to anything. */ + DBUG_RETURN(0); + } + + if (dyncol_set) + { + se->clear_read_all_columns(); + } + else + { + se->clear_read_columns(); + for (uint i= 1; i < table->s->fields; i++) + se->add_read_column(table->field[i]->field_name); + } + + se->read_batch_size= THDVAR(table->in_use, rnd_batch_size); + bres= se->get_range_slices(false); + if (bres) + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + + DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0); +} + + +int ha_cassandra::rnd_end() +{ + DBUG_ENTER("ha_cassandra::rnd_end"); + + se->finish_reading_range_slices(); + DBUG_RETURN(0); +} + + +int ha_cassandra::rnd_next(uchar *buf) +{ + int rc; + bool reached_eof; + DBUG_ENTER("ha_cassandra::rnd_next"); + + // Unpack and return the next record. + if (se->get_next_range_slice_row(&reached_eof)) + { + rc= HA_ERR_INTERNAL_ERROR; + } + else + { + if (reached_eof) + rc= HA_ERR_END_OF_FILE; + else + rc= read_cassandra_columns(true); + } + + DBUG_RETURN(rc); +} + + +int ha_cassandra::delete_all_rows() +{ + bool bres; + int ires; + DBUG_ENTER("ha_cassandra::delete_all_rows"); + + if (!se && (ires= connect_and_check_options(table))) + DBUG_RETURN(ires); + + bres= se->truncate(); + + if (bres) + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + + DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0); +} + + +int ha_cassandra::delete_row(const uchar *buf) +{ + bool bres; + DBUG_ENTER("ha_cassandra::delete_row"); + + bres= se->remove_row(); + + if (bres) + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + + DBUG_RETURN(bres? HA_ERR_INTERNAL_ERROR: 0); +} + + +int ha_cassandra::info(uint flag) +{ + DBUG_ENTER("ha_cassandra::info"); + + if (!table) + return 1; + + if (flag & HA_STATUS_VARIABLE) + { + stats.records= 1000; + stats.deleted= 0; + } + if (flag & HA_STATUS_CONST) + { + ref_length= table->field[0]->key_length(); + } + + DBUG_RETURN(0); +} + + +void key_copy(uchar *to_key, uchar *from_record, KEY *key_info, + uint key_length, bool with_zerofill); + + +void ha_cassandra::position(const uchar *record) +{ + DBUG_ENTER("ha_cassandra::position"); + + /* Copy the primary key to rowid */ + key_copy(ref, (uchar*)record, &table->key_info[0], + table->field[0]->key_length(), true); + + DBUG_VOID_RETURN; +} + + +int ha_cassandra::rnd_pos(uchar *buf, uchar *pos) +{ + int rc; + DBUG_ENTER("ha_cassandra::rnd_pos"); + + int save_active_index= active_index; + active_index= 0; /* The primary key */ + rc= index_read_map(buf, pos, key_part_map(1), HA_READ_KEY_EXACT); + + active_index= save_active_index; + + DBUG_RETURN(rc); +} + + +int ha_cassandra::reset() +{ + doing_insert_batch= false; + insert_lineno= 0; + if (se) + { + se->set_consistency_levels(THDVAR(table->in_use, read_consistency), + THDVAR(table->in_use, write_consistency)); + } + return 0; +} + +///////////////////////////////////////////////////////////////////////////// +// MRR implementation +///////////////////////////////////////////////////////////////////////////// + + +/* + - The key can be only primary key + - allow equality-ranges only. + - anything else? +*/ +ha_rows ha_cassandra::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, uint *bufsz, + uint *flags, Cost_estimate *cost) +{ + /* No support for const ranges so far */ + return HA_POS_ERROR; +} + + +ha_rows ha_cassandra::multi_range_read_info(uint keyno, uint n_ranges, uint keys, + uint key_parts, uint *bufsz, + uint *flags, Cost_estimate *cost) +{ + /* Can only be equality lookups on the primary key... */ + // TODO anything else? + *flags &= ~HA_MRR_USE_DEFAULT_IMPL; + *flags |= HA_MRR_NO_ASSOCIATION; + + return 10; +} + + +int ha_cassandra::multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, + uint n_ranges, uint mode, HANDLER_BUFFER *buf) +{ + int res; + mrr_iter= seq->init(seq_init_param, n_ranges, mode); + mrr_funcs= *seq; + res= mrr_start_read(); + return (res? HA_ERR_INTERNAL_ERROR: 0); +} + + +bool ha_cassandra::mrr_start_read() +{ + uint key_len; + + my_bitmap_map *old_map; + old_map= dbug_tmp_use_all_columns(table, table->read_set); + + se->new_lookup_keys(); + + while (!(source_exhausted= mrr_funcs.next(mrr_iter, &mrr_cur_range))) + { + char *cass_key; + int cass_key_len; + + DBUG_ASSERT(mrr_cur_range.range_flag & EQ_RANGE); + + uchar *key= (uchar*)mrr_cur_range.start_key.key; + key_len= mrr_cur_range.start_key.length; + //key_len= calculate_key_len(table, active_index, key, keypart_map); // NEED THIS?? + store_key_image_to_rec(table->field[0], (uchar*)key, key_len); + + rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len); + + // Primitive buffer control + if (se->add_lookup_key(cass_key, cass_key_len) > + THDVAR(table->in_use, multiget_batch_size)) + break; + } + + dbug_tmp_restore_column_map(table->read_set, old_map); + + return se->multiget_slice(); +} + + +int ha_cassandra::multi_range_read_next(range_id_t *range_info) +{ + int res; + while(1) + { + if (!se->get_next_multiget_row()) + { + res= read_cassandra_columns(true); + break; + } + else + { + if (source_exhausted) + { + res= HA_ERR_END_OF_FILE; + break; + } + else + { + if (mrr_start_read()) + { + res= HA_ERR_INTERNAL_ERROR; + break; + } + } + } + /* + We get here if we've refilled the buffer and done another read. Try + reading from results again + */ + } + return res; +} + + +int ha_cassandra::multi_range_read_explain_info(uint mrr_mode, char *str, size_t size) +{ + const char *mrr_str= "multiget_slice"; + + if (!(mrr_mode & HA_MRR_USE_DEFAULT_IMPL)) + { + uint mrr_str_len= strlen(mrr_str); + uint copy_len= min(mrr_str_len, size); + memcpy(str, mrr_str, size); + return copy_len; + } + return 0; +} + + +class Column_name_enumerator_impl : public Column_name_enumerator +{ + ha_cassandra *obj; + uint idx; +public: + Column_name_enumerator_impl(ha_cassandra *obj_arg) : obj(obj_arg), idx(1) {} + const char* get_next_name() + { + if (idx == obj->table->s->fields) + return NULL; + else + return obj->table->field[idx++]->field_name; + } +}; + + +int ha_cassandra::update_row(const uchar *old_data, uchar *new_data) +{ + DYNAMIC_COLUMN_VALUE *oldvals, *vals; + LEX_STRING *oldnames, *names; + uint oldcount, count; + String oldvalcol, valcol; + my_bitmap_map *old_map; + int res; + DBUG_ENTER("ha_cassandra::update_row"); + /* Currently, it is guaranteed that new_data == table->record[0] */ + DBUG_ASSERT(new_data == table->record[0]); + /* For now, just rewrite the full record */ + se->clear_insert_buffer(); + + old_map= dbug_tmp_use_all_columns(table, table->read_set); + + char *old_key; + int old_key_len; + se->get_read_rowkey(&old_key, &old_key_len); + + /* Get the key we're going to write */ + char *new_key; + int new_key_len; + if (rowkey_converter->mariadb_to_cassandra(&new_key, &new_key_len)) + { + my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0), + rowkey_converter->field->field_name, insert_lineno); + dbug_tmp_restore_column_map(table->read_set, old_map); + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } + + /* + Compare it to the key we've read. For all types that Cassandra supports, + binary byte-wise comparison can be used + */ + bool new_primary_key; + if (new_key_len != old_key_len || memcmp(old_key, new_key, new_key_len)) + new_primary_key= true; + else + new_primary_key= false; + + if (dyncol_set) + { + Field *field= table->field[dyncol_field]; + /* move to get old_data */ + my_ptrdiff_t diff; + diff= (my_ptrdiff_t) (old_data - new_data); + field->move_field_offset(diff); // Points now at old_data + if ((res= read_dyncol(&oldcount, &oldvals, &oldnames, &oldvalcol))) + DBUG_RETURN(res); + field->move_field_offset(-diff); // back to new_data + if ((res= read_dyncol(&count, &vals, &names, &valcol))) + { + free_dynamic_row(&oldvals, &oldnames); + DBUG_RETURN(res); + } + } + + if (new_primary_key) + { + /* + Primary key value changed. This is essentially a DELETE + INSERT. + Add a DELETE operation into the batch + */ + Column_name_enumerator_impl name_enumerator(this); + se->add_row_deletion(old_key, old_key_len, &name_enumerator, + oldnames, + (dyncol_set ? oldcount : 0)); + oldcount= 0; // they will be deleted + } + + se->start_row_insert(new_key, new_key_len); + + /* Convert other fields */ + for (uint i= 1; i < table->s->fields; i++) + { + char *cass_data; + int cass_data_len; + if (dyncol_set && dyncol_field == i) + { + DBUG_ASSERT(field_converters[i] == NULL); + if ((res= write_dynamic_row(count, vals, names))) + goto err; + } + else + { + if (field_converters[i]->mariadb_to_cassandra(&cass_data, &cass_data_len)) + { + my_error(ER_WARN_DATA_OUT_OF_RANGE, MYF(0), + field_converters[i]->field->field_name, insert_lineno); + dbug_tmp_restore_column_map(table->read_set, old_map); + DBUG_RETURN(HA_ERR_INTERNAL_ERROR); + } + se->add_insert_column(field_converters[i]->field->field_name, 0, + cass_data, cass_data_len); + } + } + if (dyncol_set) + { + /* find removed fields */ + uint i= 0, j= 0; + /* both array are sorted */ + for(; i < oldcount; i++) + { + int scmp= 0; + while (j < count && + (scmp = mariadb_dyncol_column_cmp_named(names + j, + oldnames + i)) < 0) + j++; + if (j < count && + scmp == 0) + j++; + else + se->add_insert_delete_column(oldnames[i].str, oldnames[i].length); + } + } + + dbug_tmp_restore_column_map(table->read_set, old_map); + + res= se->do_insert(); + + if (res) + my_error(ER_INTERNAL_ERROR, MYF(0), se->error_str()); + +err: + if (dyncol_set) + { + free_dynamic_row(&oldvals, &oldnames); + free_dynamic_row(&vals, &names); + } + + DBUG_RETURN(res? HA_ERR_INTERNAL_ERROR: 0); +} + + +/* + We can't really have any locks for Cassandra Storage Engine. We're reading + from Cassandra cluster, and other clients can asynchronously modify the data. + + We can enforce locking within this process, but this will not be useful. + + Thus, store_lock() should express that: + - Writes do not block other writes + - Reads should not block anything either, including INSERTs. +*/ +THR_LOCK_DATA **ha_cassandra::store_lock(THD *thd, + THR_LOCK_DATA **to, + enum thr_lock_type lock_type) +{ + DBUG_ENTER("ha_cassandra::store_lock"); + if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) + { + /* Writes allow other writes */ + if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && + lock_type <= TL_WRITE)) + lock_type = TL_WRITE_ALLOW_WRITE; + + /* Reads allow everything, including INSERTs */ + if (lock_type == TL_READ_NO_INSERT) + lock_type = TL_READ; + + lock.type= lock_type; + } + *to++= &lock; + DBUG_RETURN(to); +} + + +ha_rows ha_cassandra::records_in_range(uint inx, key_range *min_key, + key_range *max_key) +{ + DBUG_ENTER("ha_cassandra::records_in_range"); + DBUG_RETURN(HA_POS_ERROR); /* Range scans are not supported */ +} + + +/** + check_if_incompatible_data() called if ALTER TABLE can't detect otherwise + if new and old definition are compatible + + @details If there are no other explicit signs like changed number of + fields this function will be called by compare_tables() + (sql/sql_tables.cc) to decide should we rewrite whole table or only .frm + file. + +*/ + +bool ha_cassandra::check_if_incompatible_data(HA_CREATE_INFO *info, + uint table_changes) +{ + DBUG_ENTER("ha_cassandra::check_if_incompatible_data"); + /* Checked, we intend to have this empty for Cassandra SE. */ + DBUG_RETURN(COMPATIBLE_DATA_YES); +} + + +void Cassandra_se_interface::print_error(const char *format, ...) +{ + va_list ap; + va_start(ap, format); + // it's not a problem if output was truncated + my_vsnprintf(err_buffer, sizeof(err_buffer), format, ap); + va_end(ap); +} + + +struct st_mysql_storage_engine cassandra_storage_engine= +{ MYSQL_HANDLERTON_INTERFACE_VERSION }; + +static SHOW_VAR cassandra_status_variables[]= { + {"Cassandra_row_inserts", + (char*) &cassandra_counters.row_inserts, SHOW_LONG}, + {"Cassandra_row_insert_batches", + (char*) &cassandra_counters.row_insert_batches, SHOW_LONG}, + + {"Cassandra_multiget_keys_scanned", + (char*) &cassandra_counters.multiget_keys_scanned, SHOW_LONG}, + {"Cassandra_multiget_reads", + (char*) &cassandra_counters.multiget_reads, SHOW_LONG}, + {"Cassandra_multiget_rows_read", + (char*) &cassandra_counters.multiget_rows_read, SHOW_LONG}, + + {"Cassandra_timeout_exceptions", + (char*) &cassandra_counters.timeout_exceptions, SHOW_LONG}, + {"Cassandra_unavailable_exceptions", + (char*) &cassandra_counters.unavailable_exceptions, SHOW_LONG}, + {NullS, NullS, SHOW_LONG} +}; + + + + +maria_declare_plugin(cassandra) +{ + MYSQL_STORAGE_ENGINE_PLUGIN, + &cassandra_storage_engine, + "CASSANDRA", + "Monty Program Ab", + "Cassandra storage engine", + PLUGIN_LICENSE_GPL, + cassandra_init_func, /* Plugin Init */ + cassandra_done_func, /* Plugin Deinit */ + 0x0001, /* version number (0.1) */ + cassandra_status_variables, /* status variables */ + cassandra_system_variables, /* system variables */ + "0.1", /* string version */ + MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */ +} +maria_declare_plugin_end; diff --git a/storage/cassandra/ha_cassandra.h b/storage/cassandra/ha_cassandra.h new file mode 100644 index 00000000000..cc42234e385 --- /dev/null +++ b/storage/cassandra/ha_cassandra.h @@ -0,0 +1,275 @@ +/* + Copyright (c) 2012, Monty Program Ab + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef USE_PRAGMA_INTERFACE +#pragma interface /* gcc class implementation */ +#endif + + +#include "my_global.h" /* ulonglong */ +#include "thr_lock.h" /* THR_LOCK, THR_LOCK_DATA */ +#include "handler.h" /* handler */ +#include "my_base.h" /* ha_rows */ + +#include "cassandra_se.h" + +/** @brief + CASSANDRA_SHARE is a structure that will be shared among all open handlers. + This example implements the minimum of what you will probably need. +*/ +typedef struct st_cassandra_share { + char *table_name; + uint table_name_length,use_count; + mysql_mutex_t mutex; + THR_LOCK lock; +} CASSANDRA_SHARE; + +class ColumnDataConverter; +struct st_dynamic_column_value; +typedef struct st_dynamic_column_value DYNAMIC_COLUMN_VALUE; + +struct ha_table_option_struct; + + +struct st_dynamic_column_value; + +typedef bool (* CAS2DYN_CONVERTER)(const char *cass_data, + int cass_data_len, + struct st_dynamic_column_value *value, + MEM_ROOT *mem_root); +typedef bool (* DYN2CAS_CONVERTER)(struct st_dynamic_column_value *value, + char **cass_data, + int *cass_data_len, + void *buf, void **freemem); +struct cassandra_type_def +{ + const char *name; + CAS2DYN_CONVERTER cassandra_to_dynamic; + DYN2CAS_CONVERTER dynamic_to_cassandra; +}; + +typedef struct cassandra_type_def CASSANDRA_TYPE_DEF; + +enum cassandtra_type_enum {CT_BIGINT, CT_INT, CT_COUNTER, CT_FLOAT, CT_DOUBLE, + CT_BLOB, CT_ASCII, CT_TEXT, CT_TIMESTAMP, CT_UUID, CT_BOOLEAN, CT_VARINT, + CT_DECIMAL}; + +typedef enum cassandtra_type_enum CASSANDRA_TYPE; + + + +/** @brief + Class definition for the storage engine +*/ +class ha_cassandra: public handler +{ + friend class Column_name_enumerator_impl; + THR_LOCK_DATA lock; ///< MySQL lock + CASSANDRA_SHARE *share; ///< Shared lock info + + Cassandra_se_interface *se; + + /* description of static part of the table definition */ + ColumnDataConverter **field_converters; + uint n_field_converters; + + CASSANDRA_TYPE_DEF *default_type_def; + /* description of dynamic columns part */ + CASSANDRA_TYPE_DEF *special_type_field_converters; + LEX_STRING *special_type_field_names; + uint n_special_type_fields; + DYNAMIC_ARRAY dynamic_values, dynamic_names; + DYNAMIC_STRING dynamic_rec; + + ColumnDataConverter *rowkey_converter; + + bool setup_field_converters(Field **field, uint n_fields); + void free_field_converters(); + + int read_cassandra_columns(bool unpack_pk); + int check_table_options(struct ha_table_option_struct* options); + + bool doing_insert_batch; + ha_rows insert_rows_batched; + + uint dyncol_field; + bool dyncol_set; + + /* Used to produce 'wrong column %s at row %lu' warnings */ + ha_rows insert_lineno; + void print_conversion_error(const char *field_name, + char *cass_value, int cass_value_len); + int connect_and_check_options(TABLE *table_arg); +public: + ha_cassandra(handlerton *hton, TABLE_SHARE *table_arg); + ~ha_cassandra() + { + free_field_converters(); + delete se; + } + + /** @brief + The name that will be used for display purposes. + */ + const char *table_type() const { return "CASSANDRA"; } + + /** @brief + The name of the index type that will be used for display. + Don't implement this method unless you really have indexes. + */ + const char *index_type(uint inx) { return "HASH"; } + + /** @brief + The file extensions. + */ + const char **bas_ext() const; + + /** @brief + This is a list of flags that indicate what functionality the storage engine + implements. The current table flags are documented in handler.h + */ + ulonglong table_flags() const + { + return HA_BINLOG_STMT_CAPABLE | + HA_REC_NOT_IN_SEQ | + HA_NO_TRANSACTIONS | + HA_REQUIRE_PRIMARY_KEY | + HA_PRIMARY_KEY_IN_READ_INDEX | + HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | + HA_NO_AUTO_INCREMENT | + HA_TABLE_SCAN_ON_INDEX; + } + + /** @brief + This is a bitmap of flags that indicates how the storage engine + implements indexes. The current index flags are documented in + handler.h. If you do not implement indexes, just return zero here. + + @details + part is the key part to check. First key part is 0. + If all_parts is set, MySQL wants to know the flags for the combined + index, up to and including 'part'. + */ + ulong index_flags(uint inx, uint part, bool all_parts) const + { + return 0; + } + + /** @brief + unireg.cc will call max_supported_record_length(), max_supported_keys(), + max_supported_key_parts(), uint max_supported_key_length() + to make sure that the storage engine can handle the data it is about to + send. Return *real* limits of your storage engine here; MySQL will do + min(your_limits, MySQL_limits) automatically. + */ + uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; } + + /* Support only one Primary Key, for now */ + uint max_supported_keys() const { return 1; } + uint max_supported_key_parts() const { return 1; } + + /** @brief + unireg.cc will call this to make sure that the storage engine can handle + the data it is about to send. Return *real* limits of your storage engine + here; MySQL will do min(your_limits, MySQL_limits) automatically. + + @details + There is no need to implement ..._key_... methods if your engine doesn't + support indexes. + */ + uint max_supported_key_length() const { return 16*1024; /* just to return something*/ } + + int index_init(uint idx, bool sorted); + + int index_read_map(uchar * buf, const uchar * key, + key_part_map keypart_map, + enum ha_rkey_function find_flag); + + /** @brief + Called in test_quick_select to determine if indexes should be used. + */ + virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; } + + /** @brief + This method will never be called if you do not implement indexes. + */ + virtual double read_time(uint, uint, ha_rows rows) + { return (double) rows / 20.0+1; } + + virtual void start_bulk_insert(ha_rows rows, uint flags); + virtual int end_bulk_insert(); + + virtual int reset(); + + + int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, + uint n_ranges, uint mode, HANDLER_BUFFER *buf); + int multi_range_read_next(range_id_t *range_info); + ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, + void *seq_init_param, + uint n_ranges, uint *bufsz, + uint *flags, Cost_estimate *cost); + ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, + uint key_parts, uint *bufsz, + uint *flags, Cost_estimate *cost); + int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size); + +private: + bool source_exhausted; + bool mrr_start_read(); + int check_field_options(Field **fields); + int read_dyncol(uint *count, + DYNAMIC_COLUMN_VALUE **vals, LEX_STRING **names, + String *valcol); + int write_dynamic_row(uint count, + DYNAMIC_COLUMN_VALUE *vals, + LEX_STRING *names); + void static free_dynamic_row(DYNAMIC_COLUMN_VALUE **vals, + LEX_STRING **names); + CASSANDRA_TYPE_DEF * get_cassandra_field_def(char *cass_name, + int cass_name_length); +public: + int open(const char *name, int mode, uint test_if_locked); + int close(void); + + int write_row(uchar *buf); + int update_row(const uchar *old_data, uchar *new_data); + int delete_row(const uchar *buf); + + /** @brief + Unlike index_init(), rnd_init() can be called two consecutive times + without rnd_end() in between (it only makes sense if scan=1). In this + case, the second call should prepare for the new table scan (e.g if + rnd_init() allocates the cursor, the second call should position the + cursor to the start of the table; no need to deallocate and allocate + it again. This is a required method. + */ + int rnd_init(bool scan); //required + int rnd_end(); + int rnd_next(uchar *buf); ///< required + int rnd_pos(uchar *buf, uchar *pos); ///< required + void position(const uchar *record); ///< required + int info(uint); ///< required + int delete_all_rows(void); + ha_rows records_in_range(uint inx, key_range *min_key, + key_range *max_key); + int create(const char *name, TABLE *form, + HA_CREATE_INFO *create_info); ///< required + bool check_if_incompatible_data(HA_CREATE_INFO *info, + uint table_changes); + + THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type); ///< required +}; diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 5277dc9bf40..916c7b151de 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -489,7 +489,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg) buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin); chain= chain_buffer; file_buff= new Transparent_file(); - init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);; + init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, MYF(0)); } @@ -953,7 +953,7 @@ int ha_tina::open(const char *name, int mode, uint open_options) */ thr_lock_data_init(&share->lock, &lock, (void*) this); ref_length= sizeof(my_off_t); - init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0); + init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0, MYF(0)); share->lock.get_status= tina_get_status; share->lock.update_status= tina_update_status; diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 211a77e2891..0c07af0a554 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -1515,7 +1515,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) */ query.length(0); - init_alloc_root(&mem_root, 256, 0); + init_alloc_root(&mem_root, 256, 0, MYF(0)); mysql_mutex_lock(&federated_mutex); @@ -1656,7 +1656,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked) ref_length= sizeof(MYSQL_RES *) + sizeof(MYSQL_ROW_OFFSET); DBUG_PRINT("info", ("ref_length: %u", ref_length)); - my_init_dynamic_array(&results, sizeof(MYSQL_RES *), 4, 4); + my_init_dynamic_array(&results, sizeof(MYSQL_RES *), 4, 4, MYF(0)); reset(); DBUG_RETURN(0); @@ -1978,7 +1978,7 @@ int ha_federated::write_row(uchar *buf) @details Initializes memory structures required for bulk insert. */ -void ha_federated::start_bulk_insert(ha_rows rows) +void ha_federated::start_bulk_insert(ha_rows rows, uint flags) { uint page_size; DBUG_ENTER("ha_federated::start_bulk_insert"); @@ -3160,7 +3160,6 @@ int ha_federated::real_connect() this->table->s->table_charset->csname); sql_query.length(0); - if (!mysql_real_connect(mysql, share->hostname, share->username, diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index 6583d438c4d..fc2c4740cc0 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -209,7 +209,7 @@ public: int open(const char *name, int mode, uint test_if_locked); // required int close(void); // required - void start_bulk_insert(ha_rows rows); + void start_bulk_insert(ha_rows rows, uint flags); int end_bulk_insert(); int write_row(uchar *buf); int update_row(const uchar *old_data, uchar *new_data); diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc index a2ba496ea47..effbe899e7f 100644 --- a/storage/federatedx/federatedx_io_mysql.cc +++ b/storage/federatedx/federatedx_io_mysql.cc @@ -136,7 +136,7 @@ federatedx_io_mysql::federatedx_io_mysql(FEDERATEDX_SERVER *aserver) bzero(&mysql, sizeof(MYSQL)); bzero(&savepoints, sizeof(DYNAMIC_ARRAY)); - my_init_dynamic_array(&savepoints, sizeof(SAVEPT), 16, 16); + my_init_dynamic_array(&savepoints, sizeof(SAVEPT), 16, 16, MYF(0)); DBUG_VOID_RETURN; } diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 7f095a9b96e..e1c2a38964a 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -1519,7 +1519,7 @@ static FEDERATEDX_SERVER *get_server(FEDERATEDX_SHARE *share, TABLE *table) mysql_mutex_assert_owner(&federatedx_mutex); - init_alloc_root(&mem_root, 4096, 4096); + init_alloc_root(&mem_root, 4096, 4096, MYF(0)); fill_server(&mem_root, &tmp_server, share, table ? table->s->table_charset : 0); @@ -1577,7 +1577,7 @@ static FEDERATEDX_SHARE *get_share(const char *table_name, TABLE *table) query.length(0); bzero(&tmp_share, sizeof(tmp_share)); - init_alloc_root(&mem_root, 256, 0); + init_alloc_root(&mem_root, 256, 0, MYF(0)); mysql_mutex_lock(&federatedx_mutex); @@ -1791,7 +1791,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked) DBUG_PRINT("info", ("ref_length: %u", ref_length)); - my_init_dynamic_array(&results, sizeof(FEDERATEDX_IO_RESULT*), 4, 4); + my_init_dynamic_array(&results, sizeof(FEDERATEDX_IO_RESULT*), 4, 4, MYF(0)); reset(); @@ -2126,7 +2126,7 @@ int ha_federatedx::write_row(uchar *buf) @details Initializes memory structures required for bulk insert. */ -void ha_federatedx::start_bulk_insert(ha_rows rows) +void ha_federatedx::start_bulk_insert(ha_rows rows, uint flags) { uint page_size; DBUG_ENTER("ha_federatedx::start_bulk_insert"); diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 3af05387cb2..dcbbe534262 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -390,7 +390,7 @@ public: int open(const char *name, int mode, uint test_if_locked); // required int close(void); // required - void start_bulk_insert(ha_rows rows); + void start_bulk_insert(ha_rows rows, uint flags); int end_bulk_insert(); int write_row(uchar *buf); int update_row(const uchar *old_data, uchar *new_data); diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index b9eef0d155b..8e63799680b 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -634,7 +634,7 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table, if (!(keydef= (HP_KEYDEF*) my_malloc(keys * sizeof(HP_KEYDEF) + parts * sizeof(HA_KEYSEG), - MYF(MY_WME)))) + MYF(MY_WME | MY_THREAD_SPECIFIC)))) return my_errno; seg= reinterpret_cast<HA_KEYSEG*>(keydef + keys); for (key= 0; key < keys; key++) diff --git a/storage/heap/heapdef.h b/storage/heap/heapdef.h index db00ea87a01..d5c0ad96b05 100644 --- a/storage/heap/heapdef.h +++ b/storage/heap/heapdef.h @@ -62,7 +62,8 @@ typedef struct { extern HP_SHARE *hp_find_named_heap(const char *name); extern int hp_rectest(HP_INFO *info,const uchar *old); extern uchar *hp_find_block(HP_BLOCK *info,ulong pos); -extern int hp_get_new_block(HP_BLOCK *info, size_t* alloc_length); +extern int hp_get_new_block(HP_SHARE *info, HP_BLOCK *block, + size_t* alloc_length); extern void hp_free(HP_SHARE *info); extern uchar *hp_free_level(HP_BLOCK *block,uint level,HP_PTRS *pos, uchar *last_pos); diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c index 01978e2b4e8..1c40f982422 100644 --- a/storage/heap/hp_block.c +++ b/storage/heap/hp_block.c @@ -45,6 +45,7 @@ uchar *hp_find_block(HP_BLOCK *block, ulong pos) SYNOPSIS hp_get_new_block() + info heap handle block HP_BLOCK tree-like block alloc_length OUT Amount of memory allocated from the heap @@ -54,7 +55,7 @@ uchar *hp_find_block(HP_BLOCK *block, ulong pos) 1 Out of memory */ -int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length) +int hp_get_new_block(HP_SHARE *info, HP_BLOCK *block, size_t *alloc_length) { reg1 uint i,j; HP_PTRS *root; @@ -77,7 +78,10 @@ int hp_get_new_block(HP_BLOCK *block, size_t *alloc_length) */ *alloc_length= (sizeof(HP_PTRS)* ((i == block->levels) ? i : i - 1) + block->records_in_block* block->recbuffer); - if (!(root=(HP_PTRS*) my_malloc(*alloc_length,MYF(MY_WME)))) + if (!(root=(HP_PTRS*) my_malloc(*alloc_length, + MYF(MY_WME | + (info->internal ? + MY_THREAD_SPECIFIC : 0))))) return 1; if (i == 0) diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c index d170d1abc65..a8bc8e63810 100644 --- a/storage/heap/hp_create.c +++ b/storage/heap/hp_create.c @@ -146,7 +146,9 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info, if (!(share= (HP_SHARE*) my_malloc((uint) sizeof(HP_SHARE)+ keys*sizeof(HP_KEYDEF)+ key_segs*sizeof(HA_KEYSEG), - MYF(MY_ZEROFILL)))) + MYF(MY_ZEROFILL | + (create_info->internal_table ? + MY_THREAD_SPECIFIC : 0))))) goto err; share->keydef= (HP_KEYDEF*) (share + 1); share->key_stat_version= 1; @@ -171,7 +173,9 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info, keyseg++; init_tree(&keyinfo->rb_tree, 0, 0, sizeof(uchar*), - (qsort_cmp2)keys_compare, 1, NULL, NULL); + (qsort_cmp2)keys_compare, NULL, NULL, + MYF((create_info->internal_table ? MY_THREAD_SPECIFIC : 0) | + MY_TREE_WITH_DELETE)); keyinfo->delete_key= hp_rb_delete_key; keyinfo->write_key= hp_rb_write_key; } @@ -199,6 +203,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info, share->auto_key_type= create_info->auto_key_type; share->auto_increment= create_info->auto_increment; share->create_time= (long) time((time_t*) 0); + share->internal= create_info->internal_table; /* Must be allocated separately for rename to work */ if (!(share->name= my_strdup(name,MYF(0)))) { diff --git a/storage/heap/hp_open.c b/storage/heap/hp_open.c index c456dbdfc84..fc7397989f2 100644 --- a/storage/heap/hp_open.c +++ b/storage/heap/hp_open.c @@ -32,7 +32,9 @@ HP_INFO *heap_open_from_share(HP_SHARE *share, int mode) if (!(info= (HP_INFO*) my_malloc((uint) sizeof(HP_INFO) + 2 * share->max_key_length, - MYF(MY_ZEROFILL)))) + MYF(MY_ZEROFILL + + (share->internal ? + MY_THREAD_SPECIFIC : 0))))) { DBUG_RETURN(0); } diff --git a/storage/heap/hp_write.c b/storage/heap/hp_write.c index 8bfecc7747c..c84fc4b6104 100644 --- a/storage/heap/hp_write.c +++ b/storage/heap/hp_write.c @@ -162,7 +162,7 @@ static uchar *next_free_record_pos(HP_SHARE *info) my_errno=HA_ERR_RECORD_FILE_FULL; DBUG_RETURN(NULL); } - if (hp_get_new_block(&info->block,&length)) + if (hp_get_new_block(info, &info->block,&length)) DBUG_RETURN(NULL); info->data_length+=length; } @@ -407,7 +407,7 @@ static HASH_INFO *hp_find_free_hash(HP_SHARE *info, return hp_find_hash(block,records); if (!(block_pos=(records % block->records_in_block))) { - if (hp_get_new_block(block,&length)) + if (hp_get_new_block(info, block, &length)) return(NULL); info->index_length+=length; } diff --git a/storage/innobase/btr/btr0btr.cc b/storage/innobase/btr/btr0btr.cc index 3f29f403622..8b7a19777ab 100644 --- a/storage/innobase/btr/btr0btr.cc +++ b/storage/innobase/btr/btr0btr.cc @@ -1605,7 +1605,7 @@ btr_page_reorganize_low( ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); btr_assert_not_corrupted(block, index); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ data_size1 = page_get_data_size(page); max_ins_size1 = page_get_max_insert_size_after_reorganize(page, 1); @@ -1722,7 +1722,7 @@ btr_page_reorganize_low( func_exit: #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ #ifndef UNIV_HOTBACKUP buf_block_free(temp_block); @@ -1797,7 +1797,7 @@ btr_page_empty( ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); ut_ad(page_zip == buf_block_get_page_zip(block)); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ btr_search_drop_page_hash_index(block); @@ -1854,10 +1854,10 @@ btr_root_raise_and_insert( root_block = btr_cur_get_block(cursor); root_page_zip = buf_block_get_page_zip(root_block); ut_ad(page_get_n_recs(root) > 0); + index = btr_cur_get_index(cursor); #ifdef UNIV_ZIP_DEBUG - ut_a(!root_page_zip || page_zip_validate(root_page_zip, root)); + ut_a(!root_page_zip || page_zip_validate(root_page_zip, root, index)); #endif /* UNIV_ZIP_DEBUG */ - index = btr_cur_get_index(cursor); #ifdef UNIV_BTR_DEBUG if (!dict_index_is_ibuf(index)) { ulint space = dict_index_get_space(index); @@ -2782,8 +2782,8 @@ insert_empty: #ifdef UNIV_ZIP_DEBUG if (page_zip) { - ut_a(page_zip_validate(page_zip, page)); - ut_a(page_zip_validate(new_page_zip, new_page)); + ut_a(page_zip_validate(page_zip, page, cursor->index)); + ut_a(page_zip_validate(new_page_zip, new_page, cursor->index)); } #endif /* UNIV_ZIP_DEBUG */ @@ -2817,7 +2817,8 @@ insert_empty: = buf_block_get_page_zip(insert_block); ut_a(!insert_page_zip - || page_zip_validate(insert_page_zip, insert_page)); + || page_zip_validate(insert_page_zip, insert_page, + cursor->index)); } #endif /* UNIV_ZIP_DEBUG */ @@ -3181,7 +3182,7 @@ btr_lift_page_up( btr_page_set_level(page, page_zip, page_level, mtr); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ } @@ -3355,8 +3356,8 @@ err_exit: const page_zip_des_t* page_zip = buf_block_get_page_zip(block); ut_a(page_zip); - ut_a(page_zip_validate(merge_page_zip, merge_page)); - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(merge_page_zip, merge_page, index)); + ut_a(page_zip_validate(page_zip, page, index)); } #endif /* UNIV_ZIP_DEBUG */ @@ -3489,7 +3490,8 @@ err_exit: ut_ad(page_validate(merge_page, index)); #ifdef UNIV_ZIP_DEBUG - ut_a(!merge_page_zip || page_zip_validate(merge_page_zip, merge_page)); + ut_a(!merge_page_zip || page_zip_validate(merge_page_zip, merge_page, + index)); #endif /* UNIV_ZIP_DEBUG */ /* Free the file page */ @@ -3671,7 +3673,7 @@ btr_discard_page( page_zip_des_t* merge_page_zip = buf_block_get_page_zip(merge_block); ut_a(!merge_page_zip - || page_zip_validate(merge_page_zip, merge_page)); + || page_zip_validate(merge_page_zip, merge_page, index)); } #endif /* UNIV_ZIP_DEBUG */ @@ -4123,7 +4125,7 @@ btr_validate_level( ut_a(space == page_get_space_id(page)); #ifdef UNIV_ZIP_DEBUG page_zip = buf_block_get_page_zip(block); - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ ut_a(!page_is_leaf(page)); @@ -4151,7 +4153,7 @@ loop: #ifdef UNIV_ZIP_DEBUG page_zip = buf_block_get_page_zip(block); - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ /* Check ordering etc. of records */ diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 95193546115..aeb16200f80 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -679,7 +679,7 @@ retry_page_get: #ifdef UNIV_ZIP_DEBUG const page_zip_des_t* page_zip = buf_block_get_page_zip(block); - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ buf_block_dbg_add_level( @@ -2045,7 +2045,7 @@ any_extern: page_zip = buf_block_get_page_zip(block); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ if (page_zip @@ -2254,7 +2254,7 @@ btr_cur_pessimistic_update( MTR_MEMO_X_LOCK)); ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ /* The insert buffer tree should never be updated in place. */ ut_ad(!dict_index_is_ibuf(index)); @@ -2392,7 +2392,7 @@ make_external: btr_search_update_hash_on_delete(cursor); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ page_cursor = btr_cur_get_page_cur(cursor); @@ -2499,7 +2499,7 @@ make_external: buf_block_t* rec_block = btr_cur_get_block(cursor); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); page = buf_block_get_frame(rec_block); #endif /* UNIV_ZIP_DEBUG */ page_zip = buf_block_get_page_zip(rec_block); @@ -2525,7 +2525,7 @@ make_external: return_after_reservations: #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ if (n_extents > 0) { @@ -2887,7 +2887,7 @@ btr_cur_set_deleted_flag_for_ibuf( when the tablespace is uncompressed */ ibool val, /*!< in: value to set */ - mtr_t* mtr) /*!< in: mtr */ + mtr_t* mtr) /*!< in/out: mini-transaction */ { /* We do not need to reserve btr_search_latch, as the page has just been read to the buffer pool and there cannot be @@ -2987,12 +2987,14 @@ btr_cur_optimistic_delete( page, 1); } #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip + || page_zip_validate(page_zip, page, cursor->index)); #endif /* UNIV_ZIP_DEBUG */ page_cur_delete_rec(btr_cur_get_page_cur(cursor), cursor->index, offsets, mtr); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip + || page_zip_validate(page_zip, page, cursor->index)); #endif /* UNIV_ZIP_DEBUG */ if (dict_index_is_clust(cursor->index) @@ -3087,7 +3089,7 @@ btr_cur_pessimistic_delete( rec = btr_cur_get_rec(cursor); page_zip = buf_block_get_page_zip(block); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap); @@ -3097,7 +3099,7 @@ btr_cur_pessimistic_delete( rec, offsets, page_zip, rb_ctx, mtr); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ } @@ -3158,7 +3160,7 @@ btr_cur_pessimistic_delete( page_cur_delete_rec(btr_cur_get_page_cur(cursor), index, offsets, mtr); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ ut_ad(btr_check_node_ptr(index, block, mtr)); diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 2b543d8d1cf..96821478e60 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -245,7 +245,7 @@ the read requests for the whole area. #ifndef UNIV_HOTBACKUP /** Value in microseconds */ -static const int WAIT_FOR_READ = 5000; +static const int WAIT_FOR_READ = 100; /** Number of attemtps made to read in a page in the buffer pool */ static const ulint BUF_PAGE_READ_MAX_RETRIES = 100; @@ -2829,8 +2829,9 @@ wait_until_unfixed: mutex_exit(&block->mutex); if (io_fix == BUF_IO_READ) { - - os_thread_sleep(WAIT_FOR_READ); + /* wait by temporaly s-latch */ + rw_lock_s_lock(&(block->lock)); + rw_lock_s_unlock(&(block->lock)); } else { break; } diff --git a/storage/innobase/buf/buf0lru.cc b/storage/innobase/buf/buf0lru.cc index 1e2c15f969f..c35d84cb985 100644 --- a/storage/innobase/buf/buf0lru.cc +++ b/storage/innobase/buf/buf0lru.cc @@ -1805,7 +1805,9 @@ buf_LRU_block_remove_hashed_page( break; case FIL_PAGE_INDEX: #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(&bpage->zip, page)); + ut_a(page_zip_validate( + &bpage->zip, page, + ((buf_block_t*) bpage)->index)); #endif /* UNIV_ZIP_DEBUG */ break; default: diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 5871281e1b9..8282dafda0c 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -2528,7 +2528,6 @@ dict_index_build_internal_clust( { dict_index_t* new_index; dict_field_t* field; - ulint fixed_size; ulint trx_id_pos; ulint i; ibool* indexed; @@ -2605,7 +2604,7 @@ dict_index_build_internal_clust( for (i = 0; i < trx_id_pos; i++) { - fixed_size = dict_col_get_fixed_size( + ulint fixed_size = dict_col_get_fixed_size( dict_index_get_nth_col(new_index, i), dict_table_is_comp(table)); @@ -2622,7 +2621,20 @@ dict_index_build_internal_clust( break; } - new_index->trx_id_offset += (unsigned int) fixed_size; + /* Add fixed_size to new_index->trx_id_offset. + Because the latter is a bit-field, an overflow + can theoretically occur. Check for it. */ + fixed_size += new_index->trx_id_offset; + + new_index->trx_id_offset = fixed_size; + + if (new_index->trx_id_offset != fixed_size) { + /* Overflow. Pretend that this is a + variable-length PRIMARY KEY. */ + ut_ad(0); + new_index->trx_id_offset = 0; + break; + } } } diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 4c6ed9807f6..2e6835fe0c0 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -194,16 +194,18 @@ struct fil_space_struct { .ibd file of tablespace and want to stop temporarily posting of new i/o requests on the file */ - ibool stop_ibuf_merges; + ibool stop_new_ops; /*!< we set this TRUE when we start - deleting a single-table tablespace */ - ibool is_being_deleted; - /*!< this is set to TRUE when we start - deleting a single-table tablespace and its - file; when this flag is set no further i/o - or flush requests can be placed on this space, - though there may be such requests still being - processed on this space */ + deleting a single-table tablespace. + When this is set following new ops + are not allowed: + * read IO request + * ibuf merge + * file flush + Note that we can still possibly have + new write operations because we don't + check this flag when doing flush + batches. */ ulint purpose;/*!< FIL_TABLESPACE, FIL_LOG, or FIL_ARCH_LOG */ UT_LIST_BASE_NODE_T(fil_node_t) chain; @@ -220,12 +222,13 @@ struct fil_space_struct { ulint n_pending_flushes; /*!< this is positive when flushing the tablespace to disk; dropping of the tablespace is forbidden if this is positive */ - ulint n_pending_ibuf_merges;/*!< this is positive - when merging insert buffer entries to - a page so that we may need to access - the ibuf bitmap page in the - tablespade: dropping of the tablespace - is forbidden if this is positive */ + ulint n_pending_ops;/*!< this is positive when we + have pending operations against this + tablespace. The pending operations can + be ibuf merges or lock validation code + trying to read a block. + Dropping of the tablespace is forbidden + if this is positive */ hash_node_t hash; /*!< hash chain node */ hash_node_t name_hash;/*!< hash chain the name_hash table */ #ifndef UNIV_HOTBACKUP @@ -1928,13 +1931,12 @@ fil_read_first_page( #ifndef UNIV_HOTBACKUP /*******************************************************************//** -Increments the count of pending insert buffer page merges, if space is not -being deleted. -@return TRUE if being deleted, and ibuf merges should be skipped */ +Increments the count of pending operation, if space is not being deleted. +@return TRUE if being deleted, and operation should be skipped */ UNIV_INTERN ibool -fil_inc_pending_ibuf_merges( -/*========================*/ +fil_inc_pending_ops( +/*================*/ ulint id) /*!< in: space id */ { fil_space_t* space; @@ -1945,18 +1947,18 @@ fil_inc_pending_ibuf_merges( if (space == NULL) { fprintf(stderr, - "InnoDB: Error: trying to do ibuf merge to a" + "InnoDB: Error: trying to do an operation on a" " dropped tablespace %lu\n", (ulong) id); } - if (space == NULL || space->stop_ibuf_merges) { + if (space == NULL || space->stop_new_ops) { mutex_exit(&fil_system->mutex); return(TRUE); } - space->n_pending_ibuf_merges++; + space->n_pending_ops++; mutex_exit(&fil_system->mutex); @@ -1964,11 +1966,11 @@ fil_inc_pending_ibuf_merges( } /*******************************************************************//** -Decrements the count of pending insert buffer page merges. */ +Decrements the count of pending operations. */ UNIV_INTERN void -fil_decr_pending_ibuf_merges( -/*=========================*/ +fil_decr_pending_ops( +/*=================*/ ulint id) /*!< in: space id */ { fil_space_t* space; @@ -1979,13 +1981,13 @@ fil_decr_pending_ibuf_merges( if (space == NULL) { fprintf(stderr, - "InnoDB: Error: decrementing ibuf merge of a" - " dropped tablespace %lu\n", + "InnoDB: Error: decrementing pending operation" + " of a dropped tablespace %lu\n", (ulong) id); } if (space != NULL) { - space->n_pending_ibuf_merges--; + space->n_pending_ops--; } mutex_exit(&fil_system->mutex); @@ -2181,7 +2183,6 @@ fil_op_log_parse_or_replay( } */ if (!space_id) { - return(ptr); } @@ -2276,15 +2277,15 @@ fil_delete_tablespace( char* path; ut_a(id != 0); -stop_ibuf_merges: +stop_new_ops: mutex_enter(&fil_system->mutex); space = fil_space_get_by_id(id); if (space != NULL) { - space->stop_ibuf_merges = TRUE; + space->stop_new_ops = TRUE; - if (space->n_pending_ibuf_merges == 0) { + if (space->n_pending_ops == 0) { mutex_exit(&fil_system->mutex); count = 0; @@ -2298,9 +2299,10 @@ stop_ibuf_merges: ut_print_filename(stderr, space->name); fprintf(stderr, ",\n" "InnoDB: but there are %lu pending" - " ibuf merges on it.\n" + " operations (most likely ibuf merges)" + " on it.\n" "InnoDB: Loop %lu.\n", - (ulong) space->n_pending_ibuf_merges, + (ulong) space->n_pending_ops, (ulong) count); } @@ -2309,7 +2311,7 @@ stop_ibuf_merges: os_thread_sleep(20000); count++; - goto stop_ibuf_merges; + goto stop_new_ops; } } @@ -2334,10 +2336,8 @@ try_again: return(FALSE); } - ut_a(space); - ut_a(space->n_pending_ibuf_merges == 0); - - space->is_being_deleted = TRUE; + ut_a(space->stop_new_ops); + ut_a(space->n_pending_ops == 0); /* TODO: The following code must change when InnoDB supports multiple datafiles per tablespace. */ @@ -2386,12 +2386,26 @@ try_again: rw_lock_x_lock(&space->latch); #ifndef UNIV_HOTBACKUP - /* Invalidate in the buffer pool all pages belonging to the - tablespace. Since we have set space->is_being_deleted = TRUE, readahead - or ibuf merge can no longer read more pages of this tablespace to the - buffer pool. Thus we can clean the tablespace out of the buffer pool - completely and permanently. The flag is_being_deleted also prevents - fil_flush() from being applied to this tablespace. */ + /* IMPORTANT: Because we have set space::stop_new_ops there + can't be any new ibuf merges, reads or flushes. We are here + because node::n_pending was zero above. However, it is still + possible to have pending read and write requests: + + A read request can happen because the reader thread has + gone through the ::stop_new_ops check in buf_page_init_for_read() + before the flag was set and has not yet incremented ::n_pending + when we checked it above. + + A write request can be issued any time because we don't check + the ::stop_new_ops flag when queueing a block for write. + + We deal with pending write requests in the following function + where we'd minimally evict all dirty pages belonging to this + space from the flush_list. Not that if a block is IO-fixed + we'll wait for IO to complete. + + To deal with potential read requests by checking the + ::stop_new_ops flag in fil_io() */ buf_LRU_invalidate_tablespace(id); #endif @@ -2399,6 +2413,15 @@ try_again: mutex_enter(&fil_system->mutex); + /* Double check the sanity of pending ops after reacquiring + the fil_system::mutex. */ + if (fil_space_get_by_id(id)) { + ut_a(space->n_pending_ops == 0); + ut_a(UT_LIST_GET_LEN(space->chain) == 1); + node = UT_LIST_GET_FIRST(space->chain); + ut_a(node->n_pending == 0); + } + success = fil_space_free(id, TRUE); mutex_exit(&fil_system->mutex); @@ -2456,7 +2479,7 @@ fil_tablespace_is_being_deleted( ut_a(space != NULL); - is_being_deleted = space->is_being_deleted; + is_being_deleted = space->stop_new_ops; mutex_exit(&fil_system->mutex); @@ -3744,7 +3767,7 @@ fil_tablespace_deleted_or_being_deleted_in_mem( space = fil_space_get_by_id(id); - if (space == NULL || space->is_being_deleted) { + if (space == NULL || space->stop_new_ops) { mutex_exit(&fil_system->mutex); return(TRUE); @@ -4472,7 +4495,9 @@ fil_io( space = fil_space_get_by_id(space_id); - if (!space) { + /* If we are deleting a tablespace we don't allow any read + operations on that. However, we do allow write operations. */ + if (!space || (type == OS_FILE_READ && space->stop_new_ops)) { mutex_exit(&fil_system->mutex); ut_print_timestamp(stderr); @@ -4691,7 +4716,7 @@ fil_flush( space = fil_space_get_by_id(space_id); - if (!space || space->is_being_deleted) { + if (!space || space->stop_new_ops) { mutex_exit(&fil_system->mutex); return; @@ -4823,7 +4848,7 @@ fil_flush_file_spaces( space; space = UT_LIST_GET_NEXT(unflushed_spaces, space)) { - if (space->purpose == purpose && !space->is_being_deleted) { + if (space->purpose == purpose && !space->stop_new_ops) { space_ids[n_space_ids++] = space->id; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b1215e6bdef..e19fe47e81a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -607,6 +607,9 @@ innobase_commit_ordered( bool all); /*!< in: TRUE - commit transaction FALSE - the current SQL statement ended */ +static +void +innobase_kill_query(handlerton *hton, THD* thd, enum thd_kill_levels level); /*****************************************************************//** Commits a transaction in an InnoDB database or marks an SQL statement @@ -1255,8 +1258,7 @@ convert_error_code_to_mysql( return(0); case DB_INTERRUPTED: - my_error(ER_QUERY_INTERRUPTED, MYF(0)); - /* fall through */ + return(HA_ERR_ABORTED_BY_USER); case DB_FOREIGN_EXCEED_MAX_CASCADE: ut_ad(thd); @@ -1348,11 +1350,22 @@ convert_error_code_to_mysql( case DB_TABLE_NOT_FOUND: return(HA_ERR_NO_SUCH_TABLE); - case DB_TOO_BIG_RECORD: - my_error(ER_TOO_BIG_ROWSIZE, MYF(0), - page_get_free_space_of_empty(flags - & DICT_TF_COMPACT) / 2); + case DB_TOO_BIG_RECORD: { + /* If prefix is true then a 768-byte prefix is stored + locally for BLOB fields. Refer to dict_table_get_format() */ + bool prefix = (dict_tf_get_format(flags) == UNIV_FORMAT_A); + my_printf_error(ER_TOO_BIG_ROWSIZE, + "Row size too large (> %lu). Changing some columns " + "to TEXT or BLOB %smay help. In current row " + "format, BLOB prefix of %d bytes is stored inline.", + MYF(0), + page_get_free_space_of_empty(flags & + DICT_TF_COMPACT) / 2, + prefix ? "or using ROW_FORMAT=DYNAMIC " + "or ROW_FORMAT=COMPRESSED ": "", + prefix ? DICT_MAX_FIXED_COL_LEN : 0); return(HA_ERR_TO_BIG_ROW); + } case DB_TOO_BIG_INDEX_COL: my_error(ER_INDEX_COLUMN_TOO_LONG, MYF(0), @@ -1869,7 +1882,10 @@ innobase_next_autoinc( offset = 0; } - /* Check for overflow. */ + /* Check for overflow. Current can be > max_value if the value is + in reality a negative value.The visual studio compilers converts + large double values automatically into unsigned long long datatype + maximum value */ if (block >= max_value || offset > max_value || current >= max_value @@ -2523,7 +2539,7 @@ trx_is_interrupted( /*===============*/ trx_t* trx) /*!< in: transaction */ { - return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd)); + return(trx && trx->mysql_thd && thd_kill_level((THD*) trx->mysql_thd)); } /**********************************************************************//** @@ -2673,6 +2689,7 @@ innobase_init( innobase_release_temporary_latches; innobase_hton->alter_table_flags = innobase_alter_table_flags; + innobase_hton->kill_query = innobase_kill_query; ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); @@ -3830,6 +3847,30 @@ innobase_close_connection( DBUG_RETURN(0); } +/*****************************************************************//** +Cancel any pending lock request associated with the current THD. */ +static +void +innobase_kill_query( +/*======================*/ + handlerton* hton, /*!< in: innobase handlerton */ + THD* thd, /*!< in: MySQL thread being killed */ + enum thd_kill_levels level) /*!< in: kill level */ +{ + trx_t* trx; + DBUG_ENTER("innobase_kill_query"); + DBUG_ASSERT(hton == innodb_hton_ptr); + + trx = thd_to_trx(thd); + /* Cancel a pending lock request. */ + if (trx) { + lock_trx_handle_wait(trx); + } + + DBUG_VOID_RETURN; +} + + /*************************************************************************//** ** InnoDB database tables *****************************************************************************/ @@ -10732,7 +10773,7 @@ ha_innobase::check( row_mysql_unlock_data_dictionary(prebuilt->trx); } - if (thd_killed(user_thd)) { + if (thd_kill_level(user_thd)) { break; } @@ -10790,7 +10831,7 @@ ha_innobase::check( srv_fatal_semaphore_wait_threshold, 7200/*2 hours*/); prebuilt->trx->op_info = ""; - if (thd_killed(user_thd)) { + if (thd_kill_level(user_thd)) { my_error(ER_QUERY_INTERRUPTED, MYF(0)); } @@ -15094,8 +15135,8 @@ static MYSQL_SYSVAR_ENUM(stats_method, srv_innodb_stats_method, #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG static MYSQL_SYSVAR_UINT(change_buffering_debug, ibuf_debug, PLUGIN_VAR_RQCMDARG, - "Debug flags for InnoDB change buffering (0=none)", - NULL, NULL, 0, 0, 1, 0); + "Debug flags for InnoDB change buffering (0=none, 2=crash at merge)", + NULL, NULL, 0, 0, 2, 0); #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ static MYSQL_SYSVAR_BOOL(random_read_ahead, srv_random_read_ahead, diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 9039a91d56f..e56a1ec52e3 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -78,12 +78,13 @@ class ha_innobase: public handler uchar* upd_buf; /*!< buffer used in updates */ ulint upd_buf_size; /*!< the size of upd_buf in bytes */ - uchar srch_key_val1[REC_VERSION_56_MAX_INDEX_COL_LEN + 2]; - uchar srch_key_val2[REC_VERSION_56_MAX_INDEX_COL_LEN + 2]; + uchar srch_key_val1[MAX_KEY_LENGTH + MAX_REF_PARTS*2]; + uchar srch_key_val2[MAX_KEY_LENGTH + MAX_REF_PARTS*2]; /*!< buffers used in converting search key values from MySQL format - to InnoDB format. "+ 2" for the two - bytes where the length is stored */ + to InnoDB format. For each column + 2 bytes are used to store length, + hence MAX_REF_PARTS*2. */ Table_flags int_table_flags; uint primary_key; ulong start_of_scan; /*!< this is set to 1 when we are diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 9de45527ec7..1468bc79c04 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -113,13 +113,17 @@ innobase_col_to_mysql( /* These column types should never be shipped to MySQL. */ ut_ad(0); - case DATA_CHAR: case DATA_FIXBINARY: case DATA_FLOAT: case DATA_DOUBLE: case DATA_DECIMAL: /* Above are the valid column types for MySQL data. */ ut_ad(flen == len); + /* fall through */ + case DATA_CHAR: + /* We may have flen > len when there is a shorter + prefix on a CHAR column. */ + ut_ad(flen >= len); #else /* UNIV_DEBUG */ default: #endif /* UNIV_DEBUG */ @@ -154,7 +158,7 @@ innobase_rec_to_mysql( field->reset(); - ipos = dict_index_get_nth_col_pos(index, i); + ipos = dict_index_get_nth_col_or_prefix_pos(index, i, TRUE); if (UNIV_UNLIKELY(ipos == ULINT_UNDEFINED)) { null_field: diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index 1d0abbc2981..cd9de39f3c6 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -2756,6 +2756,14 @@ ibuf_get_volume_buffered_count_func( when the database was started up. */ ut_a(len == 1); + if (rec_get_deleted_flag(rec, 0)) { + /* This record has been merged already, + but apparently the system crashed before + the change was discarded from the buffer. + Pretend that the record does not exist. */ + return(0); + } + types = rec_get_nth_field_old(rec, IBUF_REC_FIELD_METADATA, &len); switch (UNIV_EXPECT(len % DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE, @@ -4050,11 +4058,11 @@ ibuf_delete( page, 1); } #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ page_cur_delete_rec(&page_cur, index, offsets, mtr); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ if (page_zip) { @@ -4159,6 +4167,22 @@ ibuf_delete_rec( ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no); ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space); +#if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG + if (ibuf_debug == 2) { + /* Inject a fault (crash). We do this before trying + optimistic delete, because a pessimistic delete in the + change buffer would require a larger test case. */ + + /* Flag the buffered record as processed, to avoid + an assertion failure after crash recovery. */ + btr_cur_set_deleted_flag_for_ibuf( + btr_pcur_get_rec(pcur), NULL, TRUE, mtr); + ibuf_mtr_commit(mtr); + log_write_up_to(IB_ULONGLONG_MAX, LOG_WAIT_ALL_GROUPS, TRUE); + DBUG_SUICIDE(); + } +#endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ + success = btr_cur_optimistic_delete(btr_pcur_get_btr_cur(pcur), mtr); if (success) { @@ -4193,7 +4217,13 @@ ibuf_delete_rec( ut_ad(ibuf_rec_get_page_no(mtr, btr_pcur_get_rec(pcur)) == page_no); ut_ad(ibuf_rec_get_space(mtr, btr_pcur_get_rec(pcur)) == space); - /* We have to resort to a pessimistic delete from ibuf */ + /* We have to resort to a pessimistic delete from ibuf. + Delete-mark the record so that it will not be applied again, + in case the server crashes before the pessimistic delete is + made persistent. */ + btr_cur_set_deleted_flag_for_ibuf( + btr_pcur_get_rec(pcur), NULL, TRUE, mtr); + btr_pcur_store_position(pcur, mtr); ibuf_btr_pcur_commit_specify_mtr(pcur, mtr); @@ -4309,7 +4339,7 @@ ibuf_merge_or_delete_for_page( function. When the counter is > 0, that prevents tablespace from being dropped. */ - tablespace_being_deleted = fil_inc_pending_ibuf_merges(space); + tablespace_being_deleted = fil_inc_pending_ops(space); if (UNIV_UNLIKELY(tablespace_being_deleted)) { /* Do not try to read the bitmap page from space; @@ -4335,7 +4365,7 @@ ibuf_merge_or_delete_for_page( /* No inserts buffered for this page */ if (!tablespace_being_deleted) { - fil_decr_pending_ibuf_merges(space); + fil_decr_pending_ops(space); } return; @@ -4468,7 +4498,7 @@ loop: fputs("InnoDB: Discarding record\n ", stderr); rec_print_old(stderr, rec); fputs("\nInnoDB: from the insert buffer!\n\n", stderr); - } else if (block) { + } else if (block && !rec_get_deleted_flag(rec, 0)) { /* Now we have at pcur a record which should be applied on the index page; NOTE that the call below copies pointers to fields in rec, and we must @@ -4628,7 +4658,7 @@ reset_bit: if (update_ibuf_bitmap && !tablespace_being_deleted) { - fil_decr_pending_ibuf_merges(space); + fil_decr_pending_ops(space); } #ifdef UNIV_IBUF_COUNT_DEBUG diff --git a/storage/innobase/include/btr0cur.h b/storage/innobase/include/btr0cur.h index 354b6982a13..f437575579e 100644 --- a/storage/innobase/include/btr0cur.h +++ b/storage/innobase/include/btr0cur.h @@ -652,7 +652,7 @@ btr_cur_set_deleted_flag_for_ibuf( when the tablespace is uncompressed */ ibool val, /*!< in: value to set */ - mtr_t* mtr); /*!< in: mtr */ + mtr_t* mtr); /*!< in/out: mini-transaction */ /*######################################################################*/ /** In the pessimistic delete, if the page data size drops below this diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index b770f7e3ca7..ea7e996dfa8 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -456,10 +456,15 @@ struct dict_index_struct{ unsigned type:DICT_IT_BITS; /*!< index type (DICT_CLUSTERED, DICT_UNIQUE, DICT_UNIVERSAL, DICT_IBUF, DICT_CORRUPT) */ - unsigned trx_id_offset:10;/*!< position of the trx id column +#define MAX_KEY_LENGTH_BITS 12 + unsigned trx_id_offset:MAX_KEY_LENGTH_BITS; + /*!< position of the trx id column in a clustered index record, if the fields before it are known to be of a fixed size, 0 otherwise */ +#if (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH +# error (1<<MAX_KEY_LENGTH_BITS) < MAX_KEY_LENGTH +#endif unsigned n_user_defined_cols:10; /*!< number of columns the user defined to be in the index: in the internal diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index fa632ea3c6b..1e2b8049860 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -357,20 +357,19 @@ fil_read_first_page( lsn_t* max_flushed_lsn); /*!< out: max of flushed lsn values in data files */ /*******************************************************************//** -Increments the count of pending insert buffer page merges, if space is not -being deleted. -@return TRUE if being deleted, and ibuf merges should be skipped */ +Increments the count of pending operation, if space is not being deleted. +@return TRUE if being deleted, and operation should be skipped */ UNIV_INTERN ibool -fil_inc_pending_ibuf_merges( -/*========================*/ +fil_inc_pending_ops( +/*================*/ ulint id); /*!< in: space id */ /*******************************************************************//** -Decrements the count of pending insert buffer page merges. */ +Decrements the count of pending operations. */ UNIV_INTERN void -fil_decr_pending_ibuf_merges( -/*=========================*/ +fil_decr_pending_ops( +/*=================*/ ulint id); /*!< in: space id */ #endif /* !UNIV_HOTBACKUP */ /*******************************************************************//** diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h index fa1e6d50224..a1ffe87d5bd 100644 --- a/storage/innobase/include/lock0lock.h +++ b/storage/innobase/include/lock0lock.h @@ -794,6 +794,31 @@ lock_table_get_n_locks( /*===================*/ const dict_table_t* table) /*!< in: table */ __attribute__((nonnull)); +#ifdef UNIV_DEBUG +/*********************************************************************//** +Checks that a transaction id is sensible, i.e., not in the future. +@return true if ok */ +UNIV_INTERN +bool +lock_check_trx_id_sanity( +/*=====================*/ + trx_id_t trx_id, /*!< in: trx id */ + const rec_t* rec, /*!< in: user record */ + dict_index_t* index, /*!< in: index */ + const ulint* offsets) /*!< in: rec_get_offsets(rec, index) */ + __attribute__((nonnull, warn_unused_result)); +/*******************************************************************//** +Check if the transaction holds any locks on the sys tables +or its records. +@return the strongest lock found on any sys table or 0 for none */ +UNIV_INTERN +const lock_t* +lock_trx_has_sys_table_locks( +/*=========================*/ + const trx_t* trx) /*!< in: transaction to check */ + __attribute__((warn_unused_result)); +#endif /* UNIV_DEBUG */ + /** Lock modes and types */ /* @{ */ #define LOCK_MODE_MASK 0xFUL /*!< mask used to extract mode from the diff --git a/storage/innobase/include/page0zip.h b/storage/innobase/include/page0zip.h index f127fad2260..2c84f75b2ab 100644 --- a/storage/innobase/include/page0zip.h +++ b/storage/innobase/include/page0zip.h @@ -157,9 +157,10 @@ page_zip_validate_low( /*==================*/ const page_zip_des_t* page_zip,/*!< in: compressed page */ const page_t* page, /*!< in: uncompressed page */ + const dict_index_t* index, /*!< in: index of the page, if known */ ibool sloppy) /*!< in: FALSE=strict, TRUE=ignore the MIN_REC_FLAG */ - __attribute__((nonnull)); + __attribute__((nonnull(1,2))); /**********************************************************************//** Check that the compressed and decompressed pages match. */ UNIV_INTERN @@ -167,8 +168,9 @@ ibool page_zip_validate( /*==============*/ const page_zip_des_t* page_zip,/*!< in: compressed page */ - const page_t* page) /*!< in: uncompressed page */ - __attribute__((nonnull)); + const page_t* page, /*!< in: uncompressed page */ + const dict_index_t* index) /*!< in: index of the page, if known */ + __attribute__((nonnull(1,2))); #endif /* UNIV_ZIP_DEBUG */ /**********************************************************************//** diff --git a/storage/innobase/include/row0undo.h b/storage/innobase/include/row0undo.h index 90a15172ae0..47f9afdc74a 100644 --- a/storage/innobase/include/row0undo.h +++ b/storage/innobase/include/row0undo.h @@ -87,10 +87,6 @@ that index record. */ enum undo_exec { UNDO_NODE_FETCH_NEXT = 1, /*!< we should fetch the next undo log record */ - UNDO_NODE_PREV_VERS, /*!< the roll ptr to previous - version of a row is stored in - node, and undo should be done - based on it */ UNDO_NODE_INSERT, /*!< undo a fresh insert of a row to a table */ UNDO_NODE_MODIFY /*!< undo a modify operation @@ -108,9 +104,6 @@ struct undo_node_struct{ undo_no_t undo_no;/*!< undo number of the record */ ulint rec_type;/*!< undo log record type: TRX_UNDO_INSERT_REC, ... */ - roll_ptr_t new_roll_ptr; - /*!< roll ptr to restore to clustered index - record */ trx_id_t new_trx_id; /*!< trx id to restore to clustered index record */ btr_pcur_t pcur; /*!< persistent cursor used in searching the diff --git a/storage/innobase/include/row0upd.ic b/storage/innobase/include/row0upd.ic index 8a2543eaac9..d054662c080 100644 --- a/storage/innobase/include/row0upd.ic +++ b/storage/innobase/include/row0upd.ic @@ -28,6 +28,7 @@ Created 12/27/1996 Heikki Tuuri # include "trx0trx.h" # include "trx0undo.h" # include "row0row.h" +# include "lock0lock.h" #endif /* !UNIV_HOTBACKUP */ #include "page0zip.h" @@ -171,6 +172,8 @@ row_upd_rec_sys_fields( #if DATA_TRX_ID + 1 != DATA_ROLL_PTR # error "DATA_TRX_ID + 1 != DATA_ROLL_PTR" #endif + ut_ad(lock_check_trx_id_sanity(trx_read_trx_id(rec + offset), + rec, index, offsets)); trx_write_trx_id(rec + offset, trx->id); trx_write_roll_ptr(rec + offset + DATA_TRX_ID_LEN, roll_ptr); } diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 18fbfbee91b..476b305ca70 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -488,9 +488,13 @@ lock_report_trx_id_insanity( /*********************************************************************//** Checks that a transaction id is sensible, i.e., not in the future. -@return TRUE if ok */ -static -ibool +@return true if ok */ +#ifdef UNIV_DEBUG +UNIV_INTERN +#else +static __attribute__((nonnull, warn_unused_result)) +#endif +bool lock_check_trx_id_sanity( /*=====================*/ trx_id_t trx_id, /*!< in: trx id */ diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index a360d05f056..f914fc2676c 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -1636,9 +1636,8 @@ recv_recover_page_func( if (fil_page_get_type(page) == FIL_PAGE_INDEX) { page_zip_des_t* page_zip = buf_block_get_page_zip(block); - if (page_zip) { - ut_a(page_zip_validate_low(page_zip, page, FALSE)); - } + ut_a(!page_zip + || page_zip_validate_low(page_zip, page, NULL, FALSE)); } #endif /* UNIV_ZIP_DEBUG */ diff --git a/storage/innobase/mysql-test/storage_engine/alter_tablespace.rdiff b/storage/innobase/mysql-test/storage_engine/alter_tablespace.rdiff new file mode 100644 index 00000000000..0cbe1fa48ae --- /dev/null +++ b/storage/innobase/mysql-test/storage_engine/alter_tablespace.rdiff @@ -0,0 +1,11 @@ +--- suite/storage_engine/alter_tablespace.result 2013-01-13 01:03:49.133994000 +0400 ++++ suite/storage_engine/alter_tablespace.reject 2013-01-13 01:04:04.398937286 +0400 +@@ -10,7 +10,7 @@ + 2 + ALTER TABLE t1 DISCARD TABLESPACE; + SELECT * FROM t1; +-ERROR HY000: Got error -1 from storage engine ++ERROR HY000: Got error -1 "Internal error < 0 (Not system error)" from storage engine + ALTER TABLE t1 IMPORT TABLESPACE; + SELECT * FROM t1; + a diff --git a/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff index 4c0e0c375f5..8bf84115a52 100644 --- a/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff +++ b/storage/innobase/mysql-test/storage_engine/tbl_opt_row_format.rdiff @@ -4,7 +4,7 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a <INT_COLUMN>, b <CHAR_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS> ROW_FORMAT=FIXED; +Warnings: -+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. ++Warning 140 InnoDB: assuming ROW_FORMAT=COMPACT. SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index ec9e234229a..62cde1cf728 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -1443,6 +1443,13 @@ os_file_create_func( create_mode &= ~OS_FILE_ON_ERROR_NO_EXIT; create_mode &= ~OS_FILE_ON_ERROR_SILENT; + + DBUG_EXECUTE_IF( + "ib_create_table_fail_disk_full", + *success = FALSE; + SetLastError(ERROR_DISK_FULL); + return((os_file_t) -1); + ); try_again: ut_a(name); @@ -1560,6 +1567,12 @@ try_again: create_mode &= ~OS_FILE_ON_ERROR_NO_EXIT; create_mode &= ~OS_FILE_ON_ERROR_SILENT; + DBUG_EXECUTE_IF( + "ib_create_table_fail_disk_full", + *success = FALSE; + errno = ENOSPC; + return((os_file_t) -1); + ); try_again: ut_a(name); diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 3ae063dedec..9046338f377 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -310,7 +310,7 @@ page_cur_search_with_match( #endif /* UNIV_DEBUG */ page = buf_block_get_frame(block); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ page_check_dir(page); @@ -1249,7 +1249,7 @@ page_cur_insert_rec_zip( ut_ad(!page_rec_is_supremum(*current_rec)); #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ /* 1. Get the size of the physical record in the page */ @@ -1973,7 +1973,7 @@ page_cur_delete_rec( } #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ } diff --git a/storage/innobase/page/page0page.cc b/storage/innobase/page/page0page.cc index fb3e21b8b26..deef6935f08 100644 --- a/storage/innobase/page/page0page.cc +++ b/storage/innobase/page/page0page.cc @@ -626,7 +626,7 @@ page_copy_rec_list_end( Furthermore, btr_compress() may set FIL_PAGE_PREV to FIL_NULL on new_page while leaving it intact on new_page_zip. So, we cannot validate new_page_zip. */ - ut_a(page_zip_validate_low(page_zip, page, TRUE)); + ut_a(page_zip_validate_low(page_zip, page, index, TRUE)); } #endif /* UNIV_ZIP_DEBUG */ ut_ad(buf_block_get_frame(block) == page); @@ -943,7 +943,7 @@ page_delete_rec_list_end( ut_ad(size == ULINT_UNDEFINED || size < UNIV_PAGE_SIZE); ut_ad(!page_zip || page_rec_is_comp(rec)); #ifdef UNIV_ZIP_DEBUG - ut_a(!page_zip || page_zip_validate(page_zip, page)); + ut_a(!page_zip || page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ if (page_rec_is_infimum(rec)) { @@ -985,7 +985,7 @@ page_delete_rec_list_end( ULINT_UNDEFINED, &heap); rec = rec_get_next_ptr(rec, TRUE); #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ page_cur_delete_rec(&cur, index, offsets, mtr); } while (page_offset(rec) != PAGE_NEW_SUPREMUM); @@ -1123,7 +1123,8 @@ page_delete_rec_list_start( between btr_attach_half_pages() and insert_page = ... when btr_page_get_split_rec_to_left() holds (direction == FSP_DOWN). */ - ut_a(!page_zip || page_zip_validate_low(page_zip, page, TRUE)); + ut_a(!page_zip + || page_zip_validate_low(page_zip, page, index, TRUE)); } #endif /* UNIV_ZIP_DEBUG */ @@ -1194,9 +1195,10 @@ page_move_rec_list_end( = buf_block_get_page_zip(block); ut_a(!new_page_zip == !page_zip); ut_a(!new_page_zip - || page_zip_validate(new_page_zip, new_page)); + || page_zip_validate(new_page_zip, new_page, index)); ut_a(!page_zip - || page_zip_validate(page_zip, page_align(split_rec))); + || page_zip_validate(page_zip, page_align(split_rec), + index)); } #endif /* UNIV_ZIP_DEBUG */ diff --git a/storage/innobase/page/page0zip.cc b/storage/innobase/page/page0zip.cc index ce75d4e15fc..35a8f458fb2 100644 --- a/storage/innobase/page/page0zip.cc +++ b/storage/innobase/page/page0zip.cc @@ -1447,7 +1447,7 @@ err_exit: page_zip_get_size(page_zip) - PAGE_DATA); mem_heap_free(heap); #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ if (mtr) { @@ -3140,6 +3140,7 @@ page_zip_validate_low( /*==================*/ const page_zip_des_t* page_zip,/*!< in: compressed page */ const page_t* page, /*!< in: uncompressed page */ + const dict_index_t* index, /*!< in: index of the page, if known */ ibool sloppy) /*!< in: FALSE=strict, TRUE=ignore the MIN_REC_FLAG */ { @@ -3227,39 +3228,102 @@ page_zip_validate_low( committed. Let us tolerate that difference when we are performing a sloppy validation. */ - if (sloppy) { - byte info_bits_diff; - ulint offset - = rec_get_next_offs(page + PAGE_NEW_INFIMUM, - TRUE); - ut_a(offset >= PAGE_NEW_SUPREMUM); - offset -= 5 /* REC_NEW_INFO_BITS */; - - info_bits_diff = page[offset] ^ temp_page[offset]; - - if (info_bits_diff == REC_INFO_MIN_REC_FLAG) { - temp_page[offset] = page[offset]; - - if (!memcmp(page + PAGE_HEADER, - temp_page + PAGE_HEADER, - UNIV_PAGE_SIZE - PAGE_HEADER - - FIL_PAGE_DATA_END)) { - - /* Only the minimum record flag - differed. Let us ignore it. */ - page_zip_fail(("page_zip_validate: " - "min_rec_flag " - "(ignored, " - "%lu,%lu,0x%02lx)\n", - page_get_space_id(page), - page_get_page_no(page), - (ulong) page[offset])); - goto func_exit; - } + ulint* offsets; + mem_heap_t* heap; + const rec_t* rec; + const rec_t* trec; + byte info_bits_diff; + ulint offset + = rec_get_next_offs(page + PAGE_NEW_INFIMUM, TRUE); + ut_a(offset >= PAGE_NEW_SUPREMUM); + offset -= 5/*REC_NEW_INFO_BITS*/; + + info_bits_diff = page[offset] ^ temp_page[offset]; + + if (info_bits_diff == REC_INFO_MIN_REC_FLAG) { + temp_page[offset] = page[offset]; + + if (!memcmp(page + PAGE_HEADER, + temp_page + PAGE_HEADER, + UNIV_PAGE_SIZE - PAGE_HEADER + - FIL_PAGE_DATA_END)) { + + /* Only the minimum record flag + differed. Let us ignore it. */ + page_zip_fail(("page_zip_validate: " + "min_rec_flag " + "(%s" + "%lu,%lu,0x%02lx)\n", + sloppy ? "ignored, " : "", + page_get_space_id(page), + page_get_page_no(page), + (ulong) page[offset])); + valid = sloppy; + goto func_exit; + } + } + + /* Compare the pointers in the PAGE_FREE list. */ + rec = page_header_get_ptr(page, PAGE_FREE); + trec = page_header_get_ptr(temp_page, PAGE_FREE); + + while (rec || trec) { + if (page_offset(rec) != page_offset(trec)) { + page_zip_fail(("page_zip_validate: " + "PAGE_FREE list: %u!=%u\n", + (unsigned) page_offset(rec), + (unsigned) page_offset(trec))); + valid = FALSE; + goto func_exit; } + + rec = page_rec_get_next_low(rec, TRUE); + trec = page_rec_get_next_low(trec, TRUE); } - page_zip_fail(("page_zip_validate: content\n")); + + /* Compare the records. */ + heap = NULL; + offsets = NULL; + rec = page_rec_get_next_low( + page + PAGE_NEW_INFIMUM, TRUE); + trec = page_rec_get_next_low( + temp_page + PAGE_NEW_INFIMUM, TRUE); + + do { + if (page_offset(rec) != page_offset(trec)) { + page_zip_fail(("page_zip_validate: " + "record list: 0x%02x!=0x%02x\n", + (unsigned) page_offset(rec), + (unsigned) page_offset(trec))); valid = FALSE; + break; + } + + if (index) { + /* Compare the data. */ + offsets = rec_get_offsets( + rec, index, offsets, + ULINT_UNDEFINED, &heap); + + if (memcmp(rec - rec_offs_extra_size(offsets), + trec - rec_offs_extra_size(offsets), + rec_offs_size(offsets))) { + page_zip_fail( + ("page_zip_validate: " + "record content: 0x%02x", + (unsigned) page_offset(rec))); + valid = FALSE; + break; + } + } + + rec = page_rec_get_next_low(rec, TRUE); + trec = page_rec_get_next_low(trec, TRUE); + } while (rec || trec); + + if (heap) { + mem_heap_free(heap); + } } func_exit: @@ -3281,9 +3345,10 @@ ibool page_zip_validate( /*==============*/ const page_zip_des_t* page_zip,/*!< in: compressed page */ - const page_t* page) /*!< in: uncompressed page */ + const page_t* page, /*!< in: uncompressed page */ + const dict_index_t* index) /*!< in: index of the page, if known */ { - return(page_zip_validate_low(page_zip, page, + return(page_zip_validate_low(page_zip, page, index, recv_recovery_is_on())); } #endif /* UNIV_ZIP_DEBUG */ @@ -3614,7 +3679,7 @@ page_zip_write_rec( page_zip->m_nonempty = TRUE; #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page_align(rec))); + ut_a(page_zip_validate(page_zip, page_align(rec), index)); #endif /* UNIV_ZIP_DEBUG */ } @@ -3661,7 +3726,7 @@ corrupt: } #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, NULL)); #endif /* UNIV_ZIP_DEBUG */ memcpy(page + offset, @@ -3670,7 +3735,7 @@ corrupt: ptr + 4, BTR_EXTERN_FIELD_REF_SIZE); #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, NULL)); #endif /* UNIV_ZIP_DEBUG */ } @@ -3737,7 +3802,7 @@ page_zip_write_blob_ptr( memcpy(externs, field, BTR_EXTERN_FIELD_REF_SIZE); #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ if (mtr) { @@ -3808,7 +3873,7 @@ corrupt: } #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, NULL)); #endif /* UNIV_ZIP_DEBUG */ field = page + offset; @@ -3829,7 +3894,7 @@ corrupt: memcpy(storage, ptr + 4, REC_NODE_PTR_SIZE); #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, NULL)); #endif /* UNIV_ZIP_DEBUG */ } @@ -3924,6 +3989,7 @@ page_zip_write_trx_id_and_roll_ptr( ulint len; ut_ad(PAGE_ZIP_MATCH(rec, page_zip)); + ut_ad(page_simple_validate_new(page)); ut_ad(page_zip_simple_validate(page_zip)); ut_ad(page_zip_get_size(page_zip) @@ -4056,7 +4122,7 @@ page_zip_clear_rec( } #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ } @@ -4080,7 +4146,7 @@ page_zip_rec_set_deleted( *slot &= ~(PAGE_ZIP_DIR_SLOT_DEL >> 8); } #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page_align(rec))); + ut_a(page_zip_validate(page_zip, page_align(rec), NULL)); #endif /* UNIV_ZIP_DEBUG */ } @@ -4381,14 +4447,14 @@ corrupt: goto corrupt; } #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, NULL)); #endif /* UNIV_ZIP_DEBUG */ memcpy(page + offset, ptr, len); memcpy(page_zip->data + offset, ptr, len); #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, NULL)); #endif /* UNIV_ZIP_DEBUG */ } @@ -4466,7 +4532,7 @@ page_zip_reorganize( ut_ad(mtr_memo_contains(mtr, block, MTR_MEMO_PAGE_X_FIX)); ut_ad(page_is_comp(page)); ut_ad(!dict_index_is_ibuf(index)); - /* Note that page_zip_validate(page_zip, page) may fail here. */ + /* Note that page_zip_validate(page_zip, page, index) may fail here. */ UNIV_MEM_ASSERT_RW(page, UNIV_PAGE_SIZE); UNIV_MEM_ASSERT_RW(page_zip->data, page_zip_get_size(page_zip)); @@ -4553,7 +4619,7 @@ page_zip_copy_recs( FIL_PAGE_PREV or PAGE_LEVEL, causing a temporary min_rec_flag mismatch. A strict page_zip_validate() will be executed later during the B-tree operations. */ - ut_a(page_zip_validate_low(src_zip, src, TRUE)); + ut_a(page_zip_validate_low(src_zip, src, index, TRUE)); #endif /* UNIV_ZIP_DEBUG */ ut_a(page_zip_get_size(page_zip) == page_zip_get_size(src_zip)); if (UNIV_UNLIKELY(src_zip->n_blobs)) { @@ -4614,7 +4680,7 @@ page_zip_copy_recs( } #ifdef UNIV_ZIP_DEBUG - ut_a(page_zip_validate(page_zip, page)); + ut_a(page_zip_validate(page_zip, page, index)); #endif /* UNIV_ZIP_DEBUG */ btr_blob_dbg_add(page, index, "page_zip_copy_recs"); diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index b4827782be6..f1811a664c2 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2048,7 +2048,8 @@ Creates a table for MySQL. If the name of the table ends in one of "innodb_monitor", "innodb_lock_monitor", "innodb_tablespace_monitor", "innodb_table_monitor", then this will also start the printing of monitor output by the master thread. If the table name ends in "innodb_mem_validate", -InnoDB will try to invoke mem_validate(). +InnoDB will try to invoke mem_validate(). On failure the transaction will +be rolled back and the 'table' object will be freed. @return error code or DB_SUCCESS */ UNIV_INTERN int @@ -2193,7 +2194,10 @@ err_exit: row_drop_table_for_mysql(table->name, trx, FALSE); trx_commit_for_mysql(trx); + } else { + dict_mem_table_free(table); } + break; case DB_TOO_MANY_CONCURRENT_TRXS: diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 8f3f5711a61..96884e89511 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -2543,6 +2543,9 @@ row_sel_convert_mysql_key_to_innobase( dfield++; } + DBUG_EXECUTE_IF("innodb_srch_key_buffer_full", + ut_a(buf == (original_buf + buf_len));); + ut_a(buf <= original_buf + buf_len); /* We set the length of tuple to n_fields: we assume that the memory @@ -4207,6 +4210,11 @@ wait_table_again: } rec_loop: + if (trx_is_interrupted(trx)) { + err = DB_INTERRUPTED; + goto normal_return; + } + /*-------------------------------------------------------------*/ /* PHASE 4: Look for matching records in a loop */ @@ -5211,7 +5219,13 @@ row_search_autoinc_read_column( rec_offs_init(offsets_); - offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); + offsets = rec_get_offsets(rec, index, offsets, col_no + 1, &heap); + + if (rec_offs_nth_sql_null(offsets, col_no)) { + /* There is no non-NULL value in the auto-increment column. */ + value = 0; + goto func_exit; + } data = rec_get_nth_field(rec, offsets, col_no, &len); @@ -5237,14 +5251,15 @@ row_search_autoinc_read_column( ut_error; } - if (UNIV_LIKELY_NULL(heap)) { - mem_heap_free(heap); - } - if (!unsigned_type && (ib_int64_t) value < 0) { value = 0; } +func_exit: + if (UNIV_LIKELY_NULL(heap)) { + mem_heap_free(heap); + } + return(value); } diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index c9b42265553..4869909f5a6 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -69,36 +69,6 @@ If you make a change in this module make sure that no codepath is introduced where a call to log_free_check() is bypassed. */ /***********************************************************//** -Checks if also the previous version of the clustered index record was -modified or inserted by the same transaction, and its undo number is such -that it should be undone in the same rollback. -@return TRUE if also previous modify or insert of this row should be undone */ -static -ibool -row_undo_mod_undo_also_prev_vers( -/*=============================*/ - undo_node_t* node, /*!< in: row undo node */ - undo_no_t* undo_no)/*!< out: the undo number */ -{ - trx_undo_rec_t* undo_rec; - trx_t* trx; - - trx = node->trx; - - if (node->new_trx_id != trx->id) { - - *undo_no = 0; - return(FALSE); - } - - undo_rec = trx_undo_get_undo_rec_low(node->new_roll_ptr, node->heap); - - *undo_no = trx_undo_rec_get_undo_no(undo_rec); - - return(trx->roll_limit <= *undo_no); -} - -/***********************************************************//** Undoes a modify in a clustered index record. @return DB_SUCCESS, DB_FAIL, or error code: we may run out of file space */ static @@ -226,18 +196,11 @@ row_undo_mod_clust( btr_pcur_t* pcur; mtr_t mtr; ulint err; - ibool success; - ibool more_vers; - undo_no_t new_undo_no; ut_ad(node && thr); log_free_check(); - /* Check if also the previous version of the clustered index record - should be undone in this same rollback operation */ - - more_vers = row_undo_mod_undo_also_prev_vers(node, &new_undo_no); pcur = &(node->pcur); @@ -286,20 +249,6 @@ row_undo_mod_clust( trx_undo_rec_release(node->trx, node->undo_no); - if (more_vers && err == DB_SUCCESS) { - - /* Reserve the undo log record to the prior version after - committing &mtr: this is necessary to comply with the latching - order, as &mtr may contain the fsp latch which is lower in - the latch hierarchy than trx->undo_mutex. */ - - success = trx_undo_rec_reserve(node->trx, new_undo_no); - - if (success) { - node->state = UNDO_NODE_PREV_VERS; - } - } - return(err); } @@ -835,7 +784,6 @@ row_undo_mod_parse_undo_rec( trx_undo_update_rec_get_update(ptr, clust_index, type, trx_id, roll_ptr, info_bits, trx, node->heap, &(node->update)); - node->new_roll_ptr = roll_ptr; node->new_trx_id = trx_id; node->cmpl_info = cmpl_info; diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc index 6519e10334d..757d3544ba4 100644 --- a/storage/innobase/row/row0undo.cc +++ b/storage/innobase/row/row0undo.cc @@ -283,25 +283,6 @@ row_undo( } else { node->state = UNDO_NODE_MODIFY; } - - } else if (node->state == UNDO_NODE_PREV_VERS) { - - /* Undo should be done to the same clustered index record - again in this same rollback, restoring the previous version */ - - roll_ptr = node->new_roll_ptr; - - node->undo_rec = trx_undo_get_undo_rec_low(roll_ptr, - node->heap); - node->roll_ptr = roll_ptr; - node->undo_no = trx_undo_rec_get_undo_no(node->undo_rec); - - if (trx_undo_roll_ptr_is_insert(roll_ptr)) { - - node->state = UNDO_NODE_INSERT; - } else { - node->state = UNDO_NODE_MODIFY; - } } /* Prevent DROP TABLE etc. while we are rolling back this row. diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 58f4f16d27a..95f37ddb12f 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -3056,7 +3056,10 @@ int ha_maria::create(const char *name, register TABLE *table_arg, ha_create_info->transactional != HA_CHOICE_NO); if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE) + { create_flags|= HA_CREATE_TMP_TABLE; + create_info.transactional= 0; + } if (ha_create_info->options & HA_CREATE_KEEP_FILES) create_flags|= HA_CREATE_KEEP_FILES; if (options & HA_OPTION_PACK_RECORD) diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c index f5d32d6a191..e3668d3c8d3 100644 --- a/storage/maria/ma_bitmap.c +++ b/storage/maria/ma_bitmap.c @@ -239,7 +239,7 @@ my_bool _ma_bitmap_init(MARIA_SHARE *share, File file, if (((bitmap->map= (uchar*) my_malloc(size, MYF(MY_WME))) == NULL) || my_init_dynamic_array(&bitmap->pinned_pages, - sizeof(MARIA_PINNED_PAGE), 1, 1)) + sizeof(MARIA_PINNED_PAGE), 1, 1, MYF(0))) return 1; bitmap->block_size= share->block_size; diff --git a/storage/maria/ma_blockrec.c b/storage/maria/ma_blockrec.c index 71faa11fd2b..55b9a137050 100644 --- a/storage/maria/ma_blockrec.c +++ b/storage/maria/ma_blockrec.c @@ -528,7 +528,7 @@ my_bool _ma_init_block_record(MARIA_HA *info) if (my_init_dynamic_array(&info->bitmap_blocks, sizeof(MARIA_BITMAP_BLOCK), default_extents, - 64)) + 64, MYF(0))) goto err; info->cur_row.extents_buffer_length= default_extents * ROW_EXTENT_SIZE; if (!(info->cur_row.extents= my_malloc(info->cur_row.extents_buffer_length, diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index c362a3024ae..ab9080c40fb 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -3765,7 +3765,8 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info, param->read_cache.end_of_file= sort_info.filelength; sort_param.wordlist=NULL; - init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, + MYF(param->malloc_flags)); sort_param.key_cmp=sort_key_cmp; sort_param.lock_in_memory=maria_lock_memory; @@ -4402,7 +4403,8 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, (FT_MAX_WORD_LEN_FOR_SORT * sort_param[i].keyinfo->seg->charset->mbmaxlen); sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; - init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, + MYF(param->malloc_flags)); } } sort_info.total_keys=i; diff --git a/storage/maria/ma_ft_boolean_search.c b/storage/maria/ma_ft_boolean_search.c index 83ae08553ef..c98c4b599fc 100644 --- a/storage/maria/ma_ft_boolean_search.c +++ b/storage/maria/ma_ft_boolean_search.c @@ -527,7 +527,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) /* 4 */ if (!is_tree_inited(& ftb->no_dupes)) init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), - _ftb_no_dupes_cmp,0,0,0); + _ftb_no_dupes_cmp,0,0,0); else reset_tree(& ftb->no_dupes); } @@ -561,7 +561,7 @@ FT_INFO * maria_ft_init_boolean_search(MARIA_HA *info, uint keynr, bzero(& ftb->no_dupes, sizeof(TREE)); ftb->last_word= 0; - init_alloc_root(&ftb->mem_root, 1024, 1024); + init_alloc_root(&ftb->mem_root, 1024, 1024, 0); ftb->queue.max_elements= 0; if (!(ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR)))) goto err; diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c index c8b87c4f42c..c6d9c2411c6 100644 --- a/storage/maria/ma_ft_nlq_search.c +++ b/storage/maria/ma_ft_nlq_search.c @@ -239,8 +239,8 @@ FT_INFO *maria_ft_init_nlq_search(MARIA_HA *info, uint keynr, uchar *query, bzero(&wtree,sizeof(wtree)); - init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,0, - NULL, NULL); + init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp, + NULL, NULL, MYF(0)); maria_ft_parse_init(&wtree, aio.charset); ftparser_param->flags= 0; diff --git a/storage/maria/ma_ft_parser.c b/storage/maria/ma_ft_parser.c index 3dd6fab5214..81b5ea5119c 100644 --- a/storage/maria/ma_ft_parser.c +++ b/storage/maria/ma_ft_parser.c @@ -254,8 +254,8 @@ void maria_ft_parse_init(TREE *wtree, CHARSET_INFO *cs) { DBUG_ENTER("maria_ft_parse_init"); if (!is_tree_inited(wtree)) - init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0, NULL, - (void*) cs); + init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp, NULL, + (void*) cs, MYF(0)); DBUG_VOID_RETURN; } @@ -348,7 +348,7 @@ MYSQL_FTPARSER_PARAM* maria_ftparser_alloc_param(MARIA_HA *info) info->ftparser_param= (MYSQL_FTPARSER_PARAM *) my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) * info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL)); - init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, MYF(0)); } return info->ftparser_param; } diff --git a/storage/maria/ma_loghandler.c b/storage/maria/ma_loghandler.c index 341bbc6088f..56926c048d8 100644 --- a/storage/maria/ma_loghandler.c +++ b/storage/maria/ma_loghandler.c @@ -3629,10 +3629,10 @@ my_bool translog_init_with_table(const char *directory, mysql_rwlock_init(key_TRANSLOG_DESCRIPTOR_open_files_lock, &log_descriptor.open_files_lock) || my_init_dynamic_array(&log_descriptor.open_files, - sizeof(TRANSLOG_FILE*), 10, 10) || + sizeof(TRANSLOG_FILE*), 10, 10, MYF(0)) || my_init_dynamic_array(&log_descriptor.unfinished_files, sizeof(struct st_file_counter), - 10, 10)) + 10, 10, MYF(0))) goto err; log_descriptor.min_need_file= 0; log_descriptor.min_file_number= 0; @@ -5528,7 +5528,7 @@ translog_write_variable_record_mgroup(LSN *lsn, if (my_init_dynamic_array(&groups, sizeof(struct st_translog_group_descriptor), - 10, 10)) + 10, 10, MYF(0))) { translog_unlock(); DBUG_PRINT("error", ("init array failed")); diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 5f90f61c786..88422e3dc5f 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -160,7 +160,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, const char *name, if (my_init_dynamic_array(&info.pinned_pages, sizeof(MARIA_PINNED_PAGE), max(share->base.blobs*2 + 4, - MARIA_MAX_TREE_LEVELS*3), 16)) + MARIA_MAX_TREE_LEVELS*3), 16, MYF(0))) goto err; diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index e1e7b323683..4bc179c3008 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -164,7 +164,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, HA_FT_MAXBYTELEN, MYF(0)))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, - maxbuffer/2)) + maxbuffer/2, MYF(0))) { my_free(sort_keys); sort_keys= 0; @@ -397,7 +397,7 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg) HA_FT_MAXBYTELEN : 0), MYF(0)))) { if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, maxbuffer/2)) + maxbuffer, maxbuffer/2, MYF(0))) { my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c index 14385328186..5d440a40dc0 100644 --- a/storage/maria/ma_write.c +++ b/storage/maria/ma_write.c @@ -880,7 +880,7 @@ ChangeSet@1.2562, 2008-04-09 07:41:40+02:00, serg@janus.mylan +9 -0 /* Yup. converting */ info->ft1_to_ft2=(DYNAMIC_ARRAY *) my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME)); - my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50); + my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, MYF(0)); /* Now, adding all keys from the page to dynarray @@ -1765,8 +1765,8 @@ int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows) init_tree(&info->bulk_insert[i], cache_size * key[i].maxlength, cache_size * key[i].maxlength, 0, - (qsort_cmp2)keys_compare, 0, - (tree_element_free) keys_free, (void *)params++); + (qsort_cmp2)keys_compare, + (tree_element_free) keys_free, (void *)params++, MYF(0)); } else info->bulk_insert[i].root=0; diff --git a/storage/maria/maria_pack.c b/storage/maria/maria_pack.c index 481b77a2cc6..40686995378 100644 --- a/storage/maria/maria_pack.c +++ b/storage/maria/maria_pack.c @@ -798,8 +798,8 @@ static HUFF_COUNTS *init_huff_count(MARIA_HA *info,my_off_t records) 'tree_pos'. It's keys are implemented by pointers into 'tree_buff'. This is accomplished by '-1' as the element size. */ - init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0, NULL, - NULL); + init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL, + NULL, MYF(0)); if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) count[i].tree_pos=count[i].tree_buff = my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, diff --git a/storage/maria/unittest/sequence_storage.c b/storage/maria/unittest/sequence_storage.c index d5db20d31ca..4563ea76c64 100644 --- a/storage/maria/unittest/sequence_storage.c +++ b/storage/maria/unittest/sequence_storage.c @@ -33,7 +33,7 @@ my_bool seq_storage_reader_init(SEQ_STORAGE *seq, const char *file) seq->pos= 0; if ((fd= my_fopen(file, O_RDONLY, MYF(MY_WME))) == NULL) return 1; - if (my_init_dynamic_array(&seq->seq, sizeof(ulong), 10, 10)) + if (my_init_dynamic_array(&seq->seq, sizeof(ulong), 10, 10, MYF(0))) return 1; for(;;) diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 8b61e1dc4f2..70a7037a446 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -550,7 +550,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) /* 4 */ if (!is_tree_inited(& ftb->no_dupes)) init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), - _ftb_no_dupes_cmp,0,0,0); + _ftb_no_dupes_cmp,0,0,MYF(0)); else reset_tree(& ftb->no_dupes); } @@ -583,7 +583,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query, bzero(& ftb->no_dupes, sizeof(TREE)); ftb->last_word= 0; - init_alloc_root(&ftb->mem_root, 1024, 1024); + init_alloc_root(&ftb->mem_root, 1024, 1024, MYF(0)); ftb->queue.max_elements= 0; if (!(ftbe=(FTB_EXPR *)alloc_root(&ftb->mem_root, sizeof(FTB_EXPR)))) goto err; diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index bafa7064e28..9524b6f1833 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -248,8 +248,8 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query, bzero(&wtree,sizeof(wtree)); - init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp,0, - NULL, NULL); + init_tree(&aio.dtree,0,0,sizeof(FT_SUPERDOC),(qsort_cmp2)&FT_SUPERDOC_cmp, + NULL, NULL, MYF(0)); ft_parse_init(&wtree, aio.charset); ftparser_param->flags= 0; diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c index c534a9a060b..0e89d7d1b3a 100644 --- a/storage/myisam/ft_parser.c +++ b/storage/myisam/ft_parser.c @@ -249,7 +249,8 @@ void ft_parse_init(TREE *wtree, CHARSET_INFO *cs) { DBUG_ENTER("ft_parse_init"); if (!is_tree_inited(wtree)) - init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,0,(void*)cs); + init_tree(wtree, 0, 0, sizeof(FT_WORD), (qsort_cmp2)&FT_WORD_cmp, 0, + (void*)cs, MYF(0)); DBUG_VOID_RETURN; } @@ -341,7 +342,7 @@ MYSQL_FTPARSER_PARAM* ftparser_alloc_param(MI_INFO *info) info->ftparser_param= (MYSQL_FTPARSER_PARAM *) my_malloc(MAX_PARAM_NR * sizeof(MYSQL_FTPARSER_PARAM) * info->s->ftkeys, MYF(MY_WME | MY_ZEROFILL)); - init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + init_alloc_root(&info->ft_memroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, MYF(0)); } return info->ftparser_param; } diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index 8f6f9308d3c..45441c17bbb 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -61,9 +61,8 @@ int ft_init_stopwords() if (!(stopwords3=(TREE *)my_malloc(sizeof(TREE),MYF(0)))) DBUG_RETURN(-1); init_tree(stopwords3,0,0,sizeof(FT_STOPWORD),(qsort_cmp2)&FT_STOPWORD_cmp, - 0, (ft_stopword_file ? (tree_element_free)&FT_STOPWORD_free : 0), - NULL); + NULL, MYF(0)); /* Stopword engine currently does not support tricky character sets UCS2, UTF16, UTF32. diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index ef3a6bc2864..056aff5a72b 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -2299,7 +2299,8 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info, mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0)); sort_param.wordlist=NULL; - init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + init_alloc_root(&sort_param.wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, + MYF(param->malloc_flags)); if (share->data_file_type == DYNAMIC_RECORD) length=max(share->base.min_pack_length+1,share->base.min_block_length); @@ -2869,7 +2870,8 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info, uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* sort_param[i].keyinfo->seg->charset->mbmaxlen; sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; - init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0); + init_alloc_root(&sort_param[i].wordroot, FTPARSER_MEMROOT_ALLOC_SIZE, 0, + MYF(param->malloc_flags)); } } sort_info.total_keys=i; diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 305984ee94d..438057e22df 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -237,7 +237,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) } /* sanity check */ - if (share->base.keystart > 65535 || share->base.rec_reflength > 8) + if (share->base.keystart > 65535 || + share->base.rec_reflength > 8 || share->base.key_reflength > 7) { my_errno=HA_ERR_CRASHED; goto err; diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c index 70cc96d0cba..60ea7757827 100644 --- a/storage/myisam/mi_write.c +++ b/storage/myisam/mi_write.c @@ -544,7 +544,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo, /* yup. converting */ info->ft1_to_ft2=(DYNAMIC_ARRAY *) my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME)); - my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50); + my_init_dynamic_array(info->ft1_to_ft2, ft2len, 300, 50, MYF(0)); /* now, adding all keys from the page to dynarray @@ -1013,8 +1013,8 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows) init_tree(&info->bulk_insert[i], cache_size * key[i].maxlength, cache_size * key[i].maxlength, 0, - (qsort_cmp2)keys_compare, 0, - (tree_element_free) keys_free, (void *)params++); + (qsort_cmp2)keys_compare, + (tree_element_free) keys_free, (void *)params++, MYF(0)); } else info->bulk_insert[i].root=0; diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 7d8b577e8b0..c8546ee56f5 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -291,7 +291,14 @@ static struct my_option my_long_options[] = &check_param.write_buffer_length, 0, GET_ULONG, REQUIRED_ARG, (long) READ_BUFFER_INIT, (long) MALLOC_OVERHEAD, INT_MAX32, (long) MALLOC_OVERHEAD, (long) 1L, 0}, - { "sort_buffer_size", OPT_SORT_BUFFER_SIZE, "", + { "sort_buffer_size", OPT_SORT_BUFFER_SIZE, + "Deprecated. myisam_sort_buffer_size alias is being used", + &check_param.sort_buffer_length, + &check_param.sort_buffer_length, 0, GET_ULL, REQUIRED_ARG, + (long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD), + SIZE_T_MAX, (long) MALLOC_OVERHEAD, (long) 1L, 0}, + { "myisam_sort_buffer_size", OPT_SORT_BUFFER_SIZE, + "Alias of sort_buffer_size parameter", &check_param.sort_buffer_length, &check_param.sort_buffer_length, 0, GET_ULL, REQUIRED_ARG, (long) SORT_BUFFER_INIT, (long) (MIN_SORT_BUFFER + MALLOC_OVERHEAD), diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c index 3314f1b94ac..1624213851b 100644 --- a/storage/myisam/myisamlog.c +++ b/storage/myisam/myisamlog.c @@ -329,8 +329,9 @@ static int examine_log(char * file_name, char **table_names) init_io_cache(&cache,file,0,READ_CACHE,start_offset,0,MYF(0)); bzero((uchar*) com_count,sizeof(com_count)); - init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,1, - (tree_element_free) file_info_free, NULL); + init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare, + (tree_element_free) file_info_free, NULL, + MYF(MY_TREE_WITH_DELETE)); (void) init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE, 0, 0, 0); diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 5d6b03ff4b8..6ce88db87f5 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -816,8 +816,8 @@ static HUFF_COUNTS *init_huff_count(MI_INFO *info,my_off_t records) 'tree_pos'. It's keys are implemented by pointers into 'tree_buff'. This is accomplished by '-1' as the element size. */ - init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree,0, NULL, - NULL); + init_tree(&count[i].int_tree,0,0,-1,(qsort_cmp2) compare_tree, NULL, + NULL, MYF(0)); if (records && type != FIELD_BLOB && type != FIELD_VARCHAR) count[i].tree_pos=count[i].tree_buff = my_malloc(count[i].field_length > 1 ? tree_buff_length : 2, diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index 2c4639b3143..4af45ea02e9 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -165,7 +165,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, HA_FT_MAXBYTELEN, MYF(0)))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, - maxbuffer/2)) + maxbuffer/2, MYF(0))) { my_free(sort_keys); sort_keys= 0; @@ -389,7 +389,7 @@ pthread_handler_t thr_find_all_keys(void *arg) HA_FT_MAXBYTELEN : 0), MYF(0)))) { if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, maxbuffer/2)) + maxbuffer, maxbuffer/2, MYF(0))) { my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 1b0eea13418..7bb7990d9a3 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -120,7 +120,7 @@ ha_myisammrg::ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), file(0), is_cloned(0) { init_sql_alloc(&children_mem_root, - FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0); + FN_REFLEN + ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(0)); } diff --git a/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff index 20431a9c713..094b26668c1 100644 --- a/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff +++ b/storage/myisammrg/mysql-test/storage_engine/vcol.rdiff @@ -67,7 +67,7 @@ < 4 5 < DROP TABLE t1; --- -> ERROR HY000: MRG_MYISAM storage engine does not support computed columns +> ERROR HY000: MRG_MyISAM storage engine does not support computed columns > # ERROR: Statement ended with errno 1910, errname ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS (expected to succeed) > # ------------ UNEXPECTED RESULT ------------ > # [ CREATE TABLE t1 (a INT(11) /*!*/ /*Custom column options*/, b INT(11) /*!*/ /*Custom column options*/ GENERATED ALWAYS AS (a+1)) ENGINE=MRG_MYISAM /*!*/ /*Custom table options*/ UNION(mrg.t1) INSERT_METHOD=LAST ] diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index ccb8c77d573..d3de38d025c 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -130,7 +130,7 @@ mode when a server is installed. The implementation of the database creation script is located in - @verbatim ./scripts/mysql_system_tables.sql @endverbatim + @verbatim ./scripts/mysql_performance_tables.sql @endverbatim @subsection INT_CONFIG Runtime configuration interface diff --git a/storage/perfschema/pfs_check.cc b/storage/perfschema/pfs_check.cc index c52be6f0da2..2ab54ab1a4a 100644 --- a/storage/perfschema/pfs_check.cc +++ b/storage/perfschema/pfs_check.cc @@ -56,6 +56,8 @@ void check_performance_schema() PFS_engine_table_share::check_all_tables(thd); delete thd; + /* Remember that we don't have a THD */ + set_current_thd(0); DBUG_VOID_RETURN; } diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc index 44d424e9df6..39caabaf030 100644 --- a/storage/perfschema/pfs_instr.cc +++ b/storage/perfschema/pfs_instr.cc @@ -998,8 +998,6 @@ PFS_socket *sanitize_socket(PFS_socket *unsafe) */ void destroy_thread(PFS_thread *pfs) { - DBUG_ENTER("destroy_thread"); - DBUG_ASSERT(pfs != NULL); if (pfs->m_account != NULL) { @@ -1062,7 +1060,6 @@ void destroy_thread(PFS_thread *pfs) pfs->m_digest_hash_pins= NULL; } pfs->m_lock.allocated_to_free(); - DBUG_VOID_RETURN; } /** diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc index daf842d1248..3df0f27f652 100644 --- a/storage/perfschema/pfs_server.cc +++ b/storage/perfschema/pfs_server.cc @@ -209,7 +209,8 @@ void shutdown_performance_schema(void) */ void init_pfs_instrument_array() { - my_init_dynamic_array(&pfs_instr_config_array, sizeof(PFS_instr_config*), 10, 10); + my_init_dynamic_array(&pfs_instr_config_array, sizeof(PFS_instr_config*), + 10, 10, MYF(0)); pfs_instr_config_state= PFS_INSTR_CONFIG_ALLOCATED; } diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc index 97e83cd9221..3305875c124 100644 --- a/storage/sphinx/ha_sphinx.cc +++ b/storage/sphinx/ha_sphinx.cc @@ -3591,12 +3591,12 @@ struct st_mysql_storage_engine sphinx_storage_engine = struct st_mysql_show_var sphinx_status_vars[] = { - {"sphinx_total", (char *)sphinx_showfunc_total, SHOW_SIMPLE_FUNC}, - {"sphinx_total_found", (char *)sphinx_showfunc_total_found, SHOW_SIMPLE_FUNC}, - {"sphinx_time", (char *)sphinx_showfunc_time, SHOW_SIMPLE_FUNC}, - {"sphinx_word_count", (char *)sphinx_showfunc_word_count, SHOW_SIMPLE_FUNC}, - {"sphinx_words", (char *)sphinx_showfunc_words, SHOW_SIMPLE_FUNC}, - {"sphinx_error", (char *)sphinx_showfunc_error, SHOW_SIMPLE_FUNC}, + {"Sphinx_total", (char *)sphinx_showfunc_total, SHOW_SIMPLE_FUNC}, + {"Sphinx_total_found", (char *)sphinx_showfunc_total_found, SHOW_SIMPLE_FUNC}, + {"Sphinx_time", (char *)sphinx_showfunc_time, SHOW_SIMPLE_FUNC}, + {"Sphinx_word_count", (char *)sphinx_showfunc_word_count, SHOW_SIMPLE_FUNC}, + {"Sphinx_words", (char *)sphinx_showfunc_words, SHOW_SIMPLE_FUNC}, + {"Sphinx_error", (char *)sphinx_showfunc_error, SHOW_SIMPLE_FUNC}, {0, 0, (enum_mysql_show_type)0} }; diff --git a/storage/xtradb/btr/btr0cur.c b/storage/xtradb/btr/btr0cur.c index 61c07ac792e..687853a422e 100644 --- a/storage/xtradb/btr/btr0cur.c +++ b/storage/xtradb/btr/btr0cur.c @@ -239,6 +239,7 @@ btr_cur_latch_leaves( mtr_t* mtr) /*!< in: mtr */ { ulint mode; + ulint sibling_mode; ulint left_page_no; ulint right_page_no; buf_block_t* get_block; @@ -261,14 +262,21 @@ btr_cur_latch_leaves( #endif /* UNIV_BTR_DEBUG */ get_block->check_index_page_at_flush = TRUE; return; + case BTR_SEARCH_TREE: case BTR_MODIFY_TREE: - /* x-latch also brothers from left to right */ + if (UNIV_UNLIKELY(latch_mode == BTR_SEARCH_TREE)) { + mode = RW_S_LATCH; + sibling_mode = RW_NO_LATCH; + } else { + mode = sibling_mode = RW_X_LATCH; + } + /* Fetch and possibly latch also brothers from left to right */ left_page_no = btr_page_get_prev(page, mtr); if (left_page_no != FIL_NULL) { get_block = btr_block_get( space, zip_size, left_page_no, - RW_X_LATCH, cursor->index, mtr); + sibling_mode, cursor->index, mtr); if (srv_pass_corrupt_table && !get_block) { return; @@ -280,12 +288,21 @@ btr_cur_latch_leaves( ut_a(btr_page_get_next(get_block->frame, mtr) == page_get_page_no(page)); #endif /* UNIV_BTR_DEBUG */ - get_block->check_index_page_at_flush = TRUE; + if (sibling_mode == RW_NO_LATCH) { + /* btr_block_get() called with RW_NO_LATCH will + fix the read block in the buffer. This serves + no purpose for the fake changes prefetching, + thus we unfix the sibling blocks immediately.*/ + mtr_memo_release(mtr, get_block, + MTR_MEMO_BUF_FIX); + } else { + get_block->check_index_page_at_flush = TRUE; + } } get_block = btr_block_get( space, zip_size, page_no, - RW_X_LATCH, cursor->index, mtr); + mode, cursor->index, mtr); if (srv_pass_corrupt_table && !get_block) { return; @@ -301,7 +318,7 @@ btr_cur_latch_leaves( if (right_page_no != FIL_NULL) { get_block = btr_block_get( space, zip_size, right_page_no, - RW_X_LATCH, cursor->index, mtr); + sibling_mode, cursor->index, mtr); if (srv_pass_corrupt_table && !get_block) { return; @@ -313,7 +330,12 @@ btr_cur_latch_leaves( ut_a(btr_page_get_prev(get_block->frame, mtr) == page_get_page_no(page)); #endif /* UNIV_BTR_DEBUG */ - get_block->check_index_page_at_flush = TRUE; + if (sibling_mode == RW_NO_LATCH) { + mtr_memo_release(mtr, get_block, + MTR_MEMO_BUF_FIX); + } else { + get_block->check_index_page_at_flush = TRUE; + } } return; @@ -1566,6 +1588,9 @@ btr_cur_pessimistic_insert( } if (!(flags & BTR_NO_UNDO_LOG_FLAG)) { + + ut_a(cursor->tree_height != ULINT_UNDEFINED); + /* First reserve enough free space for the file segments of the index tree, so that the insert will not fail because of lack of space */ @@ -1860,7 +1885,8 @@ btr_cur_update_alloc_zip( ulint length, /*!< in: size needed */ ibool create, /*!< in: TRUE=delete-and-insert, FALSE=update-in-place */ - mtr_t* mtr) /*!< in: mini-transaction */ + mtr_t* mtr, /*!< in: mini-transaction */ + trx_t* trx) /*!< in: NULL or transaction */ { ut_a(page_zip == buf_block_get_page_zip(block)); ut_ad(page_zip); @@ -1877,6 +1903,14 @@ btr_cur_update_alloc_zip( return(FALSE); } + if (trx && trx->fake_changes) { + /* Don't call page_zip_compress_write_log_no_data as that has + assert which would fail. Assume there won't be a compression + failure. */ + + return TRUE; + } + if (!page_zip_compress(page_zip, buf_block_get_frame(block), index, mtr)) { /* Unable to compress the page */ @@ -1960,7 +1994,8 @@ btr_cur_update_in_place( /* Check that enough space is available on the compressed page. */ if (page_zip && !btr_cur_update_alloc_zip(page_zip, block, index, - rec_offs_size(offsets), FALSE, mtr)) { + rec_offs_size(offsets), FALSE, mtr, + trx)) { return(DB_ZIP_OVERFLOW); } @@ -2159,7 +2194,8 @@ any_extern: if (page_zip && !btr_cur_update_alloc_zip(page_zip, block, index, - new_rec_size, TRUE, mtr)) { + new_rec_size, TRUE, mtr, + thr_get_trx(thr))) { err = DB_ZIP_OVERFLOW; goto err_exit; } @@ -2402,7 +2438,15 @@ btr_cur_pessimistic_update( of the index tree, so that the update will not fail because of lack of space */ - n_extents = cursor->tree_height / 16 + 3; + if (UNIV_UNLIKELY(cursor->tree_height == ULINT_UNDEFINED)) { + /* When the tree height is uninitialized due to fake + changes, reserve some hardcoded number of extents. */ + ut_a(thr && thr_get_trx(thr)->fake_changes); + n_extents = 3; + } + else { + n_extents = cursor->tree_height / 16 + 3; + } if (flags & BTR_NO_UNDO_LOG_FLAG) { reserve_flag = FSP_CLEANING; @@ -2439,7 +2483,7 @@ btr_cur_pessimistic_update( itself. Thus the following call is safe. */ row_upd_index_replace_new_col_vals_index_pos(new_entry, index, update, FALSE, *heap); - if (!(flags & BTR_KEEP_SYS_FLAG)) { + if (!(flags & BTR_KEEP_SYS_FLAG) && !trx->fake_changes) { row_upd_index_entry_sys_field(new_entry, index, DATA_ROLL_PTR, roll_ptr); row_upd_index_entry_sys_field(new_entry, index, DATA_TRX_ID, @@ -3210,6 +3254,8 @@ btr_cur_pessimistic_delete( of the index tree, so that the node pointer updates will not fail because of lack of space */ + ut_a(cursor->tree_height != ULINT_UNDEFINED); + n_extents = cursor->tree_height / 32 + 1; success = fsp_reserve_free_extents(&n_reserved, diff --git a/storage/xtradb/btr/btr0pcur.c b/storage/xtradb/btr/btr0pcur.c index b335e2c8aee..a1b7affdeb7 100644 --- a/storage/xtradb/btr/btr0pcur.c +++ b/storage/xtradb/btr/btr0pcur.c @@ -47,6 +47,7 @@ btr_pcur_create_for_mysql(void) pcur->btr_cur.index = NULL; btr_pcur_init(pcur); + pcur->btr_cur.tree_height = ULINT_UNDEFINED; return(pcur); } diff --git a/storage/xtradb/buf/buf0lru.c b/storage/xtradb/buf/buf0lru.c index a6a1f8dcf9c..14b5c65132c 100644 --- a/storage/xtradb/buf/buf0lru.c +++ b/storage/xtradb/buf/buf0lru.c @@ -239,9 +239,11 @@ buf_LRU_drop_page_hash_batch( When doing a DROP TABLE/DISCARD TABLESPACE we have to drop all page hash index entries belonging to that table. This function tries to do that in batch. Note that this is a 'best effort' attempt and does -not guarantee that ALL hash entries will be removed. */ +not guarantee that ALL hash entries will be removed. + +@return number of hashed pages found*/ static -void +ulint buf_LRU_drop_page_hash_for_tablespace( /*==================================*/ buf_pool_t* buf_pool, /*!< in: buffer pool instance */ @@ -251,13 +253,14 @@ buf_LRU_drop_page_hash_for_tablespace( ulint* page_arr; ulint num_entries; ulint zip_size; + ulint num_found = 0; zip_size = fil_space_get_zip_size(id); if (UNIV_UNLIKELY(zip_size == ULINT_UNDEFINED)) { /* Somehow, the tablespace does not exist. Nothing to drop. */ ut_ad(0); - return; + return num_found; } page_arr = ut_malloc( @@ -315,6 +318,7 @@ next_page: ut_a(num_entries < BUF_LRU_DROP_SEARCH_SIZE); ++num_entries; + ++num_found; if (num_entries < BUF_LRU_DROP_SEARCH_SIZE) { goto next_page; @@ -370,6 +374,8 @@ next_page: /* Drop any remaining batch of search hashed pages. */ buf_LRU_drop_page_hash_batch(id, zip_size, page_arr, num_entries); ut_free(page_arr); + + return num_found; } /******************************************************************//** @@ -814,8 +820,6 @@ buf_LRU_mark_space_was_deleted( for (i = 0; i < srv_buf_pool_instances; i++) { buf_pool_t* buf_pool; buf_page_t* bpage; - buf_chunk_t* chunk; - ulint j, k; buf_pool = buf_pool_from_array(i); @@ -832,28 +836,10 @@ buf_LRU_mark_space_was_deleted( mutex_exit(&buf_pool->LRU_list_mutex); - btr_search_s_lock_all(); - chunk = buf_pool->chunks; - for (j = buf_pool->n_chunks; j--; chunk++) { - buf_block_t* block = chunk->blocks; - for (k = chunk->size; k--; block++) { - if (buf_block_get_state(block) - != BUF_BLOCK_FILE_PAGE - || !block->index - || buf_page_get_space(&block->page) != id) { - continue; - } - - btr_search_s_unlock_all(); - - rw_lock_x_lock(&block->lock); - btr_search_drop_page_hash_index(block); - rw_lock_x_unlock(&block->lock); - - btr_search_s_lock_all(); - } - } - btr_search_s_unlock_all(); + /* The AHI entries for the tablespace being deleted should be + removed by now. */ + ut_ad(buf_LRU_drop_page_hash_for_tablespace(buf_pool, id) + == 0); } } diff --git a/storage/xtradb/buf/buf0rea.c b/storage/xtradb/buf/buf0rea.c index 67379d614a0..6d76a488af7 100644 --- a/storage/xtradb/buf/buf0rea.c +++ b/storage/xtradb/buf/buf0rea.c @@ -235,6 +235,9 @@ not_to_recover: sync, space, 0, offset, 0, UNIV_PAGE_SIZE, ((buf_block_t*) bpage)->frame, bpage, trx); } + if(sync) { + thd_wait_end(NULL); + } if (*err == DB_TABLESPACE_DELETED) { buf_read_page_handle_error(bpage); @@ -250,7 +253,6 @@ not_to_recover: } if (sync) { - thd_wait_end(NULL); /* The i/o is already completed when we arrive from fil_read */ if (!buf_page_io_complete(bpage)) { diff --git a/storage/xtradb/fsp/fsp0fsp.c b/storage/xtradb/fsp/fsp0fsp.c index d4a2745b90b..5cbc74b0862 100644 --- a/storage/xtradb/fsp/fsp0fsp.c +++ b/storage/xtradb/fsp/fsp0fsp.c @@ -3031,7 +3031,11 @@ try_again: some of them will contain extent descriptor pages, and therefore will not be free extents */ - n_free_up = (size - free_limit) / FSP_EXTENT_SIZE; + if (size <= free_limit) { + n_free_up = 0; + } else { + n_free_up = (size - free_limit) / FSP_EXTENT_SIZE; + } if (n_free_up > 0) { n_free_up--; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index ec976bfeb45..12f6f5134d2 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -381,6 +381,7 @@ static PSI_file_info all_innodb_files[] = { static INNOBASE_SHARE *get_share(const char *table_name); static void free_share(INNOBASE_SHARE *share); static int innobase_close_connection(handlerton *hton, THD* thd); +static void innobase_kill_query(handlerton *hton, THD* thd, enum thd_kill_levels level); static void innobase_commit_ordered(handlerton *hton, THD* thd, bool all); static int innobase_commit(handlerton *hton, THD* thd, bool all); static int innobase_rollback(handlerton *hton, THD* thd, bool all); @@ -1053,6 +1054,13 @@ thd_to_trx( return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr)); } +my_bool +ha_innobase::is_fake_change_enabled(THD* thd) +{ + trx_t* trx = thd_to_trx(thd); + return(trx && trx->fake_changes); +} + /********************************************************************//** Call this function when mysqld passes control to the client. That is to avoid deadlocks on the adaptive hash S-latch possibly held by thd. For more @@ -1117,8 +1125,7 @@ convert_error_code_to_mysql( return(0); case DB_INTERRUPTED: - my_error(ER_QUERY_INTERRUPTED, MYF(0)); - /* fall through */ + return(HA_ERR_ABORTED_BY_USER); case DB_FOREIGN_EXCEED_MAX_CASCADE: push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, @@ -2382,7 +2389,7 @@ trx_is_interrupted( /*===============*/ trx_t* trx) /*!< in: transaction */ { - return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd)); + return(trx && trx->mysql_thd && thd_kill_level((THD*) trx->mysql_thd)); } /**********************************************************************//** @@ -2639,6 +2646,7 @@ innobase_init( innobase_hton->flags=HTON_NO_FLAGS; innobase_hton->release_temporary_latches=innobase_release_temporary_latches; innobase_hton->alter_table_flags = innobase_alter_table_flags; + innobase_hton->kill_query = innobase_kill_query; ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); @@ -3052,6 +3060,14 @@ innobase_change_buffering_inited_ok: srv_use_checksums = (ibool) innobase_use_checksums; srv_fast_checksum = (ibool) innobase_fast_checksum; + if (innobase_fast_checksum) { + fprintf(stderr, + "InnoDB: Warning: innodb_fast_checksum is DEPRECATED " + "and *WILL* be removed in Percona Server 5.6. Please " + "consult the Percona Server 5.6 documentation for " + "help in upgrading.\n"); + } + srv_blocking_lru_restore = (ibool) innobase_blocking_lru_restore; #ifdef HAVE_LARGE_PAGES @@ -3938,6 +3954,33 @@ innobase_close_connection( DBUG_RETURN(0); } +/*****************************************************************//** +Cancel any pending lock request associated with the current THD. */ +static +void +innobase_kill_query( +/*======================*/ + handlerton* hton, /*!< in: innobase handlerton */ + THD* thd, /*!< in: MySQL thread being killed */ + enum thd_kill_levels level) /*!< in: kill level */ +{ + trx_t* trx; + DBUG_ENTER("innobase_kill_query"); + DBUG_ASSERT(hton == innodb_hton_ptr); + + mutex_enter(&kernel_mutex); + + trx = thd_to_trx(thd); + + /* Cancel a pending lock request. */ + if (trx && trx->wait_lock) { + lock_cancel_waiting_and_release(trx->wait_lock); + } + + mutex_exit(&kernel_mutex); + + DBUG_VOID_RETURN; +} /*************************************************************************//** ** InnoDB database tables @@ -6278,7 +6321,9 @@ no_commit: error = row_insert_for_mysql((byte*) record, prebuilt); #ifdef EXTENDED_FOR_USERSTAT - if (error == DB_SUCCESS) rows_changed++; + if (UNIV_LIKELY(error == DB_SUCCESS && !trx->fake_changes)) { + rows_changed++; + } #endif /* Handle duplicate key errors */ @@ -6641,7 +6686,9 @@ ha_innobase::update_row( } #ifdef EXTENDED_FOR_USERSTAT - if (error == DB_SUCCESS) rows_changed++; + if (UNIV_LIKELY(error == DB_SUCCESS && !trx->fake_changes)) { + rows_changed++; + } #endif innodb_srv_conc_exit_innodb(trx); @@ -6704,7 +6751,9 @@ ha_innobase::delete_row( error = row_update_for_mysql((byte*) record, prebuilt); #ifdef EXTENDED_FOR_USERSTAT - if (error == DB_SUCCESS) rows_changed++; + if (UNIV_LIKELY(error == DB_SUCCESS && !trx->fake_changes)) { + rows_changed++; + } #endif innodb_srv_conc_exit_innodb(trx); @@ -9825,7 +9874,7 @@ ha_innobase::check( row_mysql_unlock_data_dictionary(prebuilt->trx); } - if (thd_killed(user_thd)) { + if (thd_kill_level(user_thd)) { break; } @@ -9882,7 +9931,7 @@ ha_innobase::check( mutex_exit(&kernel_mutex); prebuilt->trx->op_info = ""; - if (thd_killed(user_thd)) { + if (thd_kill_level(user_thd)) { my_error(ER_QUERY_INTERRUPTED, MYF(0)); } @@ -12674,6 +12723,8 @@ static MYSQL_SYSVAR_BOOL(checksums, innobase_use_checksums, static MYSQL_SYSVAR_BOOL(fast_checksum, innobase_fast_checksum, PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY, + "DEPRECATED. #### WARNING #### : This feature is DEPRECATED and WILL " + "be removed in Percona Server 5.6. " "Change the algorithm of checksum for the whole of datapage to 4-bytes word based. " "The original checksum is checked after the new one. It may be slow for reading page" " which has orginal checksum. Overwrite the page or recreate the InnoDB database, " @@ -13107,6 +13158,11 @@ static MYSQL_SYSVAR_BOOL(track_changed_pages, srv_track_changed_pages, "Track the redo log for changed pages and output a changed page bitmap", NULL, NULL, FALSE); +static MYSQL_SYSVAR_ULONGLONG(max_bitmap_file_size, srv_max_bitmap_file_size, + PLUGIN_VAR_RQCMDARG, + "The maximum size of changed page bitmap files", + NULL, NULL, 100*1024*1024ULL, 4096ULL, ULONGLONG_MAX, 0); + static MYSQL_SYSVAR_ULONGLONG(changed_pages_limit, srv_changed_pages_limit, PLUGIN_VAR_RQCMDARG, "The maximum number of rows for " @@ -13309,6 +13365,13 @@ static MYSQL_SYSVAR_ULINT(lazy_drop_table, srv_lazy_drop_table, "e.g. for http://bugs.mysql.com/51325", NULL, NULL, 0, 0, 1, 0); +static MYSQL_SYSVAR_BOOL(locking_fake_changes, srv_fake_changes_locks, + PLUGIN_VAR_NOCMDARG, + "###EXPERIMENTAL### if enabled, transactions will get S row locks instead " + "of X locks for fake changes. If disabled, fake change transactions will " + "not take any locks at all.", + NULL, NULL, TRUE); + static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(page_size), MYSQL_SYSVAR(log_block_size), @@ -13400,6 +13463,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(use_native_aio), MYSQL_SYSVAR(change_buffering), MYSQL_SYSVAR(track_changed_pages), + MYSQL_SYSVAR(max_bitmap_file_size), MYSQL_SYSVAR(changed_pages_limit), #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG MYSQL_SYSVAR(change_buffering_debug), @@ -13418,6 +13482,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(corrupt_table_action), MYSQL_SYSVAR(lazy_drop_table), MYSQL_SYSVAR(fake_changes), + MYSQL_SYSVAR(locking_fake_changes), MYSQL_SYSVAR(merge_sort_block_size), NULL }; @@ -13666,7 +13731,7 @@ int ha_innobase::multi_range_read_explain_info(uint mrr_mode, char *str, size_t bool ha_innobase::is_thd_killed() { - return thd_killed(user_thd); + return thd_kill_level(user_thd); } /** diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h index 4d9c0a1ab35..359d0b95367 100644 --- a/storage/xtradb/handler/ha_innodb.h +++ b/storage/xtradb/handler/ha_innodb.h @@ -137,6 +137,7 @@ class ha_innobase: public handler int close(void); double scan_time(); double read_time(uint index, uint ranges, ha_rows rows); + my_bool is_fake_change_enabled(THD *thd); bool is_corrupt() const; int write_row(uchar * buf); diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc index 29a80594344..4b33d6a780c 100644 --- a/storage/xtradb/handler/i_s.cc +++ b/storage/xtradb/handler/i_s.cc @@ -7147,29 +7147,38 @@ static ST_FIELD_INFO i_s_innodb_changed_pages_info[] = }; /*********************************************************************** - This function parses condition and gets upper bounds for start and end LSN's - if condition corresponds to certain pattern. + This function implements ICP for I_S.INNODB_CHANGED_PAGES by parsing a + condition and getting lower and upper bounds for start and end LSNs if the + condition corresponds to a certain pattern. - We can't know right position to avoid scanning bitmap files from the beginning - to the lower bound. But we can stop scanning bitmap files if we reach upper bound. + In the most general form, we understand queries like - It's expected the most used queries will be like the following: - - SELECT * FROM INNODB_CHANGED_PAGES WHERE START_LSN > num1 AND start_lsn < num2; + SELECT * FROM INNODB_CHANGED_PAGES + WHERE START_LSN > num1 AND START_LSN < num2 + AND END_LSN > num3 AND END_LSN < num4; - That's why the pattern is: + That's why the pattern syntax is: pattern: comp | and_comp; comp: lsn < int_num | lsn <= int_num | int_num > lsn | int_num >= lsn; lsn: start_lsn | end_lsn; - and_comp: some_expression AND some_expression | some_expression AND and_comp; - some_expression: comp | any_other_expression; + and_comp: expression AND expression | expression AND and_comp; + expression: comp | any_other_expression; + + The two bounds are handled differently: the lower bound is used to find the + correct starting _file_, the upper bound the last _block_ that needs reading. + + Lower bound conditions are handled in the following way: start_lsn >= X + specifies that the reading must start from the file that has the highest + starting LSN less than or equal to X. start_lsn > X is equivalent to + start_lsn >= X + 1. For end_lsn, end_lsn >= X is treated as + start_lsn >= X - 1 and end_lsn > X as start_lsn >= X. - Suppose the condition is start_lsn < 100, this means we have to read all - blocks with start_lsn < 100. Which is equivalent to reading all the blocks - with end_lsn <= 99, or just end_lsn < 100. That's why it's enough to find - maximum lsn value, doesn't matter if this is start or end lsn and compare - it with "start_lsn" field. + For the upper bound, suppose the condition is start_lsn < 100, this means we + have to read all blocks with start_lsn < 100. Which is equivalent to reading + all the blocks with end_lsn <= 99, or just end_lsn < 100. That's why it's + enough to find maximum lsn value, doesn't matter if this is start or end lsn + and compare it with "start_lsn" field. LSN <= 100 is treated as LSN < 101. Example: @@ -7180,92 +7189,130 @@ static ST_FIELD_INFO i_s_innodb_changed_pages_info[] = 555 > end_lsn AND page_id = 100; - max_lsn will be set to 555. + end_lsn will be set to 555, start_lsn will be set 11. + + Support for other functions (equal, NULL-safe equal, BETWEEN, IN, etc.) will + be added on demand. + */ static void limit_lsn_range_from_condition( /*===========================*/ - TABLE* table, /*!<in: table */ - COND* cond, /*!<in: condition */ - ib_uint64_t* max_lsn) /*!<in/out: maximum LSN - (must be initialized with maximum - available value) */ + TABLE* table, /*!<in: table */ + COND* cond, /*!<in: condition */ + ib_uint64_t* start_lsn, /*!<in/out: minumum LSN */ + ib_uint64_t* end_lsn) /*!<in/out: maximum LSN */ { + enum Item_func::Functype func_type; + if (cond->type() != Item::COND_ITEM && cond->type() != Item::FUNC_ITEM) return; - switch (((Item_func*) cond)->functype()) + func_type = ((Item_func*) cond)->functype(); + + switch (func_type) { - case Item_func::COND_AND_FUNC: - { - List_iterator<Item> li(*((Item_cond*) cond)-> - argument_list()); - Item *item; - while ((item= li++)) - limit_lsn_range_from_condition(table, - item, - max_lsn); - break; + case Item_func::COND_AND_FUNC: + { + List_iterator<Item> li(*((Item_cond*) cond) + ->argument_list()); + Item *item; + + while ((item= li++)) { + limit_lsn_range_from_condition(table, item, start_lsn, + end_lsn); + } + break; + } + case Item_func::LT_FUNC: + case Item_func::LE_FUNC: + case Item_func::GT_FUNC: + case Item_func::GE_FUNC: + { + Item *left; + Item *right; + Item_field *item_field; + ib_uint64_t tmp_result; + ibool is_end_lsn; + + /* a <= b equals to b >= a that's why we just exchange "left" + and "right" in the case of ">" or ">=" function. We don't + touch the operation itself. */ + if (((Item_func*) cond)->functype() == Item_func::LT_FUNC + || ((Item_func*) cond)->functype() == Item_func::LE_FUNC) { + left = ((Item_func*) cond)->arguments()[0]; + right = ((Item_func*) cond)->arguments()[1]; + } else { + left = ((Item_func*) cond)->arguments()[1]; + right = ((Item_func*) cond)->arguments()[0]; } - case Item_func::LT_FUNC: - case Item_func::LE_FUNC: - case Item_func::GT_FUNC: - case Item_func::GE_FUNC: - { - Item *left; - Item *right; - Item_field *item_field; - ib_uint64_t tmp_result; - - /* - a <= b equals to b >= a that's why we just exchange - "left" and "right" in the case of ">" or ">=" - function - */ - if (((Item_func*) cond)->functype() == - Item_func::LT_FUNC || - ((Item_func*) cond)->functype() == - Item_func::LE_FUNC) - { - left = ((Item_func*) cond)->arguments()[0]; - right = ((Item_func*) cond)->arguments()[1]; - } else { - left = ((Item_func*) cond)->arguments()[1]; - right = ((Item_func*) cond)->arguments()[0]; - } - if (!left || !right) - return; - if (left->type() != Item::FIELD_ITEM) - return; - if (right->type() != Item::INT_ITEM) - return; + if (left->type() == Item::FIELD_ITEM) { + item_field = (Item_field *)left; + } else if (right->type() == Item::FIELD_ITEM) { + item_field = (Item_field *)right; + } else { + return; + } - item_field = (Item_field*)left; + /* Check if the current field belongs to our table */ + if (table != item_field->field->table) { + return; + } - if (/* START_LSN */ - table->field[2] != item_field->field && - /* END_LSN */ - table->field[3] != item_field->field) - { - return; - } + /* Check if the field is START_LSN or END_LSN */ + /* END_LSN */ + is_end_lsn = table->field[3]->eq(item_field->field); + + if (/* START_LSN */ !table->field[2]->eq(item_field->field) + && !is_end_lsn) { + return; + } + + if (left->type() == Item::FIELD_ITEM + && right->type() == Item::INT_ITEM) { - /* Check if the current field belongs to our table */ - if (table != item_field->field->table) - return; + /* The case of start_lsn|end_lsn <|<= const, i.e. the + upper bound. */ tmp_result = right->val_int(); - if (tmp_result < *max_lsn) - *max_lsn = tmp_result; + if (((func_type == Item_func::LE_FUNC) + || (func_type == Item_func::GE_FUNC)) + && (tmp_result != IB_ULONGLONG_MAX)) { - break; + tmp_result++; + } + if (tmp_result < *end_lsn) { + *end_lsn = tmp_result; + } + + } else if (left->type() == Item::INT_ITEM + && right->type() == Item::FIELD_ITEM) { + + /* The case of const <|<= start_lsn|end_lsn, i.e. the + lower bound */ + + tmp_result = left->val_int(); + if (is_end_lsn && tmp_result != 0) { + tmp_result--; + } + if (((func_type == Item_func::LT_FUNC) + || (func_type == Item_func::GT_FUNC)) + && (tmp_result != IB_ULONGLONG_MAX)) { + + tmp_result++; + } + if (tmp_result > *start_lsn) { + *start_lsn = tmp_result; + } } - default:; - } + break; + } + default:; + } } /*********************************************************************** @@ -7282,40 +7329,55 @@ i_s_innodb_changed_pages_fill( TABLE* table = (TABLE *) tables->table; log_bitmap_iterator_t i; ib_uint64_t output_rows_num = 0UL; - ib_uint64_t max_lsn = ~0ULL; + ib_uint64_t max_lsn = IB_ULONGLONG_MAX; + ib_uint64_t min_lsn = 0ULL; + + DBUG_ENTER("i_s_innodb_changed_pages_fill"); - if (!srv_track_changed_pages) - return 0; + /* deny access to non-superusers */ + if (check_global_access(thd, PROCESS_ACL)) { + + DBUG_RETURN(0); + } - if (!log_online_bitmap_iterator_init(&i)) - return 1; + RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); - if (cond) - limit_lsn_range_from_condition(table, cond, &max_lsn); + if (!srv_track_changed_pages) { + DBUG_RETURN(0); + } + + if (cond) { + limit_lsn_range_from_condition(table, cond, &min_lsn, + &max_lsn); + } + + if (!log_online_bitmap_iterator_init(&i, min_lsn, max_lsn)) { + DBUG_RETURN(1); + } while(log_online_bitmap_iterator_next(&i) && (!srv_changed_pages_limit || output_rows_num < srv_changed_pages_limit) && /* - There is no need to compare both start LSN and end LSN fields - with maximum value. It's enough to compare only start LSN. - Example: - - max_lsn = 100 - \\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1 - I------I I-------I I-------------I I----I - ////////////////// | - Query 2 - 1 2 3 4 - - Query 1: - SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100 - will select 1,2,3 bitmaps - Query 2: - SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100 - will select 1,2 bitmaps - - The condition start_lsn <= 100 will be false after reading - 1,2,3 bitmaps which suits for both cases. + There is no need to compare both start LSN and end LSN fields + with maximum value. It's enough to compare only start LSN. + Example: + + max_lsn = 100 + \\\\\\\\\\\\\\\\\\\\\\\\\|\\\\\\\\ - Query 1 + I------I I-------I I-------------I I----I + ////////////////// | - Query 2 + 1 2 3 4 + + Query 1: + SELECT * FROM INNODB_CHANGED_PAGES WHERE start_lsn < 100 + will select 1,2,3 bitmaps + Query 2: + SELECT * FROM INNODB_CHANGED_PAGES WHERE end_lsn < 100 + will select 1,2 bitmaps + + The condition start_lsn <= 100 will be false after reading + 1,2,3 bitmaps which suits for both cases. */ LOG_BITMAP_ITERATOR_START_LSN(i) <= max_lsn) { @@ -7330,10 +7392,10 @@ i_s_innodb_changed_pages_fill( LOG_BITMAP_ITERATOR_PAGE_NUM(i)); /* START_LSN */ table->field[2]->store( - LOG_BITMAP_ITERATOR_START_LSN(i)); + LOG_BITMAP_ITERATOR_START_LSN(i), true); /* END_LSN */ table->field[3]->store( - LOG_BITMAP_ITERATOR_END_LSN(i)); + LOG_BITMAP_ITERATOR_END_LSN(i), true); /* I_S tables are in-memory tables. If bitmap file is big enough @@ -7353,14 +7415,14 @@ i_s_innodb_changed_pages_fill( if (schema_table_store_record(thd, table)) { log_online_bitmap_iterator_release(&i); - return 1; + DBUG_RETURN(1); } ++output_rows_num; } log_online_bitmap_iterator_release(&i); - return 0; + DBUG_RETURN(0); } static diff --git a/storage/xtradb/ibuf/ibuf0ibuf.c b/storage/xtradb/ibuf/ibuf0ibuf.c index 78cb6e20176..77305e42fb1 100644 --- a/storage/xtradb/ibuf/ibuf0ibuf.c +++ b/storage/xtradb/ibuf/ibuf0ibuf.c @@ -4044,7 +4044,7 @@ updated_in_place: update) && (!page_zip || btr_cur_update_alloc_zip( page_zip, block, index, - rec_offs_size(offsets), FALSE, mtr))) { + rec_offs_size(offsets), FALSE, mtr, NULL))) { /* This is the easy case. Do something similar to btr_cur_update_in_place(). */ row_upd_rec_in_place(rec, index, offsets, diff --git a/storage/xtradb/include/btr0btr.h b/storage/xtradb/include/btr0btr.h index 03e89ae3f7d..fb06a774b82 100644 --- a/storage/xtradb/include/btr0btr.h +++ b/storage/xtradb/include/btr0btr.h @@ -65,7 +65,10 @@ enum btr_latch_mode { /** Search the previous record. */ BTR_SEARCH_PREV = 35, /** Modify the previous record. */ - BTR_MODIFY_PREV = 36 + BTR_MODIFY_PREV = 36, + /** Weaker BTR_MODIFY_TREE that does not lock the leaf page siblings, + used for fake changes. */ + BTR_SEARCH_TREE = 37 /* BTR_MODIFY_TREE | 4 */ }; /* BTR_INSERT, BTR_DELETE and BTR_DELETE_MARK are mutually exclusive. */ diff --git a/storage/xtradb/include/btr0cur.h b/storage/xtradb/include/btr0cur.h index cbc6103c2ee..cb44129aeb5 100644 --- a/storage/xtradb/include/btr0cur.h +++ b/storage/xtradb/include/btr0cur.h @@ -259,8 +259,9 @@ btr_cur_update_alloc_zip( ulint length, /*!< in: size needed */ ibool create, /*!< in: TRUE=delete-and-insert, FALSE=update-in-place */ - mtr_t* mtr) /*!< in: mini-transaction */ - __attribute__((nonnull, warn_unused_result)); + mtr_t* mtr, /*!< in: mini-transaction */ + trx_t* trx) /*!< in: NULL or transaction */ + __attribute__((nonnull (1, 2, 3, 6), warn_unused_result)); /*************************************************************//** Updates a record when the update causes no size changes in its fields. @return DB_SUCCESS or error number */ diff --git a/storage/xtradb/include/log0online.h b/storage/xtradb/include/log0online.h index 0e0ca169f6f..e7c3f301e45 100644 --- a/storage/xtradb/include/log0online.h +++ b/storage/xtradb/include/log0online.h @@ -27,6 +27,16 @@ Online database log parsing for changed page tracking #include "univ.i" #include "os0file.h" +/** Single bitmap file information */ +typedef struct log_online_bitmap_file_struct log_online_bitmap_file_t; + +/** A set of bitmap files containing some LSN range */ +typedef struct log_online_bitmap_file_range_struct +log_online_bitmap_file_range_t; + +/** An iterator over changed page info */ +typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t; + /*********************************************************************//** Initializes the online log following subsytem. */ UNIV_INTERN @@ -49,45 +59,32 @@ void log_online_follow_redo_log(); /*=========================*/ -/** The iterator through all bits of changed pages bitmap blocks */ -struct log_bitmap_iterator_struct -{ - char in_name[FN_REFLEN]; /*!< the file name for bitmap - input */ - os_file_t in; /*!< the bitmap input file */ - ib_uint64_t in_offset; /*!< the next write position in the - bitmap output file */ - ib_uint32_t bit_offset; /*!< bit offset inside of bitmap - block*/ - ib_uint64_t start_lsn; /*!< Start lsn of the block */ - ib_uint64_t end_lsn; /*!< End lsn of the block */ - ib_uint32_t space_id; /*!< Block space id */ - ib_uint32_t first_page_id; /*!< First block page id */ - ibool changed; /*!< true if current page was changed */ - byte* page; /*!< Bitmap block */ -}; - -typedef struct log_bitmap_iterator_struct log_bitmap_iterator_t; - #define LOG_BITMAP_ITERATOR_START_LSN(i) \ - ((i).start_lsn) + ((i).start_lsn) #define LOG_BITMAP_ITERATOR_END_LSN(i) \ - ((i).end_lsn) + ((i).end_lsn) #define LOG_BITMAP_ITERATOR_SPACE_ID(i) \ - ((i).space_id) + ((i).space_id) #define LOG_BITMAP_ITERATOR_PAGE_NUM(i) \ - ((i).first_page_id + (i).bit_offset) + ((i).first_page_id + (i).bit_offset) #define LOG_BITMAP_ITERATOR_PAGE_CHANGED(i) \ - ((i).changed) + ((i).changed) /*********************************************************************//** -Initializes log bitmap iterator. +Initializes log bitmap iterator. The minimum LSN is used for finding the +correct starting file with records and it there may be records returned by +the iterator that have LSN less than start_lsn. + @return TRUE if the iterator is initialized OK, FALSE otherwise. */ UNIV_INTERN ibool log_online_bitmap_iterator_init( /*============================*/ - log_bitmap_iterator_t *i); /*!<in/out: iterator */ + log_bitmap_iterator_t *i, /*!<in/out: iterator */ + ib_uint64_t min_lsn, /*!<in: start LSN for the + iterator */ + ib_uint64_t max_lsn); /*!<in: end LSN for the + iterator */ /*********************************************************************//** Releases log bitmap iterator. */ @@ -108,4 +105,57 @@ log_online_bitmap_iterator_next( /*============================*/ log_bitmap_iterator_t *i); /*!<in/out: iterator */ +/** Struct for single bitmap file information */ +struct log_online_bitmap_file_struct { + char name[FN_REFLEN]; /*!< Name with full path */ + os_file_t file; /*!< Handle to opened file */ + ib_uint64_t size; /*!< Size of the file */ + ib_uint64_t offset; /*!< Offset of the next read, + or count of already-read bytes + */ +}; + +/** Struct for a set of bitmap files containing some LSN range */ +struct log_online_bitmap_file_range_struct { + size_t count; /*!< Number of files */ + /*!< Dynamically-allocated array of info about individual files */ + struct { + char name[FN_REFLEN]; /*!< Name of a file */ + ib_uint64_t start_lsn; /*!< Starting LSN of + data in this file */ + ulong seq_num; /*!< Sequence number of + this file */ + } *files; +}; + +/** Struct for an iterator through all bits of changed pages bitmap blocks */ +struct log_bitmap_iterator_struct +{ + log_online_bitmap_file_range_t in_files; /*!< The bitmap files + for this iterator */ + size_t in_i; /*!< Currently read + file index in in_files + */ + log_online_bitmap_file_t in; /*!< Currently read + file */ + ib_uint32_t bit_offset; /*!< bit offset inside + the current bitmap + block */ + ib_uint64_t start_lsn; /*!< Start LSN of the + current bitmap block */ + ib_uint64_t end_lsn; /*!< End LSN of the + current bitmap block */ + ib_uint32_t space_id; /*!< Current block + space id */ + ib_uint32_t first_page_id; /*!< Id of the first + page in the current + block */ + ibool last_page_in_run;/*!< "Last page in + run" flag value for the + current block */ + ibool changed; /*!< true if current + page was changed */ + byte* page; /*!< Bitmap block */ +}; + #endif diff --git a/storage/xtradb/include/srv0srv.h b/storage/xtradb/include/srv0srv.h index a95eb8a1d58..6c5b61487f2 100644 --- a/storage/xtradb/include/srv0srv.h +++ b/storage/xtradb/include/srv0srv.h @@ -144,7 +144,8 @@ extern char* srv_doublewrite_file; extern ibool srv_recovery_stats; -extern my_bool srv_track_changed_pages; +extern my_bool srv_track_changed_pages; +extern ib_uint64_t srv_max_bitmap_file_size; extern ulonglong srv_changed_pages_limit; @@ -395,6 +396,10 @@ extern uint srv_auto_lru_dump; /** Whether startup should be blocked until buffer pool is fully restored */ extern ibool srv_blocking_lru_restore; +/** When TRUE, fake change transcations take S rather than X row locks. +When FALSE, row locks are not taken at all. */ +extern my_bool srv_fake_changes_locks; + /** Status variables to be passed to MySQL */ typedef struct export_var_struct export_struc; diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 5d2cd2d0313..77acf54d8dc 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -54,7 +54,7 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_BUGFIX 8 #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 29.1 +#define PERCONA_INNODB_VERSION 29.3 #endif /* The following is the InnoDB version as shown in diff --git a/storage/xtradb/include/ut0ut.h b/storage/xtradb/include/ut0ut.h index 47ab6eb9b74..48f30b33e65 100644 --- a/storage/xtradb/include/ut0ut.h +++ b/storage/xtradb/include/ut0ut.h @@ -122,6 +122,15 @@ ut_max( /*===*/ ulint n1, /*!< in: first number */ ulint n2); /*!< in: second number */ +/******************************************************//** +Calculates the maximum of two ib_uint64_t values. +@return the maximum */ +UNIV_INLINE +ib_uint64_t +ut_max_uint64( +/*==========*/ + ib_uint64_t n1, /*!< in: first number */ + ib_uint64_t n2); /*!< in: second number */ /****************************************************************//** Calculates minimum of two ulint-pairs. */ UNIV_INLINE diff --git a/storage/xtradb/include/ut0ut.ic b/storage/xtradb/include/ut0ut.ic index 6f55c7e410e..d56deb6266f 100644 --- a/storage/xtradb/include/ut0ut.ic +++ b/storage/xtradb/include/ut0ut.ic @@ -49,6 +49,19 @@ ut_max( return((n1 <= n2) ? n2 : n1); } +/******************************************************//** +Calculates the maximum of two ib_uint64_t values. +@return the maximum */ +UNIV_INLINE +ib_uint64_t +ut_max_uint64( +/*==========*/ + ib_uint64_t n1, /*!< in: first number */ + ib_uint64_t n2) /*!< in: second number */ +{ + return((n1 <= n2) ? n2 : n1); +} + /****************************************************************//** Calculates minimum of two ulint-pairs. */ UNIV_INLINE diff --git a/storage/xtradb/lock/lock0lock.c b/storage/xtradb/lock/lock0lock.c index 414d3ae2c49..f172ad6695b 100644 --- a/storage/xtradb/lock/lock0lock.c +++ b/storage/xtradb/lock/lock0lock.c @@ -5481,8 +5481,13 @@ lock_sec_rec_read_check_and_lock( return(DB_SUCCESS); } - if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) { - mode = LOCK_S; + if (UNIV_UNLIKELY((thr && thr_get_trx(thr)->fake_changes))) { + if (!srv_fake_changes_locks) { + return(DB_SUCCESS); + } + if (mode == LOCK_X) { + mode = LOCK_S; + } } heap_no = page_rec_get_heap_no(rec); @@ -5561,8 +5566,13 @@ lock_clust_rec_read_check_and_lock( return(DB_SUCCESS); } - if (thr && thr_get_trx(thr)->fake_changes && mode == LOCK_X) { - mode = LOCK_S; + if (UNIV_UNLIKELY((thr && thr_get_trx(thr)->fake_changes))) { + if (!srv_fake_changes_locks) { + return(DB_SUCCESS); + } + if (mode == LOCK_X) { + mode = LOCK_S; + } } heap_no = page_rec_get_heap_no(rec); diff --git a/storage/xtradb/log/log0log.c b/storage/xtradb/log/log0log.c index f2066b49662..e7c7a165b9c 100644 --- a/storage/xtradb/log/log0log.c +++ b/storage/xtradb/log/log0log.c @@ -248,7 +248,7 @@ log_check_tracking_margin( checked for the already-written log. */ { ib_uint64_t tracked_lsn; - ulint tracked_lsn_age; + ib_uint64_t tracked_lsn_age; if (!srv_track_changed_pages) { return FALSE; @@ -460,7 +460,7 @@ log_close(void) ib_uint64_t oldest_lsn; ib_uint64_t lsn; ib_uint64_t tracked_lsn; - ulint tracked_lsn_age; + ib_uint64_t tracked_lsn_age; log_t* log = log_sys; ib_uint64_t checkpoint_age; diff --git a/storage/xtradb/log/log0online.c b/storage/xtradb/log/log0online.c index 1d478c467e6..55eb9d17c46 100644 --- a/storage/xtradb/log/log0online.c +++ b/storage/xtradb/log/log0online.c @@ -48,10 +48,8 @@ struct log_bitmap_struct { parsed, it points to the start, otherwise points immediatelly past the end of the incomplete log record. */ - char* out_name; /*!< the file name for bitmap output */ - os_file_t out; /*!< the bitmap output file */ - ib_uint64_t out_offset; /*!< the next write position in the - bitmap output file */ + log_online_bitmap_file_t out; /*!< The current bitmap file */ + ulint out_seq_num; /*!< the bitmap file sequence number */ ib_uint64_t start_lsn; /*!< the LSN of the next unparsed record and the start of the next LSN interval to be parsed. */ @@ -76,8 +74,13 @@ struct log_bitmap_struct { /* The log parsing and bitmap output struct instance */ static struct log_bitmap_struct* log_bmp_sys; -/* File name stem for modified page bitmaps */ -static const char* modified_page_stem = "ib_modified_log."; +/** File name stem for bitmap files. */ +static const char* bmp_file_name_stem = "ib_modified_log_"; + +/** File name template for bitmap files. The 1st format tag is a directory +name, the 2nd tag is the stem, the 3rd tag is a file sequence number, the 4th +tag is the start LSN for the file. */ +static const char* bmp_file_name_template = "%s%s%lu_%llu.xdb"; /* On server startup with empty database srv_start_lsn == 0, in which case the first LSN of actual log records will be this. */ @@ -85,7 +88,7 @@ which case the first LSN of actual log records will be this. */ /* Tests if num bit of bitmap is set */ #define IS_BIT_SET(bitmap, num) \ - (*((bitmap) + ((num) >> 3)) & (1UL << ((num) & 7UL))) + (*((bitmap) + ((num) >> 3)) & (1UL << ((num) & 7UL))) /** The bitmap file block size in bytes. All writes will be multiples of this. */ @@ -243,10 +246,69 @@ log_online_calc_checksum( } /****************************************************************//** +Read one bitmap data page and check it for corruption. + +@return TRUE if page read OK, FALSE if I/O error */ +static +ibool +log_online_read_bitmap_page( +/*========================*/ + log_online_bitmap_file_t *bitmap_file, /*!<in/out: bitmap + file */ + byte *page, /*!<out: read page. + Must be at least + MODIFIED_PAGE_BLOCK_SIZE + bytes long */ + ibool *checksum_ok) /*!<out: TRUE if page + checksum OK */ +{ + ulint offset_low = (ulint)(bitmap_file->offset & 0xFFFFFFFF); + ulint offset_high = (ulint)(bitmap_file->offset >> 32); + ulint checksum; + ulint actual_checksum; + ibool success; + + ut_a(bitmap_file->size >= MODIFIED_PAGE_BLOCK_SIZE); + ut_a(bitmap_file->offset + <= bitmap_file->size - MODIFIED_PAGE_BLOCK_SIZE); + ut_a(bitmap_file->offset % MODIFIED_PAGE_BLOCK_SIZE == 0); + + success = os_file_read(bitmap_file->file, page, offset_low, + offset_high, MODIFIED_PAGE_BLOCK_SIZE); + + if (UNIV_UNLIKELY(!success)) { + + /* The following call prints an error message */ + os_file_get_last_error(TRUE); + fprintf(stderr, + "InnoDB: Warning: failed reading changed page bitmap " + "file \'%s\'\n", bitmap_file->name); + return FALSE; + } + + bitmap_file->offset += MODIFIED_PAGE_BLOCK_SIZE; + ut_ad(bitmap_file->offset <= bitmap_file->size); + + checksum = mach_read_from_4(page + MODIFIED_PAGE_BLOCK_CHECKSUM); + actual_checksum = log_online_calc_checksum(page); + *checksum_ok = (checksum == actual_checksum); + + return TRUE; +} + +/****************************************************************//** Get the last tracked fully LSN from the bitmap file by reading backwards untile a correct end page is found. Detects incomplete writes and corrupted data. Sets the start output position for the written bitmap data. + +Multiple bitmap files are handled using the following assumptions: +1) Only the last file might be corrupted. In case where no good data was found +in the last file, assume that the next to last file is OK. This assumption +does not limit crash recovery capability in any way. +2) If the whole of the last file was corrupted, assume that the start LSN in +its name is correct and use it for (re-)tracking start. + @return the last fully tracked LSN */ static ib_uint64_t @@ -254,73 +316,46 @@ log_online_read_last_tracked_lsn() /*==============================*/ { byte page[MODIFIED_PAGE_BLOCK_SIZE]; - ib_uint64_t read_offset = log_bmp_sys->out_offset; - /* Initialize these to nonequal values so that file size == 0 case with - zero loop repetitions is handled correctly */ - ulint checksum = 0; - ulint actual_checksum = !checksum; ibool is_last_page = FALSE; + ibool checksum_ok = FALSE; ib_uint64_t result; + ib_uint64_t read_offset = log_bmp_sys->out.offset; - ut_ad(log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE == 0); - - while (checksum != actual_checksum && read_offset > 0 && !is_last_page) + while (!checksum_ok && read_offset > 0 && !is_last_page) { - - ulint offset_low, offset_high; - ibool success; - read_offset -= MODIFIED_PAGE_BLOCK_SIZE; - offset_high = (ulint)(read_offset >> 32); - offset_low = (ulint)(read_offset & 0xFFFFFFFF); - - success = os_file_read(log_bmp_sys->out, page, offset_low, - offset_high, MODIFIED_PAGE_BLOCK_SIZE); - if (!success) { + log_bmp_sys->out.offset = read_offset; - /* The following call prints an error message */ - os_file_get_last_error(TRUE); - /* Here and below assume that bitmap file names do not - contain apostrophes, thus no need for - ut_print_filename(). */ - fprintf(stderr, "InnoDB: Warning: failed reading " - "changed page bitmap file \'%s\'\n", - log_bmp_sys->out_name); - return MIN_TRACKED_LSN; + if (!log_online_read_bitmap_page(&log_bmp_sys->out, page, + &checksum_ok)) { + checksum_ok = FALSE; + result = 0; + break; } - is_last_page - = mach_read_from_4(page + MODIFIED_PAGE_IS_LAST_BLOCK); - checksum = mach_read_from_4(page - + MODIFIED_PAGE_BLOCK_CHECKSUM); - actual_checksum = log_online_calc_checksum(page); - if (checksum != actual_checksum) { + if (checksum_ok) { + is_last_page + = mach_read_from_4 + (page + MODIFIED_PAGE_IS_LAST_BLOCK); + } else { - fprintf(stderr, "InnoDB: Warning: corruption " - "detected in \'%s\' at offset %llu\n", - log_bmp_sys->out_name, read_offset); + fprintf(stderr, + "InnoDB: Warning: corruption detected in " + "\'%s\' at offset %llu\n", + log_bmp_sys->out.name, read_offset); } - }; - if (UNIV_LIKELY(checksum == actual_checksum && is_last_page)) { - - log_bmp_sys->out_offset = read_offset - + MODIFIED_PAGE_BLOCK_SIZE; - result = mach_read_from_8(page + MODIFIED_PAGE_END_LSN); - } - else { - log_bmp_sys->out_offset = read_offset; - result = 0; - } + result = (checksum_ok && is_last_page) + ? mach_read_from_8(page + MODIFIED_PAGE_END_LSN) : 0; /* Truncate the output file to discard the corrupted bitmap data, if any */ - if (!os_file_set_eof_at(log_bmp_sys->out, - log_bmp_sys->out_offset)) { + if (!os_file_set_eof_at(log_bmp_sys->out.file, + log_bmp_sys->out.offset)) { fprintf(stderr, "InnoDB: Warning: failed truncating " "changed page bitmap file \'%s\' to %llu bytes\n", - log_bmp_sys->out_name, log_bmp_sys->out_offset); + log_bmp_sys->out.name, log_bmp_sys->out.offset); result = 0; } return result; @@ -350,6 +385,37 @@ log_set_tracked_lsn( #endif } +/*********************************************************************//** +Check if missing, if any, LSN interval can be read and tracked using the +current LSN value, the LSN value where the tracking stopped, and the log group +capacity. + +@return TRUE if the missing interval can be tracked or if there's no missing +data. */ +static +ibool +log_online_can_track_missing( +/*=========================*/ + ib_uint64_t last_tracked_lsn, /*!<in: last tracked LSN */ + ib_uint64_t tracking_start_lsn) /*!<in: current LSN */ +{ + /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty + bitmap file, handle this too. */ + last_tracked_lsn = ut_max_uint64(last_tracked_lsn, MIN_TRACKED_LSN); + + if (last_tracked_lsn > tracking_start_lsn) { + fprintf(stderr, + "InnoDB: Error: last tracked LSN is in future. This " + "can be caused by mismatched bitmap files.\n"); + exit(1); + } + + return (last_tracked_lsn == tracking_start_lsn) + || (log_sys->lsn - last_tracked_lsn + <= log_sys->log_group_capacity); +} + + /****************************************************************//** Diagnose a gap in tracked LSN range on server startup due to crash or very fast shutdown and try to close it by tracking the data @@ -365,22 +431,20 @@ log_online_track_missing_on_startup( { ut_ad(last_tracked_lsn != tracking_start_lsn); - fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' is %llu, but " - "last checkpoint LSN is %llu. This might be due to a server " - "crash or a very fast shutdown. ", log_bmp_sys->out_name, - last_tracked_lsn, tracking_start_lsn); - - /* last_tracked_lsn might be < MIN_TRACKED_LSN in the case of empty - bitmap file, handle this too. */ - last_tracked_lsn = ut_max(last_tracked_lsn, MIN_TRACKED_LSN); + fprintf(stderr, "InnoDB: last tracked LSN is %llu, but the last " + "checkpoint LSN is %llu. This might be due to a server " + "crash or a very fast shutdown. ", last_tracked_lsn, + tracking_start_lsn); /* See if we can fully recover the missing interval */ - if (log_sys->lsn - last_tracked_lsn < log_sys->log_group_capacity) { + if (log_online_can_track_missing(last_tracked_lsn, + tracking_start_lsn)) { fprintf(stderr, "Reading the log to advance the last tracked LSN.\n"); - log_bmp_sys->start_lsn = last_tracked_lsn; + log_bmp_sys->start_lsn = ut_max_uint64(last_tracked_lsn, + MIN_TRACKED_LSN); log_set_tracked_lsn(log_bmp_sys->start_lsn); log_online_follow_redo_log(); ut_ad(log_bmp_sys->end_lsn >= tracking_start_lsn); @@ -406,16 +470,101 @@ log_online_track_missing_on_startup( } /*********************************************************************//** +Format a bitmap output file name to log_bmp_sys->out.name. */ +static +void +log_online_make_bitmap_name( +/*=========================*/ + ib_uint64_t start_lsn) /*!< in: the start LSN name part */ +{ + ut_snprintf(log_bmp_sys->out.name, FN_REFLEN, bmp_file_name_template, + srv_data_home, bmp_file_name_stem, + log_bmp_sys->out_seq_num, start_lsn); + +} + +/*********************************************************************//** +Create a new empty bitmap output file. */ +static +void +log_online_start_bitmap_file() +/*==========================*/ +{ + ibool success; + + log_bmp_sys->out.file + = os_file_create(innodb_file_bmp_key, log_bmp_sys->out.name, + OS_FILE_OVERWRITE, OS_FILE_NORMAL, + OS_DATA_FILE, &success); + if (UNIV_UNLIKELY(!success)) { + + /* The following call prints an error message */ + os_file_get_last_error(TRUE); + fprintf(stderr, + "InnoDB: Error: Cannot create \'%s\'\n", + log_bmp_sys->out.name); + exit(1); + } + + log_bmp_sys->out.offset = 0; +} + +/*********************************************************************//** +Close the current bitmap output file and create the next one. */ +static +void +log_online_rotate_bitmap_file( +/*===========================*/ + ib_uint64_t next_file_start_lsn) /*!<in: the start LSN name + part */ +{ + os_file_close(log_bmp_sys->out.file); + log_bmp_sys->out_seq_num++; + log_online_make_bitmap_name(next_file_start_lsn); + log_online_start_bitmap_file(); +} + +/*********************************************************************//** +Check the name of a given file if it's a changed page bitmap file and +return file sequence and start LSN name components if it is. If is not, +the values of output parameters are undefined. + +@return TRUE if a given file is a changed page bitmap file. */ +static +ibool +log_online_is_bitmap_file( +/*======================*/ + const os_file_stat_t* file_info, /*!<in: file to + check */ + ulong* bitmap_file_seq_num, /*!<out: bitmap file + sequence number */ + ib_uint64_t* bitmap_file_start_lsn) /*!<out: bitmap file + start LSN */ +{ + char stem[FN_REFLEN]; + + ut_ad (strlen(file_info->name) < OS_FILE_MAX_PATH); + + return ((file_info->type == OS_FILE_TYPE_FILE + || file_info->type == OS_FILE_TYPE_LINK) + && (sscanf(file_info->name, "%[a-z_]%lu_%llu.xdb", stem, + bitmap_file_seq_num, bitmap_file_start_lsn) == 3) + && (!strcmp(stem, bmp_file_name_stem))); +} + +/*********************************************************************//** Initialize the online log following subsytem. */ UNIV_INTERN void log_online_read_init() /*==================*/ { - char buf[FN_REFLEN]; ibool success; ib_uint64_t tracking_start_lsn - = ut_max(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN); + = ut_max_uint64(log_sys->last_checkpoint_lsn, MIN_TRACKED_LSN); + os_file_dir_t bitmap_dir; + os_file_stat_t bitmap_dir_file_info; + ib_uint64_t last_file_start_lsn = MIN_TRACKED_LSN; /* Assert (could be compile-time assert) that bitmap data start and end in a bitmap block is 8-byte aligned */ @@ -424,82 +573,120 @@ log_online_read_init() log_bmp_sys = ut_malloc(sizeof(*log_bmp_sys)); - ut_snprintf(buf, FN_REFLEN, "%s%s%d", srv_data_home, - modified_page_stem, 1); - log_bmp_sys->out_name = ut_malloc(strlen(buf) + 1); - ut_strcpy(log_bmp_sys->out_name, buf); + /* Enumerate existing bitmap files to either open the last one to get + the last tracked LSN either to find that there are none and start + tracking from scratch. */ + log_bmp_sys->out.name[0] = '\0'; + log_bmp_sys->out_seq_num = 0; + + bitmap_dir = os_file_opendir(srv_data_home, TRUE); + ut_a(bitmap_dir); + while (!os_file_readdir_next_file(srv_data_home, bitmap_dir, + &bitmap_dir_file_info)) { + + ulong file_seq_num; + ib_uint64_t file_start_lsn; + + if (!log_online_is_bitmap_file(&bitmap_dir_file_info, + &file_seq_num, + &file_start_lsn)) { + continue; + } + + if (file_seq_num > log_bmp_sys->out_seq_num + && bitmap_dir_file_info.size > 0) { + log_bmp_sys->out_seq_num = file_seq_num; + last_file_start_lsn = file_start_lsn; + /* No dir component (srv_data_home) here, because + that's the cwd */ + strncpy(log_bmp_sys->out.name, + bitmap_dir_file_info.name, FN_REFLEN - 1); + log_bmp_sys->out.name[FN_REFLEN - 1] = '\0'; + } + } + + if (os_file_closedir(bitmap_dir)) { + os_file_get_last_error(TRUE); + fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n", + srv_data_home); + exit(1); + } + + if (!log_bmp_sys->out_seq_num) { + log_bmp_sys->out_seq_num = 1; + log_online_make_bitmap_name(0); + } log_bmp_sys->modified_pages = rbt_create(MODIFIED_PAGE_BLOCK_SIZE, log_online_compare_bmp_keys); log_bmp_sys->page_free_list = NULL; - log_bmp_sys->out + log_bmp_sys->out.file = os_file_create_simple_no_error_handling - (innodb_file_bmp_key, log_bmp_sys->out_name, OS_FILE_OPEN, + (innodb_file_bmp_key, log_bmp_sys->out.name, OS_FILE_OPEN, OS_FILE_READ_WRITE, &success); if (!success) { /* New file, tracking from scratch */ - log_bmp_sys->out - = os_file_create_simple_no_error_handling - (innodb_file_bmp_key, log_bmp_sys->out_name, - OS_FILE_CREATE, OS_FILE_READ_WRITE, &success); - if (!success) { - - /* The following call prints an error message */ - os_file_get_last_error(TRUE); - fprintf(stderr, - "InnoDB: Error: Cannot create \'%s\'\n", - log_bmp_sys->out_name); - exit(1); - } - - log_bmp_sys->out_offset = 0; + log_online_start_bitmap_file(); } else { - /* Old file, read last tracked LSN and continue from there */ + /* Read the last tracked LSN from the last file */ ulint size_low; ulint size_high; ib_uint64_t last_tracked_lsn; - success = os_file_get_size(log_bmp_sys->out, &size_low, + success = os_file_get_size(log_bmp_sys->out.file, &size_low, &size_high); ut_a(success); - log_bmp_sys->out_offset + log_bmp_sys->out.size = ((ib_uint64_t)size_high << 32) | size_low; + log_bmp_sys->out.offset = log_bmp_sys->out.size; - if (log_bmp_sys->out_offset % MODIFIED_PAGE_BLOCK_SIZE != 0) { + if (log_bmp_sys->out.offset % MODIFIED_PAGE_BLOCK_SIZE != 0) { fprintf(stderr, "InnoDB: Warning: truncated block detected " "in \'%s\' at offset %llu\n", - log_bmp_sys->out_name, - log_bmp_sys->out_offset); - log_bmp_sys->out_offset -= - log_bmp_sys->out_offset + log_bmp_sys->out.name, + log_bmp_sys->out.offset); + log_bmp_sys->out.offset -= + log_bmp_sys->out.offset % MODIFIED_PAGE_BLOCK_SIZE; } last_tracked_lsn = log_online_read_last_tracked_lsn(); + if (!last_tracked_lsn) { + last_tracked_lsn = last_file_start_lsn; + } + + /* Start a new file. Choose the LSN value in its name based on + if we can retrack any missing data. */ + if (log_online_can_track_missing(last_tracked_lsn, + tracking_start_lsn)) { + log_online_rotate_bitmap_file(last_tracked_lsn); + } + else { + log_online_rotate_bitmap_file(tracking_start_lsn); + } if (last_tracked_lsn < tracking_start_lsn) { - log_online_track_missing_on_startup(last_tracked_lsn, - tracking_start_lsn); + log_online_track_missing_on_startup + (last_tracked_lsn, tracking_start_lsn); return; } if (last_tracked_lsn > tracking_start_lsn) { - fprintf(stderr, "InnoDB: last tracked LSN in \'%s\' " - "is %llu, but last checkpoint LSN is %llu. " + fprintf(stderr, "InnoDB: last tracked LSN is %llu, " + "but last the checkpoint LSN is %llu. " "The tracking-based incremental backups will " "work only from the latter LSN!\n", - log_bmp_sys->out_name, last_tracked_lsn, - tracking_start_lsn); + last_tracked_lsn, tracking_start_lsn); } } @@ -519,7 +706,7 @@ log_online_read_shutdown() { ib_rbt_node_t *free_list_node = log_bmp_sys->page_free_list; - os_file_close(log_bmp_sys->out); + os_file_close(log_bmp_sys->out.file); rbt_free(log_bmp_sys->modified_pages); @@ -529,7 +716,6 @@ log_online_read_shutdown() free_list_node = next; } - ut_free(log_bmp_sys->out_name); ut_free(log_bmp_sys); } @@ -746,8 +932,8 @@ log_online_follow_log_seg( /* The next parse LSN is inside the current block, skip data preceding it. */ skip_already_parsed_len - = log_bmp_sys->next_parse_lsn - - block_start_lsn; + = (ulint)(log_bmp_sys->next_parse_lsn + - block_start_lsn); } else { @@ -819,32 +1005,32 @@ log_online_write_bitmap_page( { ibool success; - success = os_file_write(log_bmp_sys->out_name,log_bmp_sys->out, + success = os_file_write(log_bmp_sys->out.name, log_bmp_sys->out.file, block, - (ulint)(log_bmp_sys->out_offset & 0xFFFFFFFF), - (ulint)(log_bmp_sys->out_offset << 32), + (ulint)(log_bmp_sys->out.offset & 0xFFFFFFFF), + (ulint)(log_bmp_sys->out.offset << 32), MODIFIED_PAGE_BLOCK_SIZE); if (UNIV_UNLIKELY(!success)) { /* The following call prints an error message */ os_file_get_last_error(TRUE); fprintf(stderr, "InnoDB: Error: failed writing changed page " - "bitmap file \'%s\'\n", log_bmp_sys->out_name); + "bitmap file \'%s\'\n", log_bmp_sys->out.name); return; } - success = os_file_flush(log_bmp_sys->out, FALSE); + success = os_file_flush(log_bmp_sys->out.file, FALSE); if (UNIV_UNLIKELY(!success)) { /* The following call prints an error message */ os_file_get_last_error(TRUE); fprintf(stderr, "InnoDB: Error: failed flushing " "changed page bitmap file \'%s\'\n", - log_bmp_sys->out_name); + log_bmp_sys->out.name); return; } - log_bmp_sys->out_offset += MODIFIED_PAGE_BLOCK_SIZE; + log_bmp_sys->out.offset += MODIFIED_PAGE_BLOCK_SIZE; } /*********************************************************************//** @@ -858,6 +1044,10 @@ log_online_write_bitmap() ib_rbt_node_t *bmp_tree_node; const ib_rbt_node_t *last_bmp_tree_node; + if (log_bmp_sys->out.offset >= srv_max_bitmap_file_size) { + log_online_rotate_bitmap_file(log_bmp_sys->start_lsn); + } + bmp_tree_node = (ib_rbt_node_t *) rbt_first(log_bmp_sys->modified_pages); last_bmp_tree_node = rbt_last(log_bmp_sys->modified_pages); @@ -930,47 +1120,306 @@ log_online_follow_redo_log() } /*********************************************************************//** -Initializes log bitmap iterator. +List the bitmap files in srv_data_home and setup their range that contains the +specified LSN interval. This range, if non-empty, will start with a file that +has the greatest LSN equal to or less than the start LSN and will include all +the files up to the one with the greatest LSN less than the end LSN. Caller +must free bitmap_files->files when done if bitmap_files set to non-NULL and +this function returned TRUE. Field bitmap_files->count might be set to a +larger value than the actual count of the files, and space for the unused array +slots will be allocated but cleared to zeroes. + +@return TRUE if succeeded +*/ +static +ibool +log_online_setup_bitmap_file_range( +/*===============================*/ + log_online_bitmap_file_range_t *bitmap_files, /*!<in/out: bitmap file + range */ + ib_uint64_t range_start, /*!<in: start LSN */ + ib_uint64_t range_end) /*!<in: end LSN */ +{ + os_file_dir_t bitmap_dir; + os_file_stat_t bitmap_dir_file_info; + ulong first_file_seq_num = ULONG_MAX; + ib_uint64_t first_file_start_lsn = IB_ULONGLONG_MAX; + + bitmap_files->count = 0; + bitmap_files->files = NULL; + + /* 1st pass: size the info array */ + + bitmap_dir = os_file_opendir(srv_data_home, FALSE); + if (!bitmap_dir) { + fprintf(stderr, + "InnoDB: Error: " + "failed to open bitmap directory \'%s\'\n", + srv_data_home); + return FALSE; + } + + while (!os_file_readdir_next_file(srv_data_home, bitmap_dir, + &bitmap_dir_file_info)) { + + ulong file_seq_num; + ib_uint64_t file_start_lsn; + + if (!log_online_is_bitmap_file(&bitmap_dir_file_info, + &file_seq_num, + &file_start_lsn) + || file_start_lsn >= range_end) { + + continue; + } + + if (file_start_lsn >= range_start + || file_start_lsn == first_file_start_lsn + || first_file_start_lsn > range_start) { + + /* A file that falls into the range */ + bitmap_files->count++; + if (file_start_lsn < first_file_start_lsn) { + + first_file_start_lsn = file_start_lsn; + } + if (file_seq_num < first_file_seq_num) { + + first_file_seq_num = file_seq_num; + } + } else if (file_start_lsn > first_file_start_lsn) { + + /* A file that has LSN closer to the range start + but smaller than it, replacing another such file */ + first_file_start_lsn = file_start_lsn; + first_file_seq_num = file_seq_num; + } + } + + ut_a(first_file_seq_num != ULONG_MAX || bitmap_files->count == 0); + + if (os_file_closedir(bitmap_dir)) { + os_file_get_last_error(TRUE); + fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n", + srv_data_home); + return FALSE; + } + + if (!bitmap_files->count) { + return TRUE; + } + + /* 2nd pass: get the file names in the file_seq_num order */ + + bitmap_dir = os_file_opendir(srv_data_home, FALSE); + if (!bitmap_dir) { + fprintf(stderr, "InnoDB: Error: " + "failed to open bitmap directory \'%s\'\n", + srv_data_home); + return FALSE; + } + + bitmap_files->files = ut_malloc(bitmap_files->count + * sizeof(bitmap_files->files[0])); + memset(bitmap_files->files, 0, + bitmap_files->count * sizeof(bitmap_files->files[0])); + + while (!os_file_readdir_next_file(srv_data_home, bitmap_dir, + &bitmap_dir_file_info)) { + + ulong file_seq_num; + ib_uint64_t file_start_lsn; + size_t array_pos; + + if (!log_online_is_bitmap_file(&bitmap_dir_file_info, + &file_seq_num, + &file_start_lsn) + || file_start_lsn >= range_end + || file_start_lsn < first_file_start_lsn) { + continue; + } + + array_pos = file_seq_num - first_file_seq_num; + if (file_seq_num > bitmap_files->files[array_pos].seq_num) { + bitmap_files->files[array_pos].seq_num = file_seq_num; + strncpy(bitmap_files->files[array_pos].name, + bitmap_dir_file_info.name, FN_REFLEN); + bitmap_files->files[array_pos].name[FN_REFLEN - 1] + = '\0'; + bitmap_files->files[array_pos].start_lsn + = file_start_lsn; + } + } + + if (os_file_closedir(bitmap_dir)) { + os_file_get_last_error(TRUE); + fprintf(stderr, "InnoDB: Error: cannot close \'%s\'\n", + srv_data_home); + free(bitmap_files->files); + return FALSE; + } + +#ifdef UNIV_DEBUG + ut_ad(bitmap_files->files[0].seq_num == first_file_seq_num); + ut_ad(bitmap_files->files[0].start_lsn == first_file_start_lsn); + { + size_t i; + for (i = 1; i < bitmap_files->count; i++) { + if (!bitmap_files->files[i].seq_num) { + break; + } + ut_ad(bitmap_files->files[i].seq_num + > bitmap_files->files[i - 1].seq_num); + ut_ad(bitmap_files->files[i].start_lsn + >= bitmap_files->files[i - 1].start_lsn); + } + } +#endif + + return TRUE; +} + +/****************************************************************//** +Open a bitmap file for reading. + +@return TRUE if opened successfully */ +static +ibool +log_online_open_bitmap_file_read_only( +/*==================================*/ + const char* name, /*!<in: bitmap file + name without directory, + which is assumed to be + srv_data_home */ + log_online_bitmap_file_t* bitmap_file) /*!<out: opened bitmap + file */ +{ + ibool success = FALSE; + ulint size_low; + ulint size_high; + + ut_snprintf(bitmap_file->name, FN_REFLEN, "%s%s", srv_data_home, name); + bitmap_file->file + = os_file_create_simple_no_error_handling(innodb_file_bmp_key, + bitmap_file->name, + OS_FILE_OPEN, + OS_FILE_READ_ONLY, + &success); + if (!success) { + /* Here and below assume that bitmap file names do not + contain apostrophes, thus no need for ut_print_filename(). */ + fprintf(stderr, + "InnoDB: Warning: error opening the changed page " + "bitmap \'%s\'\n", bitmap_file->name); + return FALSE; + } + + success = os_file_get_size(bitmap_file->file, &size_low, &size_high); + bitmap_file->size = (((ib_uint64_t)size_high) << 32) | size_low; + bitmap_file->offset = 0; + +#ifdef UNIV_LINUX + posix_fadvise(bitmap_file->file, 0, 0, POSIX_FADV_SEQUENTIAL); + posix_fadvise(bitmap_file->file, 0, 0, POSIX_FADV_NOREUSE); +#endif + + return TRUE; +} + +/****************************************************************//** +Diagnose one or both of the following situations if we read close to +the end of bitmap file: +1) Warn if the remainder of the file is less than one page. +2) Error if we cannot read any more full pages but the last read page +did not have the last-in-run flag set. + +@return FALSE for the error */ +static +ibool +log_online_diagnose_bitmap_eof( +/*===========================*/ + const log_online_bitmap_file_t* bitmap_file, /*!< in: bitmap file */ + ibool last_page_in_run)/*!< in: "last page in + run" flag value in the + last read page */ +{ + /* Check if we are too close to EOF to read a full page */ + if ((bitmap_file->size < MODIFIED_PAGE_BLOCK_SIZE) + || (bitmap_file->offset + > bitmap_file->size - MODIFIED_PAGE_BLOCK_SIZE)) { + + if (bitmap_file->offset != bitmap_file->size) { + /* If we are not at EOF and we have less than one page + to read, it's junk. This error is not fatal in + itself. */ + + fprintf(stderr, + "InnoDB: Warning: junk at the end of changed " + "page bitmap file \'%s\'.\n", + bitmap_file->name); + } + + if (!last_page_in_run) { + /* We are at EOF but the last read page did not finish + a run */ + /* It's a "Warning" here because it's not a fatal error + for the whole server */ + fprintf(stderr, + "InnoDB: Warning: changed page bitmap " + "file \'%s\' does not contain a complete run " + "at the end.\n", bitmap_file->name); + return FALSE; + } + } + return TRUE; +} + +/*********************************************************************//** +Initialize the log bitmap iterator for a given range. The records are +processed at a bitmap block granularity, i.e. all the records in the same block +share the same start and end LSN values, the exact LSN of each record is +unavailable (nor is it defined for blocks that are touched more than once in +the LSN interval contained in the block). Thus min_lsn and max_lsn should be +set at block boundaries or bigger, otherwise the records at the 1st and the +last blocks will not be returned. Also note that there might be returned +records with LSN < min_lsn, as min_lsn is used to select the correct starting +file but not block. + @return TRUE if the iterator is initialized OK, FALSE otherwise. */ UNIV_INTERN ibool log_online_bitmap_iterator_init( /*============================*/ - log_bitmap_iterator_t *i) /*!<in/out: iterator */ + log_bitmap_iterator_t *i, /*!<in/out: iterator */ + ib_uint64_t min_lsn,/*!< in: start LSN */ + ib_uint64_t max_lsn)/*!< in: end LSN */ { - ibool success; - ut_a(i); - ut_snprintf(i->in_name, FN_REFLEN, "%s%s%d", srv_data_home, - modified_page_stem, 1); - i->in_offset = 0; - /* - Set up bit offset out of the reasonable limit - to intiate reading block from file in - log_online_bitmap_iterator_next() - */ - i->bit_offset = MODIFIED_PAGE_BLOCK_BITMAP_LEN; - i->in = - os_file_create_simple_no_error_handling(innodb_file_bmp_key, - i->in_name, - OS_FILE_OPEN, - OS_FILE_READ_ONLY, - &success); - if (!success) { - /* The following call prints an error message */ - os_file_get_last_error(TRUE); - fprintf(stderr, - "InnoDB: Error: Cannot open \'%s\'\n", - i->in_name); + if (!log_online_setup_bitmap_file_range(&i->in_files, min_lsn, + max_lsn)) { + return FALSE; } - i->page = ut_malloc(MODIFIED_PAGE_BLOCK_SIZE); + ut_a(i->in_files.count > 0); + + /* Open the 1st bitmap file */ + i->in_i = 0; + if (!log_online_open_bitmap_file_read_only(i->in_files.files[i->in_i]. + name, + &i->in)) { + i->in_i = i->in_files.count; + free(i->in_files.files); + return FALSE; + } + i->page = ut_malloc(MODIFIED_PAGE_BLOCK_SIZE); + i->bit_offset = MODIFIED_PAGE_BLOCK_BITMAP_LEN; i->start_lsn = i->end_lsn = 0; i->space_id = 0; i->first_page_id = 0; + i->last_page_in_run = TRUE; i->changed = FALSE; return TRUE; @@ -985,7 +1434,11 @@ log_online_bitmap_iterator_release( log_bitmap_iterator_t *i) /*!<in/out: iterator */ { ut_a(i); - os_file_close(i->in); + + if (i->in_i < i->in_files.count) { + os_file_close(i->in.file); + } + ut_free(i->in_files.files); ut_free(i->page); } @@ -1000,14 +1453,7 @@ log_online_bitmap_iterator_next( /*============================*/ log_bitmap_iterator_t *i) /*!<in/out: iterator */ { - ulint offset_low; - ulint offset_high; - ulint size_low; - ulint size_high; - ulint checksum = 0; - ulint actual_checksum = !checksum; - - ibool success; + ibool checksum_ok = FALSE; ut_a(i); @@ -1020,66 +1466,51 @@ log_online_bitmap_iterator_next( return TRUE; } - while (checksum != actual_checksum) + while (!checksum_ok) { - success = os_file_get_size(i->in, - &size_low, - &size_high); - if (!success) { - os_file_get_last_error(TRUE); - fprintf(stderr, - "InnoDB: Warning: can't get size of " - "page bitmap file \'%s\'\n", - i->in_name); - return FALSE; - } - - if (i->in_offset >= - (ib_uint64_t)(size_low) + - ((ib_uint64_t)(size_high) << 32)) - return FALSE; - - offset_high = (ulint)(i->in_offset >> 32); - offset_low = (ulint)(i->in_offset & 0xFFFFFFFF); + while (i->in.size < MODIFIED_PAGE_BLOCK_SIZE + || (i->in.offset + > i->in.size - MODIFIED_PAGE_BLOCK_SIZE)) { + + /* Advance file */ + i->in_i++; + os_file_close(i->in.file); + log_online_diagnose_bitmap_eof(&i->in, + i->last_page_in_run); + if (i->in_i == i->in_files.count + || i->in_files.files[i->in_i].seq_num == 0) { + + return FALSE; + } - success = os_file_read( - i->in, - i->page, - offset_low, - offset_high, - MODIFIED_PAGE_BLOCK_SIZE); + if (!log_online_open_bitmap_file_read_only( + i->in_files.files[i->in_i].name, + &i->in)) { + return FALSE; + } + } - if (!success) { + if (!log_online_read_bitmap_page(&i->in, i->page, + &checksum_ok)) { os_file_get_last_error(TRUE); fprintf(stderr, "InnoDB: Warning: failed reading " "changed page bitmap file \'%s\'\n", - i->in_name); + i->in_files.files[i->in_i].name); return FALSE; } - - checksum = mach_read_from_4( - i->page + MODIFIED_PAGE_BLOCK_CHECKSUM); - - actual_checksum = log_online_calc_checksum(i->page); - - i->in_offset += MODIFIED_PAGE_BLOCK_SIZE; } - i->start_lsn = - mach_read_from_8(i->page + MODIFIED_PAGE_START_LSN); - i->end_lsn = - mach_read_from_8(i->page + MODIFIED_PAGE_END_LSN); - i->space_id = - mach_read_from_4(i->page + MODIFIED_PAGE_SPACE_ID); - i->first_page_id = - mach_read_from_4(i->page + MODIFIED_PAGE_1ST_PAGE_ID); - i->bit_offset = - 0; - i->changed = - IS_BIT_SET(i->page + MODIFIED_PAGE_BLOCK_BITMAP, - i->bit_offset); + i->start_lsn = mach_read_from_8(i->page + MODIFIED_PAGE_START_LSN); + i->end_lsn = mach_read_from_8(i->page + MODIFIED_PAGE_END_LSN); + i->space_id = mach_read_from_4(i->page + MODIFIED_PAGE_SPACE_ID); + i->first_page_id = mach_read_from_4(i->page + + MODIFIED_PAGE_1ST_PAGE_ID); + i->last_page_in_run = mach_read_from_4(i->page + + MODIFIED_PAGE_IS_LAST_BLOCK); + i->bit_offset = 0; + i->changed = IS_BIT_SET(i->page + MODIFIED_PAGE_BLOCK_BITMAP, + i->bit_offset); return TRUE; } - diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 2555c010027..8e0516a84a9 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -2158,8 +2158,10 @@ os_file_set_eof_at( ib_uint64_t new_len)/*!< in: new file length */ { #ifdef __WIN__ - /* TODO: untested! */ - return(!_chsize_s(file, new_len)); + LARGE_INTEGER li, li2; + li.QuadPart = new_len; + return(SetFilePointerEx(file, li, &li2,FILE_BEGIN) + && SetEndOfFile(file)); #else /* TODO: works only with -D_FILE_OFFSET_BITS=64 ? */ return(!ftruncate(file, new_len)); diff --git a/storage/xtradb/row/row0ins.c b/storage/xtradb/row/row0ins.c index 3ae4c227ddc..61c3720fa2e 100644 --- a/storage/xtradb/row/row0ins.c +++ b/storage/xtradb/row/row0ins.c @@ -2012,7 +2012,10 @@ row_ins_index_entry_low( the function will return in both low_match and up_match of the cursor sensible values */ - if (dict_index_is_clust(index)) { + if (UNIV_UNLIKELY(thr_get_trx(thr)->fake_changes)) { + search_mode = (mode & BTR_MODIFY_TREE) + ? BTR_SEARCH_TREE : BTR_SEARCH_LEAF; + } else if (dict_index_is_clust(index)) { search_mode = mode; } else if (!(thr_get_trx(thr)->check_unique_secondary)) { search_mode = mode | BTR_INSERT | BTR_IGNORE_SEC_UNIQUE; @@ -2021,7 +2024,7 @@ row_ins_index_entry_low( } btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, - thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : search_mode, + search_mode, &cursor, 0, __FILE__, __LINE__, &mtr); if (cursor.flag == BTR_CUR_INSERT_TO_IBUF) { diff --git a/storage/xtradb/row/row0mysql.c b/storage/xtradb/row/row0mysql.c index 575160501c3..9ab85940760 100644 --- a/storage/xtradb/row/row0mysql.c +++ b/storage/xtradb/row/row0mysql.c @@ -1277,17 +1277,19 @@ run_again: que_thr_stop_for_mysql_no_error(thr, trx); - prebuilt->table->stat_n_rows++; + if (UNIV_LIKELY(!(trx->fake_changes))) { - srv_n_rows_inserted++; + prebuilt->table->stat_n_rows++; - if (prebuilt->table->stat_n_rows == 0) { - /* Avoid wrap-over */ - prebuilt->table->stat_n_rows--; + if (prebuilt->table->stat_n_rows == 0) { + /* Avoid wrap-over */ + prebuilt->table->stat_n_rows--; + } + + srv_n_rows_inserted++; + row_update_statistics_if_needed(prebuilt->table); } - if (!(trx->fake_changes)) - row_update_statistics_if_needed(prebuilt->table); trx->op_info = ""; return((int) err); @@ -1534,6 +1536,11 @@ run_again: que_thr_stop_for_mysql_no_error(thr, trx); + if (UNIV_UNLIKELY(trx->fake_changes)) { + trx->op_info = ""; + return((int) err); + } + if (node->is_delete) { if (prebuilt->table->stat_n_rows > 0) { prebuilt->table->stat_n_rows--; @@ -1548,7 +1555,6 @@ run_again: that changes indexed columns, UPDATEs that change only non-indexed columns would not affect statistics. */ if (node->is_delete || !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) { - if (!(trx->fake_changes)) row_update_statistics_if_needed(prebuilt->table); } @@ -1756,6 +1762,11 @@ run_again: return(err); } + if (UNIV_UNLIKELY((trx->fake_changes))) { + + return(err); + } + if (node->is_delete) { if (table->stat_n_rows > 0) { table->stat_n_rows--; @@ -1766,7 +1777,6 @@ run_again: srv_n_rows_updated++; } - if (!(trx->fake_changes)) row_update_statistics_if_needed(table); return(err); diff --git a/storage/xtradb/row/row0upd.c b/storage/xtradb/row/row0upd.c index 859b3d415ab..b2a0eb57669 100644 --- a/storage/xtradb/row/row0upd.c +++ b/storage/xtradb/row/row0upd.c @@ -2018,7 +2018,8 @@ row_upd_clust_rec( the same transaction do not modify the record in the meantime. Therefore we can assert that the restoration of the cursor succeeds. */ - ut_a(btr_pcur_restore_position(thr_get_trx(thr)->fake_changes ? BTR_SEARCH_LEAF : BTR_MODIFY_TREE, + ut_a(btr_pcur_restore_position(thr_get_trx(thr)->fake_changes + ? BTR_SEARCH_TREE : BTR_MODIFY_TREE, pcur, mtr)); ut_ad(!rec_get_deleted_flag(btr_pcur_get_rec(pcur), diff --git a/storage/xtradb/srv/srv0srv.c b/storage/xtradb/srv/srv0srv.c index 9d479ac6c87..6e210071746 100644 --- a/storage/xtradb/srv/srv0srv.c +++ b/storage/xtradb/srv/srv0srv.c @@ -179,8 +179,14 @@ UNIV_INTERN ibool srv_recovery_stats = FALSE; UNIV_INTERN my_bool srv_track_changed_pages = TRUE; +UNIV_INTERN ib_uint64_t srv_max_bitmap_file_size = 100 * 1024 * 1024; + UNIV_INTERN ulonglong srv_changed_pages_limit = 0; +/** When TRUE, fake change transcations take S rather than X row locks. + When FALSE, row locks are not taken at all. */ +UNIV_INTERN my_bool srv_fake_changes_locks = TRUE; + /* if TRUE, then we auto-extend the last data file */ UNIV_INTERN ibool srv_auto_extend_last_data_file = FALSE; /* if != 0, this tells the max size auto-extending may increase the diff --git a/storage/xtradb/srv/srv0start.c b/storage/xtradb/srv/srv0start.c index 65a775b56da..2faa68cb87c 100644 --- a/storage/xtradb/srv/srv0start.c +++ b/storage/xtradb/srv/srv0start.c @@ -1148,6 +1148,24 @@ skip_size_check: return(DB_SUCCESS); } +/*********************************************************************//** +Initializes the log tracking subsystem and starts its thread. */ +static +void +init_log_online(void) +/*=================*/ +{ + if (srv_track_changed_pages) { + + log_online_read_init(); + + /* Create the thread that follows the redo log to output the + changed page bitmap */ + os_thread_create(&srv_redo_log_follow_thread, NULL, + thread_ids + 5 + SRV_MAX_N_IO_THREADS); + } +} + /******************************************************************** Starts InnoDB and creates a new database if database files are not found and the user wants. @@ -1794,6 +1812,8 @@ innobase_start_or_create_for_mysql(void) trx_sys_file_format_init(); if (create_new_db) { + init_log_online(); + mtr_start(&mtr); fsp_header_init(0, sum_of_new_sizes, &mtr); @@ -1893,6 +1913,8 @@ innobase_start_or_create_for_mysql(void) return(DB_ERROR); } + init_log_online(); + /* Since the insert buffer init is in dict_boot, and the insert buffer is needed in any disk i/o, first we call dict_boot(). Note that trx_sys_init_at_db_start() only needs @@ -2040,19 +2062,6 @@ innobase_start_or_create_for_mysql(void) if (srv_auto_lru_dump && srv_blocking_lru_restore) buf_LRU_file_restore(); - if (srv_track_changed_pages) { - - /* Initialize the log tracking subsystem here to block - server startup until it's completed due to the potential - need to re-read previous server run's log. */ - log_online_read_init(); - - /* Create the thread that follows the redo log to output the - changed page bitmap */ - os_thread_create(&srv_redo_log_follow_thread, NULL, - thread_ids + 6 + SRV_MAX_N_IO_THREADS); - } - srv_is_being_started = FALSE; err = dict_create_or_check_foreign_constraint_tables(); |