diff --git a/drivers/txpy/setup.py b/drivers/txpy/setup.py
index dca36b4e94..f4779d141e 100644
--- a/drivers/txpy/setup.py
+++ b/drivers/txpy/setup.py
@@ -24,7 +24,7 @@ setup(
description="Cassandra Query Language driver",
long_description=open(abspath(join(dirname(__file__), 'README'))).read(),
url="http://cassandra.apache.org",
- packages=["txcql"],
+ packages=["txcql", "txcql.cassandra"],
requires=["thrift"],
provides=["txcql"],
classifiers=[
diff --git a/drivers/txpy/txcql/cassandra/Cassandra.py b/drivers/txpy/txcql/cassandra/Cassandra.py
new file mode 100644
index 0000000000..e5a9a3add7
--- /dev/null
+++ b/drivers/txpy/txcql/cassandra/Cassandra.py
@@ -0,0 +1,8728 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+from ttypes import *
+from thrift.Thrift import TProcessor
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+ from thrift.protocol import fastbinary
+except:
+ fastbinary = None
+
+from zope.interface import Interface, implements
+from twisted.internet import defer
+from thrift.transport import TTwisted
+
+class Iface(Interface):
+ def login(auth_request):
+ """
+ Parameters:
+ - auth_request
+ """
+ pass
+
+ def set_keyspace(keyspace):
+ """
+ Parameters:
+ - keyspace
+ """
+ pass
+
+ def get(key, column_path, consistency_level):
+ """
+ Get the Column or SuperColumn at the given column_path. If no value is present, NotFoundException is thrown. (This is
+ the only method that can throw an exception under non-failure conditions.)
+
+ Parameters:
+ - key
+ - column_path
+ - consistency_level
+ """
+ pass
+
+ def get_slice(key, column_parent, predicate, consistency_level):
+ """
+ Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name
+ pair) specified by the given SlicePredicate. If no matching values are found, an empty list is returned.
+
+ Parameters:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ pass
+
+ def get_count(key, column_parent, predicate, consistency_level):
+ """
+ returns the number of columns matching predicate for a particular key,
+ ColumnFamily and optionally SuperColumn.
+
+ Parameters:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ pass
+
+ def multiget_slice(keys, column_parent, predicate, consistency_level):
+ """
+ Performs a get_slice for column_parent and predicate for the given keys in parallel.
+
+ Parameters:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ pass
+
+ def multiget_count(keys, column_parent, predicate, consistency_level):
+ """
+ Perform a get_count in parallel on the given list keys. The return value maps keys to the count found.
+
+ Parameters:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ pass
+
+ def get_range_slices(column_parent, predicate, range, consistency_level):
+ """
+ returns a subset of columns for a contiguous range of keys.
+
+ Parameters:
+ - column_parent
+ - predicate
+ - range
+ - consistency_level
+ """
+ pass
+
+ def get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level):
+ """
+ Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause
+
+ Parameters:
+ - column_parent
+ - index_clause
+ - column_predicate
+ - consistency_level
+ """
+ pass
+
+ def insert(key, column_parent, column, consistency_level):
+ """
+ Insert a Column at the given column_parent.column_family and optional column_parent.super_column.
+
+ Parameters:
+ - key
+ - column_parent
+ - column
+ - consistency_level
+ """
+ pass
+
+ def remove(key, column_path, timestamp, consistency_level):
+ """
+ Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note
+ that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire
+ row by just specifying the ColumnFamily, or you can remove a SuperColumn or a single Column by specifying those levels too.
+
+ Note that counters have limited support for deletes: if you remove
+ a counter, you must wait to issue any following update until the
+ delete has reached all the nodes and all of them have been fully
+ compacted.
+
+ Parameters:
+ - key
+ - column_path
+ - timestamp
+ - consistency_level
+ """
+ pass
+
+ def batch_mutate(mutation_map, consistency_level):
+ """
+ Mutate many columns or super columns for many row keys. See also: Mutation.
+
+ mutation_map maps key to column family to a list of Mutation objects to take place at that scope.
+ *
+
+ Parameters:
+ - mutation_map
+ - consistency_level
+ """
+ pass
+
+ def truncate(cfname):
+ """
+ Truncate will mark and entire column family as deleted.
+ From the user's perspective a successful call to truncate will result complete data deletion from cfname.
+ Internally, however, disk space will not be immediatily released, as with all deletes in cassandra, this one
+ only marks the data as deleted.
+ The operation succeeds only if all hosts in the cluster at available and will throw an UnavailableException if
+ some hosts are down.
+
+ Parameters:
+ - cfname
+ """
+ pass
+
+ def add(key, column_parent, column, consistency_level):
+ """
+ Increment or decrement a counter.
+
+ Parameters:
+ - key
+ - column_parent
+ - column
+ - consistency_level
+ """
+ pass
+
+ def batch_add(update_map, consistency_level):
+ """
+ Batch increment or decrement a counter.
+
+ Parameters:
+ - update_map
+ - consistency_level
+ """
+ pass
+
+ def get_counter(key, path, consistency_level):
+ """
+ Return the counter at the specified column path.
+
+ Parameters:
+ - key
+ - path
+ - consistency_level
+ """
+ pass
+
+ def get_counter_slice(key, column_parent, predicate, consistency_level):
+ """
+ Get a list of counters from the specified columns.
+
+ Parameters:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ pass
+
+ def multiget_counter_slice(keys, column_parent, predicate, consistency_level):
+ """
+ Get counter slices from multiple keys.
+
+ Parameters:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ pass
+
+ def remove_counter(key, path, consistency_level):
+ """
+ Remove a counter at the specified location.
+
+ Parameters:
+ - key
+ - path
+ - consistency_level
+ """
+ pass
+
+ def describe_schema_versions():
+ """
+ for each schema version present in the cluster, returns a list of nodes at that version.
+ hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION.
+ the cluster is all on the same version if the size of the map is 1.
+ """
+ pass
+
+ def describe_keyspaces():
+ """
+ list the defined keyspaces in this cluster
+ """
+ pass
+
+ def describe_cluster_name():
+ """
+ get the cluster name
+ """
+ pass
+
+ def describe_version():
+ """
+ get the thrift api version
+ """
+ pass
+
+ def describe_ring(keyspace):
+ """
+ get the token ring: a map of ranges to host addresses,
+ represented as a set of TokenRange instead of a map from range
+ to list of endpoints, because you can't use Thrift structs as
+ map keys:
+ https://issues.apache.org/jira/browse/THRIFT-162
+
+ for the same reason, we can't return a set here, even though
+ order is neither important nor predictable.
+
+ Parameters:
+ - keyspace
+ """
+ pass
+
+ def describe_partitioner():
+ """
+ returns the partitioner used by this cluster
+ """
+ pass
+
+ def describe_snitch():
+ """
+ returns the snitch used by this cluster
+ """
+ pass
+
+ def describe_keyspace(keyspace):
+ """
+ describe specified keyspace
+
+ Parameters:
+ - keyspace
+ """
+ pass
+
+ def describe_splits(cfName, start_token, end_token, keys_per_split):
+ """
+ experimental API for hadoop/parallel query support.
+ may change violently and without warning.
+
+ returns list of token strings such that first subrange is (list[0], list[1]],
+ next is (list[1], list[2]], etc.
+
+ Parameters:
+ - cfName
+ - start_token
+ - end_token
+ - keys_per_split
+ """
+ pass
+
+ def system_add_column_family(cf_def):
+ """
+ adds a column family. returns the new schema id.
+
+ Parameters:
+ - cf_def
+ """
+ pass
+
+ def system_drop_column_family(column_family):
+ """
+ drops a column family. returns the new schema id.
+
+ Parameters:
+ - column_family
+ """
+ pass
+
+ def system_add_keyspace(ks_def):
+ """
+ adds a keyspace and any column families that are part of it. returns the new schema id.
+
+ Parameters:
+ - ks_def
+ """
+ pass
+
+ def system_drop_keyspace(keyspace):
+ """
+ drops a keyspace and any column families that are part of it. returns the new schema id.
+
+ Parameters:
+ - keyspace
+ """
+ pass
+
+ def system_update_keyspace(ks_def):
+ """
+ updates properties of a keyspace. returns the new schema id.
+
+ Parameters:
+ - ks_def
+ """
+ pass
+
+ def system_update_column_family(cf_def):
+ """
+ updates properties of a column family. returns the new schema id.
+
+ Parameters:
+ - cf_def
+ """
+ pass
+
+ def execute_cql_query(query, compression):
+ """
+ Executes a CQL (Cassandra Query Language) statement and returns a
+ CqlResult containing the results.
+
+ Parameters:
+ - query
+ - compression
+ """
+ pass
+
+
+class Client:
+ implements(Iface)
+
+ def __init__(self, transport, oprot_factory):
+ self._transport = transport
+ self._oprot_factory = oprot_factory
+ self._seqid = 0
+ self._reqs = {}
+
+ def login(self, auth_request):
+ """
+ Parameters:
+ - auth_request
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_login(auth_request)
+ return d
+
+ def send_login(self, auth_request):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('login', TMessageType.CALL, self._seqid)
+ args = login_args()
+ args.auth_request = auth_request
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_login(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = login_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.authnx != None:
+ return d.errback(result.authnx)
+ if result.authzx != None:
+ return d.errback(result.authzx)
+ return d.callback(None)
+
+ def set_keyspace(self, keyspace):
+ """
+ Parameters:
+ - keyspace
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_set_keyspace(keyspace)
+ return d
+
+ def send_set_keyspace(self, keyspace):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('set_keyspace', TMessageType.CALL, self._seqid)
+ args = set_keyspace_args()
+ args.keyspace = keyspace
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_set_keyspace(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = set_keyspace_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ return d.callback(None)
+
+ def get(self, key, column_path, consistency_level):
+ """
+ Get the Column or SuperColumn at the given column_path. If no value is present, NotFoundException is thrown. (This is
+ the only method that can throw an exception under non-failure conditions.)
+
+ Parameters:
+ - key
+ - column_path
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_get(key, column_path, consistency_level)
+ return d
+
+ def send_get(self, key, column_path, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('get', TMessageType.CALL, self._seqid)
+ args = get_args()
+ args.key = key
+ args.column_path = column_path
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_get(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = get_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.nfe != None:
+ return d.errback(result.nfe)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result"))
+
+ def get_slice(self, key, column_parent, predicate, consistency_level):
+ """
+ Get the group of columns contained by column_parent (either a ColumnFamily name or a ColumnFamily/SuperColumn name
+ pair) specified by the given SlicePredicate. If no matching values are found, an empty list is returned.
+
+ Parameters:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_get_slice(key, column_parent, predicate, consistency_level)
+ return d
+
+ def send_get_slice(self, key, column_parent, predicate, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('get_slice', TMessageType.CALL, self._seqid)
+ args = get_slice_args()
+ args.key = key
+ args.column_parent = column_parent
+ args.predicate = predicate
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_get_slice(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = get_slice_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_slice failed: unknown result"))
+
+ def get_count(self, key, column_parent, predicate, consistency_level):
+ """
+ returns the number of columns matching predicate for a particular key,
+ ColumnFamily and optionally SuperColumn.
+
+ Parameters:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_get_count(key, column_parent, predicate, consistency_level)
+ return d
+
+ def send_get_count(self, key, column_parent, predicate, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('get_count', TMessageType.CALL, self._seqid)
+ args = get_count_args()
+ args.key = key
+ args.column_parent = column_parent
+ args.predicate = predicate
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_get_count(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = get_count_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_count failed: unknown result"))
+
+ def multiget_slice(self, keys, column_parent, predicate, consistency_level):
+ """
+ Performs a get_slice for column_parent and predicate for the given keys in parallel.
+
+ Parameters:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_multiget_slice(keys, column_parent, predicate, consistency_level)
+ return d
+
+ def send_multiget_slice(self, keys, column_parent, predicate, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('multiget_slice', TMessageType.CALL, self._seqid)
+ args = multiget_slice_args()
+ args.keys = keys
+ args.column_parent = column_parent
+ args.predicate = predicate
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_multiget_slice(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = multiget_slice_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "multiget_slice failed: unknown result"))
+
+ def multiget_count(self, keys, column_parent, predicate, consistency_level):
+ """
+ Perform a get_count in parallel on the given list keys. The return value maps keys to the count found.
+
+ Parameters:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_multiget_count(keys, column_parent, predicate, consistency_level)
+ return d
+
+ def send_multiget_count(self, keys, column_parent, predicate, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('multiget_count', TMessageType.CALL, self._seqid)
+ args = multiget_count_args()
+ args.keys = keys
+ args.column_parent = column_parent
+ args.predicate = predicate
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_multiget_count(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = multiget_count_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "multiget_count failed: unknown result"))
+
+ def get_range_slices(self, column_parent, predicate, range, consistency_level):
+ """
+ returns a subset of columns for a contiguous range of keys.
+
+ Parameters:
+ - column_parent
+ - predicate
+ - range
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_get_range_slices(column_parent, predicate, range, consistency_level)
+ return d
+
+ def send_get_range_slices(self, column_parent, predicate, range, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('get_range_slices', TMessageType.CALL, self._seqid)
+ args = get_range_slices_args()
+ args.column_parent = column_parent
+ args.predicate = predicate
+ args.range = range
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_get_range_slices(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = get_range_slices_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_range_slices failed: unknown result"))
+
+ def get_indexed_slices(self, column_parent, index_clause, column_predicate, consistency_level):
+ """
+ Returns the subset of columns specified in SlicePredicate for the rows matching the IndexClause
+
+ Parameters:
+ - column_parent
+ - index_clause
+ - column_predicate
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_get_indexed_slices(column_parent, index_clause, column_predicate, consistency_level)
+ return d
+
+ def send_get_indexed_slices(self, column_parent, index_clause, column_predicate, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('get_indexed_slices', TMessageType.CALL, self._seqid)
+ args = get_indexed_slices_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.trans.flush()
+
+ def recv_get_indexed_slices(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = get_indexed_slices_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_indexed_slices failed: unknown result"))
+
+ def insert(self, key, column_parent, column, consistency_level):
+ """
+ Insert a Column at the given column_parent.column_family and optional column_parent.super_column.
+
+ Parameters:
+ - key
+ - column_parent
+ - column
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_insert(key, column_parent, column, consistency_level)
+ return d
+
+ def send_insert(self, key, column_parent, column, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('insert', TMessageType.CALL, self._seqid)
+ args = insert_args()
+ args.key = key
+ args.column_parent = column_parent
+ args.column = column
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_insert(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = insert_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.callback(None)
+
+ def remove(self, key, column_path, timestamp, consistency_level):
+ """
+ Remove data from the row specified by key at the granularity specified by column_path, and the given timestamp. Note
+ that all the values in column_path besides column_path.column_family are truly optional: you can remove the entire
+ row by just specifying the ColumnFamily, or you can remove a SuperColumn or a single Column by specifying those levels too.
+
+ Note that counters have limited support for deletes: if you remove
+ a counter, you must wait to issue any following update until the
+ delete has reached all the nodes and all of them have been fully
+ compacted.
+
+ Parameters:
+ - key
+ - column_path
+ - timestamp
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_remove(key, column_path, timestamp, consistency_level)
+ return d
+
+ def send_remove(self, key, column_path, timestamp, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('remove', TMessageType.CALL, self._seqid)
+ args = remove_args()
+ args.key = key
+ args.column_path = column_path
+ args.timestamp = timestamp
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_remove(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = remove_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.callback(None)
+
+ def batch_mutate(self, mutation_map, consistency_level):
+ """
+ Mutate many columns or super columns for many row keys. See also: Mutation.
+
+ mutation_map maps key to column family to a list of Mutation objects to take place at that scope.
+ *
+
+ Parameters:
+ - mutation_map
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_batch_mutate(mutation_map, consistency_level)
+ return d
+
+ def send_batch_mutate(self, mutation_map, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('batch_mutate', TMessageType.CALL, self._seqid)
+ args = batch_mutate_args()
+ args.mutation_map = mutation_map
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_batch_mutate(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = batch_mutate_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.callback(None)
+
+ def truncate(self, cfname):
+ """
+ Truncate will mark and entire column family as deleted.
+ From the user's perspective a successful call to truncate will result complete data deletion from cfname.
+ Internally, however, disk space will not be immediatily released, as with all deletes in cassandra, this one
+ only marks the data as deleted.
+ The operation succeeds only if all hosts in the cluster at available and will throw an UnavailableException if
+ some hosts are down.
+
+ Parameters:
+ - cfname
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_truncate(cfname)
+ return d
+
+ def send_truncate(self, cfname):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('truncate', TMessageType.CALL, self._seqid)
+ args = truncate_args()
+ args.cfname = cfname
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_truncate(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = truncate_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ return d.callback(None)
+
+ def add(self, key, column_parent, column, consistency_level):
+ """
+ Increment or decrement a counter.
+
+ Parameters:
+ - key
+ - column_parent
+ - column
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_add(key, column_parent, column, consistency_level)
+ return d
+
+ def send_add(self, key, column_parent, column, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('add', TMessageType.CALL, self._seqid)
+ args = add_args()
+ args.key = key
+ args.column_parent = column_parent
+ args.column = column
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_add(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = add_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.callback(None)
+
+ def batch_add(self, update_map, consistency_level):
+ """
+ Batch increment or decrement a counter.
+
+ Parameters:
+ - update_map
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_batch_add(update_map, consistency_level)
+ return d
+
+ def send_batch_add(self, update_map, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('batch_add', TMessageType.CALL, self._seqid)
+ args = batch_add_args()
+ args.update_map = update_map
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_batch_add(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = batch_add_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.callback(None)
+
+ def get_counter(self, key, path, consistency_level):
+ """
+ Return the counter at the specified column path.
+
+ Parameters:
+ - key
+ - path
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_get_counter(key, path, consistency_level)
+ return d
+
+ def send_get_counter(self, key, path, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('get_counter', TMessageType.CALL, self._seqid)
+ args = get_counter_args()
+ args.key = key
+ args.path = path
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_get_counter(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = get_counter_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.nfe != None:
+ return d.errback(result.nfe)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_counter failed: unknown result"))
+
+ def get_counter_slice(self, key, column_parent, predicate, consistency_level):
+ """
+ Get a list of counters from the specified columns.
+
+ Parameters:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_get_counter_slice(key, column_parent, predicate, consistency_level)
+ return d
+
+ def send_get_counter_slice(self, key, column_parent, predicate, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('get_counter_slice', TMessageType.CALL, self._seqid)
+ args = get_counter_slice_args()
+ args.key = key
+ args.column_parent = column_parent
+ args.predicate = predicate
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_get_counter_slice(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = get_counter_slice_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_counter_slice failed: unknown result"))
+
+ def multiget_counter_slice(self, keys, column_parent, predicate, consistency_level):
+ """
+ Get counter slices from multiple keys.
+
+ Parameters:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_multiget_counter_slice(keys, column_parent, predicate, consistency_level)
+ return d
+
+ def send_multiget_counter_slice(self, keys, column_parent, predicate, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('multiget_counter_slice', TMessageType.CALL, self._seqid)
+ args = multiget_counter_slice_args()
+ args.keys = keys
+ args.column_parent = column_parent
+ args.predicate = predicate
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_multiget_counter_slice(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = multiget_counter_slice_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "multiget_counter_slice failed: unknown result"))
+
+ def remove_counter(self, key, path, consistency_level):
+ """
+ Remove a counter at the specified location.
+
+ Parameters:
+ - key
+ - path
+ - consistency_level
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_remove_counter(key, path, consistency_level)
+ return d
+
+ def send_remove_counter(self, key, path, consistency_level):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('remove_counter', TMessageType.CALL, self._seqid)
+ args = remove_counter_args()
+ args.key = key
+ args.path = path
+ args.consistency_level = consistency_level
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_remove_counter(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = remove_counter_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ return d.callback(None)
+
+ def describe_schema_versions(self, ):
+ """
+ for each schema version present in the cluster, returns a list of nodes at that version.
+ hosts that do not respond will be under the key DatabaseDescriptor.INITIAL_VERSION.
+ the cluster is all on the same version if the size of the map is 1.
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_schema_versions()
+ return d
+
+ def send_describe_schema_versions(self, ):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_schema_versions', TMessageType.CALL, self._seqid)
+ args = describe_schema_versions_args()
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_schema_versions(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_schema_versions_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_schema_versions failed: unknown result"))
+
+ def describe_keyspaces(self, ):
+ """
+ list the defined keyspaces in this cluster
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_keyspaces()
+ return d
+
+ def send_describe_keyspaces(self, ):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_keyspaces', TMessageType.CALL, self._seqid)
+ args = describe_keyspaces_args()
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_keyspaces(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_keyspaces_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspaces failed: unknown result"))
+
+ def describe_cluster_name(self, ):
+ """
+ get the cluster name
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_cluster_name()
+ return d
+
+ def send_describe_cluster_name(self, ):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_cluster_name', TMessageType.CALL, self._seqid)
+ args = describe_cluster_name_args()
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_cluster_name(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_cluster_name_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_cluster_name failed: unknown result"))
+
+ def describe_version(self, ):
+ """
+ get the thrift api version
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_version()
+ return d
+
+ def send_describe_version(self, ):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_version', TMessageType.CALL, self._seqid)
+ args = describe_version_args()
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_version(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_version_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_version failed: unknown result"))
+
+ def describe_ring(self, keyspace):
+ """
+ get the token ring: a map of ranges to host addresses,
+ represented as a set of TokenRange instead of a map from range
+ to list of endpoints, because you can't use Thrift structs as
+ map keys:
+ https://issues.apache.org/jira/browse/THRIFT-162
+
+ for the same reason, we can't return a set here, even though
+ order is neither important nor predictable.
+
+ Parameters:
+ - keyspace
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_ring(keyspace)
+ return d
+
+ def send_describe_ring(self, keyspace):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_ring', TMessageType.CALL, self._seqid)
+ args = describe_ring_args()
+ args.keyspace = keyspace
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_ring(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_ring_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_ring failed: unknown result"))
+
+ def describe_partitioner(self, ):
+ """
+ returns the partitioner used by this cluster
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_partitioner()
+ return d
+
+ def send_describe_partitioner(self, ):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_partitioner', TMessageType.CALL, self._seqid)
+ args = describe_partitioner_args()
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_partitioner(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_partitioner_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_partitioner failed: unknown result"))
+
+ def describe_snitch(self, ):
+ """
+ returns the snitch used by this cluster
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_snitch()
+ return d
+
+ def send_describe_snitch(self, ):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_snitch', TMessageType.CALL, self._seqid)
+ args = describe_snitch_args()
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_snitch(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_snitch_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_snitch failed: unknown result"))
+
+ def describe_keyspace(self, keyspace):
+ """
+ describe specified keyspace
+
+ Parameters:
+ - keyspace
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_keyspace(keyspace)
+ return d
+
+ def send_describe_keyspace(self, keyspace):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_keyspace', TMessageType.CALL, self._seqid)
+ args = describe_keyspace_args()
+ args.keyspace = keyspace
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_describe_keyspace(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_keyspace_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.nfe != None:
+ return d.errback(result.nfe)
+ if result.ire != None:
+ return d.errback(result.ire)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_keyspace failed: unknown result"))
+
+ def describe_splits(self, cfName, start_token, end_token, keys_per_split):
+ """
+ experimental API for hadoop/parallel query support.
+ may change violently and without warning.
+
+ returns list of token strings such that first subrange is (list[0], list[1]],
+ next is (list[1], list[2]], etc.
+
+ Parameters:
+ - cfName
+ - start_token
+ - end_token
+ - keys_per_split
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_describe_splits(cfName, start_token, end_token, keys_per_split)
+ return d
+
+ def send_describe_splits(self, cfName, start_token, end_token, keys_per_split):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('describe_splits', TMessageType.CALL, self._seqid)
+ args = describe_splits_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.trans.flush()
+
+ def recv_describe_splits(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = describe_splits_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "describe_splits failed: unknown result"))
+
+ def system_add_column_family(self, cf_def):
+ """
+ adds a column family. returns the new schema id.
+
+ Parameters:
+ - cf_def
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_system_add_column_family(cf_def)
+ return d
+
+ def send_system_add_column_family(self, cf_def):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('system_add_column_family', TMessageType.CALL, self._seqid)
+ args = system_add_column_family_args()
+ args.cf_def = cf_def
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_system_add_column_family(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = system_add_column_family_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.sde != None:
+ return d.errback(result.sde)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "system_add_column_family failed: unknown result"))
+
+ def system_drop_column_family(self, column_family):
+ """
+ drops a column family. returns the new schema id.
+
+ Parameters:
+ - column_family
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_system_drop_column_family(column_family)
+ return d
+
+ def send_system_drop_column_family(self, column_family):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('system_drop_column_family', TMessageType.CALL, self._seqid)
+ args = system_drop_column_family_args()
+ args.column_family = column_family
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_system_drop_column_family(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = system_drop_column_family_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.sde != None:
+ return d.errback(result.sde)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "system_drop_column_family failed: unknown result"))
+
+ def system_add_keyspace(self, ks_def):
+ """
+ adds a keyspace and any column families that are part of it. returns the new schema id.
+
+ Parameters:
+ - ks_def
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_system_add_keyspace(ks_def)
+ return d
+
+ def send_system_add_keyspace(self, ks_def):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('system_add_keyspace', TMessageType.CALL, self._seqid)
+ args = system_add_keyspace_args()
+ args.ks_def = ks_def
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_system_add_keyspace(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = system_add_keyspace_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.sde != None:
+ return d.errback(result.sde)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "system_add_keyspace failed: unknown result"))
+
+ def system_drop_keyspace(self, keyspace):
+ """
+ drops a keyspace and any column families that are part of it. returns the new schema id.
+
+ Parameters:
+ - keyspace
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_system_drop_keyspace(keyspace)
+ return d
+
+ def send_system_drop_keyspace(self, keyspace):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('system_drop_keyspace', TMessageType.CALL, self._seqid)
+ args = system_drop_keyspace_args()
+ args.keyspace = keyspace
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_system_drop_keyspace(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = system_drop_keyspace_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.sde != None:
+ return d.errback(result.sde)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "system_drop_keyspace failed: unknown result"))
+
+ def system_update_keyspace(self, ks_def):
+ """
+ updates properties of a keyspace. returns the new schema id.
+
+ Parameters:
+ - ks_def
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_system_update_keyspace(ks_def)
+ return d
+
+ def send_system_update_keyspace(self, ks_def):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('system_update_keyspace', TMessageType.CALL, self._seqid)
+ args = system_update_keyspace_args()
+ args.ks_def = ks_def
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_system_update_keyspace(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = system_update_keyspace_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.sde != None:
+ return d.errback(result.sde)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "system_update_keyspace failed: unknown result"))
+
+ def system_update_column_family(self, cf_def):
+ """
+ updates properties of a column family. returns the new schema id.
+
+ Parameters:
+ - cf_def
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_system_update_column_family(cf_def)
+ return d
+
+ def send_system_update_column_family(self, cf_def):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('system_update_column_family', TMessageType.CALL, self._seqid)
+ args = system_update_column_family_args()
+ args.cf_def = cf_def
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_system_update_column_family(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = system_update_column_family_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.sde != None:
+ return d.errback(result.sde)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "system_update_column_family failed: unknown result"))
+
+ def execute_cql_query(self, query, compression):
+ """
+ Executes a CQL (Cassandra Query Language) statement and returns a
+ CqlResult containing the results.
+
+ Parameters:
+ - query
+ - compression
+ """
+ self._seqid += 1
+ d = self._reqs[self._seqid] = defer.Deferred()
+ self.send_execute_cql_query(query, compression)
+ return d
+
+ def send_execute_cql_query(self, query, compression):
+ oprot = self._oprot_factory.getProtocol(self._transport)
+ oprot.writeMessageBegin('execute_cql_query', TMessageType.CALL, self._seqid)
+ args = execute_cql_query_args()
+ args.query = query
+ args.compression = compression
+ args.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def recv_execute_cql_query(self, iprot, mtype, rseqid):
+ d = self._reqs.pop(rseqid)
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ return d.errback(x)
+ result = execute_cql_query_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success != None:
+ return d.callback(result.success)
+ if result.ire != None:
+ return d.errback(result.ire)
+ if result.ue != None:
+ return d.errback(result.ue)
+ if result.te != None:
+ return d.errback(result.te)
+ if result.sde != None:
+ return d.errback(result.sde)
+ return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "execute_cql_query failed: unknown result"))
+
+
+class Processor(TProcessor):
+ implements(Iface)
+
+ def __init__(self, handler):
+ self._handler = Iface(handler)
+ self._processMap = {}
+ self._processMap["login"] = Processor.process_login
+ self._processMap["set_keyspace"] = Processor.process_set_keyspace
+ self._processMap["get"] = Processor.process_get
+ self._processMap["get_slice"] = Processor.process_get_slice
+ self._processMap["get_count"] = Processor.process_get_count
+ self._processMap["multiget_slice"] = Processor.process_multiget_slice
+ self._processMap["multiget_count"] = Processor.process_multiget_count
+ self._processMap["get_range_slices"] = Processor.process_get_range_slices
+ self._processMap["get_indexed_slices"] = Processor.process_get_indexed_slices
+ self._processMap["insert"] = Processor.process_insert
+ self._processMap["remove"] = Processor.process_remove
+ self._processMap["batch_mutate"] = Processor.process_batch_mutate
+ self._processMap["truncate"] = Processor.process_truncate
+ self._processMap["add"] = Processor.process_add
+ self._processMap["batch_add"] = Processor.process_batch_add
+ self._processMap["get_counter"] = Processor.process_get_counter
+ self._processMap["get_counter_slice"] = Processor.process_get_counter_slice
+ self._processMap["multiget_counter_slice"] = Processor.process_multiget_counter_slice
+ self._processMap["remove_counter"] = Processor.process_remove_counter
+ self._processMap["describe_schema_versions"] = Processor.process_describe_schema_versions
+ self._processMap["describe_keyspaces"] = Processor.process_describe_keyspaces
+ self._processMap["describe_cluster_name"] = Processor.process_describe_cluster_name
+ self._processMap["describe_version"] = Processor.process_describe_version
+ self._processMap["describe_ring"] = Processor.process_describe_ring
+ self._processMap["describe_partitioner"] = Processor.process_describe_partitioner
+ self._processMap["describe_snitch"] = Processor.process_describe_snitch
+ self._processMap["describe_keyspace"] = Processor.process_describe_keyspace
+ self._processMap["describe_splits"] = Processor.process_describe_splits
+ self._processMap["system_add_column_family"] = Processor.process_system_add_column_family
+ self._processMap["system_drop_column_family"] = Processor.process_system_drop_column_family
+ self._processMap["system_add_keyspace"] = Processor.process_system_add_keyspace
+ self._processMap["system_drop_keyspace"] = Processor.process_system_drop_keyspace
+ self._processMap["system_update_keyspace"] = Processor.process_system_update_keyspace
+ self._processMap["system_update_column_family"] = Processor.process_system_update_column_family
+ self._processMap["execute_cql_query"] = Processor.process_execute_cql_query
+
+ def process(self, iprot, oprot):
+ (name, type, seqid) = iprot.readMessageBegin()
+ if name not in self._processMap:
+ iprot.skip(TType.STRUCT)
+ iprot.readMessageEnd()
+ x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name))
+ oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)
+ x.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+ return defer.succeed(None)
+ else:
+ return self._processMap[name](self, seqid, iprot, oprot)
+
+ def process_login(self, seqid, iprot, oprot):
+ args = login_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = login_result()
+ d = defer.maybeDeferred(self._handler.login, args.auth_request)
+ d.addCallback(self.write_results_success_login, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_login, result, seqid, oprot)
+ return d
+
+ def write_results_success_login(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("login", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_login(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except AuthenticationException, authnx:
+ result.authnx = authnx
+ except AuthorizationException, authzx:
+ result.authzx = authzx
+ oprot.writeMessageBegin("login", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_set_keyspace(self, seqid, iprot, oprot):
+ args = set_keyspace_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = set_keyspace_result()
+ d = defer.maybeDeferred(self._handler.set_keyspace, args.keyspace)
+ d.addCallback(self.write_results_success_set_keyspace, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_set_keyspace, result, seqid, oprot)
+ return d
+
+ def write_results_success_set_keyspace(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("set_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_set_keyspace(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ oprot.writeMessageBegin("set_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get(self, seqid, iprot, oprot):
+ args = get_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_result()
+ d = defer.maybeDeferred(self._handler.get, args.key, args.column_path, args.consistency_level)
+ d.addCallback(self.write_results_success_get, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_get, result, seqid, oprot)
+ return d
+
+ def write_results_success_get(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("get", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_get(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except NotFoundException, nfe:
+ result.nfe = nfe
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("get", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_slice(self, seqid, iprot, oprot):
+ args = get_slice_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_slice_result()
+ d = defer.maybeDeferred(self._handler.get_slice, args.key, args.column_parent, args.predicate, args.consistency_level)
+ d.addCallback(self.write_results_success_get_slice, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_get_slice, result, seqid, oprot)
+ return d
+
+ def write_results_success_get_slice(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("get_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_get_slice(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("get_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_count(self, seqid, iprot, oprot):
+ args = get_count_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_count_result()
+ d = defer.maybeDeferred(self._handler.get_count, args.key, args.column_parent, args.predicate, args.consistency_level)
+ d.addCallback(self.write_results_success_get_count, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_get_count, result, seqid, oprot)
+ return d
+
+ def write_results_success_get_count(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("get_count", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_get_count(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("get_count", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_multiget_slice(self, seqid, iprot, oprot):
+ args = multiget_slice_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = multiget_slice_result()
+ d = defer.maybeDeferred(self._handler.multiget_slice, args.keys, args.column_parent, args.predicate, args.consistency_level)
+ d.addCallback(self.write_results_success_multiget_slice, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_multiget_slice, result, seqid, oprot)
+ return d
+
+ def write_results_success_multiget_slice(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("multiget_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_multiget_slice(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("multiget_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_multiget_count(self, seqid, iprot, oprot):
+ args = multiget_count_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = multiget_count_result()
+ d = defer.maybeDeferred(self._handler.multiget_count, args.keys, args.column_parent, args.predicate, args.consistency_level)
+ d.addCallback(self.write_results_success_multiget_count, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_multiget_count, result, seqid, oprot)
+ return d
+
+ def write_results_success_multiget_count(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("multiget_count", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_multiget_count(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("multiget_count", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_range_slices(self, seqid, iprot, oprot):
+ args = get_range_slices_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_range_slices_result()
+ d = defer.maybeDeferred(self._handler.get_range_slices, args.column_parent, args.predicate, args.range, args.consistency_level)
+ d.addCallback(self.write_results_success_get_range_slices, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_get_range_slices, result, seqid, oprot)
+ return d
+
+ def write_results_success_get_range_slices(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("get_range_slices", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_get_range_slices(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("get_range_slices", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_indexed_slices(self, seqid, iprot, oprot):
+ args = get_indexed_slices_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_indexed_slices_result()
+ d = defer.maybeDeferred(self._handler.get_indexed_slices, args.column_parent, args.index_clause, args.column_predicate, args.consistency_level)
+ d.addCallback(self.write_results_success_get_indexed_slices, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_get_indexed_slices, result, seqid, oprot)
+ return d
+
+ def write_results_success_get_indexed_slices(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("get_indexed_slices", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_get_indexed_slices(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("get_indexed_slices", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_insert(self, seqid, iprot, oprot):
+ args = insert_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = insert_result()
+ d = defer.maybeDeferred(self._handler.insert, args.key, args.column_parent, args.column, args.consistency_level)
+ d.addCallback(self.write_results_success_insert, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_insert, result, seqid, oprot)
+ return d
+
+ def write_results_success_insert(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("insert", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_insert(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("insert", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_remove(self, seqid, iprot, oprot):
+ args = remove_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = remove_result()
+ d = defer.maybeDeferred(self._handler.remove, args.key, args.column_path, args.timestamp, args.consistency_level)
+ d.addCallback(self.write_results_success_remove, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_remove, result, seqid, oprot)
+ return d
+
+ def write_results_success_remove(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("remove", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_remove(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("remove", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_batch_mutate(self, seqid, iprot, oprot):
+ args = batch_mutate_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = batch_mutate_result()
+ d = defer.maybeDeferred(self._handler.batch_mutate, args.mutation_map, args.consistency_level)
+ d.addCallback(self.write_results_success_batch_mutate, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_batch_mutate, result, seqid, oprot)
+ return d
+
+ def write_results_success_batch_mutate(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("batch_mutate", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_batch_mutate(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("batch_mutate", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_truncate(self, seqid, iprot, oprot):
+ args = truncate_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = truncate_result()
+ d = defer.maybeDeferred(self._handler.truncate, args.cfname)
+ d.addCallback(self.write_results_success_truncate, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_truncate, result, seqid, oprot)
+ return d
+
+ def write_results_success_truncate(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("truncate", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_truncate(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ oprot.writeMessageBegin("truncate", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_add(self, seqid, iprot, oprot):
+ args = add_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = add_result()
+ d = defer.maybeDeferred(self._handler.add, args.key, args.column_parent, args.column, args.consistency_level)
+ d.addCallback(self.write_results_success_add, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_add, result, seqid, oprot)
+ return d
+
+ def write_results_success_add(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("add", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_add(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("add", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_batch_add(self, seqid, iprot, oprot):
+ args = batch_add_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = batch_add_result()
+ d = defer.maybeDeferred(self._handler.batch_add, args.update_map, args.consistency_level)
+ d.addCallback(self.write_results_success_batch_add, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_batch_add, result, seqid, oprot)
+ return d
+
+ def write_results_success_batch_add(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("batch_add", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_batch_add(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("batch_add", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_counter(self, seqid, iprot, oprot):
+ args = get_counter_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_counter_result()
+ d = defer.maybeDeferred(self._handler.get_counter, args.key, args.path, args.consistency_level)
+ d.addCallback(self.write_results_success_get_counter, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_get_counter, result, seqid, oprot)
+ return d
+
+ def write_results_success_get_counter(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("get_counter", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_get_counter(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except NotFoundException, nfe:
+ result.nfe = nfe
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("get_counter", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_get_counter_slice(self, seqid, iprot, oprot):
+ args = get_counter_slice_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = get_counter_slice_result()
+ d = defer.maybeDeferred(self._handler.get_counter_slice, args.key, args.column_parent, args.predicate, args.consistency_level)
+ d.addCallback(self.write_results_success_get_counter_slice, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_get_counter_slice, result, seqid, oprot)
+ return d
+
+ def write_results_success_get_counter_slice(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("get_counter_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_get_counter_slice(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("get_counter_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_multiget_counter_slice(self, seqid, iprot, oprot):
+ args = multiget_counter_slice_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = multiget_counter_slice_result()
+ d = defer.maybeDeferred(self._handler.multiget_counter_slice, args.keys, args.column_parent, args.predicate, args.consistency_level)
+ d.addCallback(self.write_results_success_multiget_counter_slice, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_multiget_counter_slice, result, seqid, oprot)
+ return d
+
+ def write_results_success_multiget_counter_slice(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("multiget_counter_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_multiget_counter_slice(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("multiget_counter_slice", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_remove_counter(self, seqid, iprot, oprot):
+ args = remove_counter_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = remove_counter_result()
+ d = defer.maybeDeferred(self._handler.remove_counter, args.key, args.path, args.consistency_level)
+ d.addCallback(self.write_results_success_remove_counter, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_remove_counter, result, seqid, oprot)
+ return d
+
+ def write_results_success_remove_counter(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("remove_counter", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_remove_counter(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ oprot.writeMessageBegin("remove_counter", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_schema_versions(self, seqid, iprot, oprot):
+ args = describe_schema_versions_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_schema_versions_result()
+ d = defer.maybeDeferred(self._handler.describe_schema_versions, )
+ d.addCallback(self.write_results_success_describe_schema_versions, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_describe_schema_versions, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_schema_versions(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_schema_versions", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_describe_schema_versions(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ oprot.writeMessageBegin("describe_schema_versions", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_keyspaces(self, seqid, iprot, oprot):
+ args = describe_keyspaces_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_keyspaces_result()
+ d = defer.maybeDeferred(self._handler.describe_keyspaces, )
+ d.addCallback(self.write_results_success_describe_keyspaces, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_describe_keyspaces, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_keyspaces(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_keyspaces", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_describe_keyspaces(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ oprot.writeMessageBegin("describe_keyspaces", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_cluster_name(self, seqid, iprot, oprot):
+ args = describe_cluster_name_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_cluster_name_result()
+ d = defer.maybeDeferred(self._handler.describe_cluster_name, )
+ d.addCallback(self.write_results_success_describe_cluster_name, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_cluster_name(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_cluster_name", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_version(self, seqid, iprot, oprot):
+ args = describe_version_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_version_result()
+ d = defer.maybeDeferred(self._handler.describe_version, )
+ d.addCallback(self.write_results_success_describe_version, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_version(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_version", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_ring(self, seqid, iprot, oprot):
+ args = describe_ring_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_ring_result()
+ d = defer.maybeDeferred(self._handler.describe_ring, args.keyspace)
+ d.addCallback(self.write_results_success_describe_ring, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_describe_ring, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_ring(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_ring", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_describe_ring(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ oprot.writeMessageBegin("describe_ring", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_partitioner(self, seqid, iprot, oprot):
+ args = describe_partitioner_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_partitioner_result()
+ d = defer.maybeDeferred(self._handler.describe_partitioner, )
+ d.addCallback(self.write_results_success_describe_partitioner, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_partitioner(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_partitioner", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_snitch(self, seqid, iprot, oprot):
+ args = describe_snitch_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_snitch_result()
+ d = defer.maybeDeferred(self._handler.describe_snitch, )
+ d.addCallback(self.write_results_success_describe_snitch, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_snitch(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_snitch", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_keyspace(self, seqid, iprot, oprot):
+ args = describe_keyspace_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_keyspace_result()
+ d = defer.maybeDeferred(self._handler.describe_keyspace, args.keyspace)
+ d.addCallback(self.write_results_success_describe_keyspace, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_describe_keyspace, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_keyspace(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_describe_keyspace(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except NotFoundException, nfe:
+ result.nfe = nfe
+ except InvalidRequestException, ire:
+ result.ire = ire
+ oprot.writeMessageBegin("describe_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_describe_splits(self, seqid, iprot, oprot):
+ args = describe_splits_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = describe_splits_result()
+ d = defer.maybeDeferred(self._handler.describe_splits, args.cfName, args.start_token, args.end_token, args.keys_per_split)
+ d.addCallback(self.write_results_success_describe_splits, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_describe_splits, result, seqid, oprot)
+ return d
+
+ def write_results_success_describe_splits(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("describe_splits", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_describe_splits(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ oprot.writeMessageBegin("describe_splits", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_system_add_column_family(self, seqid, iprot, oprot):
+ args = system_add_column_family_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = system_add_column_family_result()
+ d = defer.maybeDeferred(self._handler.system_add_column_family, args.cf_def)
+ d.addCallback(self.write_results_success_system_add_column_family, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_system_add_column_family, result, seqid, oprot)
+ return d
+
+ def write_results_success_system_add_column_family(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("system_add_column_family", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_system_add_column_family(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except SchemaDisagreementException, sde:
+ result.sde = sde
+ oprot.writeMessageBegin("system_add_column_family", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_system_drop_column_family(self, seqid, iprot, oprot):
+ args = system_drop_column_family_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = system_drop_column_family_result()
+ d = defer.maybeDeferred(self._handler.system_drop_column_family, args.column_family)
+ d.addCallback(self.write_results_success_system_drop_column_family, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_system_drop_column_family, result, seqid, oprot)
+ return d
+
+ def write_results_success_system_drop_column_family(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("system_drop_column_family", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_system_drop_column_family(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except SchemaDisagreementException, sde:
+ result.sde = sde
+ oprot.writeMessageBegin("system_drop_column_family", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_system_add_keyspace(self, seqid, iprot, oprot):
+ args = system_add_keyspace_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = system_add_keyspace_result()
+ d = defer.maybeDeferred(self._handler.system_add_keyspace, args.ks_def)
+ d.addCallback(self.write_results_success_system_add_keyspace, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_system_add_keyspace, result, seqid, oprot)
+ return d
+
+ def write_results_success_system_add_keyspace(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("system_add_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_system_add_keyspace(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except SchemaDisagreementException, sde:
+ result.sde = sde
+ oprot.writeMessageBegin("system_add_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_system_drop_keyspace(self, seqid, iprot, oprot):
+ args = system_drop_keyspace_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = system_drop_keyspace_result()
+ d = defer.maybeDeferred(self._handler.system_drop_keyspace, args.keyspace)
+ d.addCallback(self.write_results_success_system_drop_keyspace, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_system_drop_keyspace, result, seqid, oprot)
+ return d
+
+ def write_results_success_system_drop_keyspace(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("system_drop_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_system_drop_keyspace(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except SchemaDisagreementException, sde:
+ result.sde = sde
+ oprot.writeMessageBegin("system_drop_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_system_update_keyspace(self, seqid, iprot, oprot):
+ args = system_update_keyspace_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = system_update_keyspace_result()
+ d = defer.maybeDeferred(self._handler.system_update_keyspace, args.ks_def)
+ d.addCallback(self.write_results_success_system_update_keyspace, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_system_update_keyspace, result, seqid, oprot)
+ return d
+
+ def write_results_success_system_update_keyspace(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("system_update_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_system_update_keyspace(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except SchemaDisagreementException, sde:
+ result.sde = sde
+ oprot.writeMessageBegin("system_update_keyspace", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_system_update_column_family(self, seqid, iprot, oprot):
+ args = system_update_column_family_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = system_update_column_family_result()
+ d = defer.maybeDeferred(self._handler.system_update_column_family, args.cf_def)
+ d.addCallback(self.write_results_success_system_update_column_family, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_system_update_column_family, result, seqid, oprot)
+ return d
+
+ def write_results_success_system_update_column_family(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("system_update_column_family", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_system_update_column_family(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except SchemaDisagreementException, sde:
+ result.sde = sde
+ oprot.writeMessageBegin("system_update_column_family", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_execute_cql_query(self, seqid, iprot, oprot):
+ args = execute_cql_query_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = execute_cql_query_result()
+ d = defer.maybeDeferred(self._handler.execute_cql_query, args.query, args.compression)
+ d.addCallback(self.write_results_success_execute_cql_query, result, seqid, oprot)
+ d.addErrback(self.write_results_exception_execute_cql_query, result, seqid, oprot)
+ return d
+
+ def write_results_success_execute_cql_query(self, success, result, seqid, oprot):
+ result.success = success
+ oprot.writeMessageBegin("execute_cql_query", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def write_results_exception_execute_cql_query(self, error, result, seqid, oprot):
+ try:
+ error.raiseException()
+ except InvalidRequestException, ire:
+ result.ire = ire
+ except UnavailableException, ue:
+ result.ue = ue
+ except TimedOutException, te:
+ result.te = te
+ except SchemaDisagreementException, sde:
+ result.sde = sde
+ oprot.writeMessageBegin("execute_cql_query", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+
+# HELPER FUNCTIONS AND STRUCTURES
+
+class login_args:
+ """
+ Attributes:
+ - auth_request
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'auth_request', (AuthenticationRequest, AuthenticationRequest.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, auth_request=None,):
+ self.auth_request = auth_request
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.auth_request = AuthenticationRequest()
+ self.auth_request.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('login_args')
+ if self.auth_request != None:
+ oprot.writeFieldBegin('auth_request', TType.STRUCT, 1)
+ self.auth_request.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.auth_request is None:
+ raise TProtocol.TProtocolException(message='Required field auth_request is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class login_result:
+ """
+ Attributes:
+ - authnx
+ - authzx
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'authnx', (AuthenticationException, AuthenticationException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'authzx', (AuthorizationException, AuthorizationException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, authnx=None, authzx=None,):
+ self.authnx = authnx
+ self.authzx = authzx
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.authnx = AuthenticationException()
+ self.authnx.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.authzx = AuthorizationException()
+ self.authzx.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('login_result')
+ if self.authnx != None:
+ oprot.writeFieldBegin('authnx', TType.STRUCT, 1)
+ self.authnx.write(oprot)
+ oprot.writeFieldEnd()
+ if self.authzx != None:
+ oprot.writeFieldBegin('authzx', TType.STRUCT, 2)
+ self.authzx.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class set_keyspace_args:
+ """
+ Attributes:
+ - keyspace
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'keyspace', None, None, ), # 1
+ )
+
+ def __init__(self, keyspace=None,):
+ self.keyspace = keyspace
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.keyspace = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('set_keyspace_args')
+ if self.keyspace != None:
+ oprot.writeFieldBegin('keyspace', TType.STRING, 1)
+ oprot.writeString(self.keyspace)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keyspace is None:
+ raise TProtocol.TProtocolException(message='Required field keyspace is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class set_keyspace_result:
+ """
+ Attributes:
+ - ire
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, ire=None,):
+ self.ire = ire
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('set_keyspace_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_args:
+ """
+ Attributes:
+ - key
+ - column_path
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'column_path', (ColumnPath, ColumnPath.thrift_spec), None, ), # 2
+ (3, TType.I32, 'consistency_level', None, 1, ), # 3
+ )
+
+ def __init__(self, key=None, column_path=None, consistency_level=thrift_spec[3][4],):
+ self.key = key
+ self.column_path = column_path
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_path = ColumnPath()
+ self.column_path.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.column_path != None:
+ oprot.writeFieldBegin('column_path', TType.STRUCT, 2)
+ self.column_path.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 3)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.column_path is None:
+ raise TProtocol.TProtocolException(message='Required field column_path is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - nfe
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (ColumnOrSuperColumn, ColumnOrSuperColumn.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'nfe', (NotFoundException, NotFoundException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 3
+ (4, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 4
+ )
+
+ def __init__(self, success=None, ire=None, nfe=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.nfe = nfe
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = ColumnOrSuperColumn()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.nfe = NotFoundException()
+ self.nfe.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.nfe != None:
+ oprot.writeFieldBegin('nfe', TType.STRUCT, 2)
+ self.nfe.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 3)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 4)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_slice_args:
+ """
+ Attributes:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, key=None, column_parent=None, predicate=None, consistency_level=thrift_spec[4][4],):
+ self.key = key
+ self.column_parent = column_parent
+ self.predicate = predicate
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_slice_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.predicate is None:
+ raise TProtocol.TProtocolException(message='Required field predicate is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_slice_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.STRUCT,(ColumnOrSuperColumn, ColumnOrSuperColumn.thrift_spec)), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype91, _size88) = iprot.readListBegin()
+ for _i92 in xrange(_size88):
+ _elem93 = ColumnOrSuperColumn()
+ _elem93.read(iprot)
+ self.success.append(_elem93)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_slice_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.STRUCT, len(self.success))
+ for iter94 in self.success:
+ iter94.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_count_args:
+ """
+ Attributes:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, key=None, column_parent=None, predicate=None, consistency_level=thrift_spec[4][4],):
+ self.key = key
+ self.column_parent = column_parent
+ self.predicate = predicate
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_count_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.predicate is None:
+ raise TProtocol.TProtocolException(message='Required field predicate is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_count_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.I32, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.I32:
+ self.success = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_count_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.I32, 0)
+ oprot.writeI32(self.success)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class multiget_slice_args:
+ """
+ Attributes:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'keys', (TType.STRING,None), None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, keys=None, column_parent=None, predicate=None, consistency_level=thrift_spec[4][4],):
+ self.keys = keys
+ self.column_parent = column_parent
+ self.predicate = predicate
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.keys = []
+ (_etype98, _size95) = iprot.readListBegin()
+ for _i99 in xrange(_size95):
+ _elem100 = iprot.readString();
+ self.keys.append(_elem100)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('multiget_slice_args')
+ if self.keys != None:
+ oprot.writeFieldBegin('keys', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRING, len(self.keys))
+ for iter101 in self.keys:
+ oprot.writeString(iter101)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keys is None:
+ raise TProtocol.TProtocolException(message='Required field keys is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.predicate is None:
+ raise TProtocol.TProtocolException(message='Required field predicate is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class multiget_slice_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRUCT,(ColumnOrSuperColumn, ColumnOrSuperColumn.thrift_spec))), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.MAP:
+ self.success = {}
+ (_ktype103, _vtype104, _size102 ) = iprot.readMapBegin()
+ for _i106 in xrange(_size102):
+ _key107 = iprot.readString();
+ _val108 = []
+ (_etype112, _size109) = iprot.readListBegin()
+ for _i113 in xrange(_size109):
+ _elem114 = ColumnOrSuperColumn()
+ _elem114.read(iprot)
+ _val108.append(_elem114)
+ iprot.readListEnd()
+ self.success[_key107] = _val108
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('multiget_slice_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.MAP, 0)
+ oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.success))
+ for kiter115,viter116 in self.success.items():
+ oprot.writeString(kiter115)
+ oprot.writeListBegin(TType.STRUCT, len(viter116))
+ for iter117 in viter116:
+ iter117.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class multiget_count_args:
+ """
+ Attributes:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'keys', (TType.STRING,None), None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, keys=None, column_parent=None, predicate=None, consistency_level=thrift_spec[4][4],):
+ self.keys = keys
+ self.column_parent = column_parent
+ self.predicate = predicate
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.keys = []
+ (_etype121, _size118) = iprot.readListBegin()
+ for _i122 in xrange(_size118):
+ _elem123 = iprot.readString();
+ self.keys.append(_elem123)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('multiget_count_args')
+ if self.keys != None:
+ oprot.writeFieldBegin('keys', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRING, len(self.keys))
+ for iter124 in self.keys:
+ oprot.writeString(iter124)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keys is None:
+ raise TProtocol.TProtocolException(message='Required field keys is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.predicate is None:
+ raise TProtocol.TProtocolException(message='Required field predicate is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class multiget_count_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.MAP, 'success', (TType.STRING,None,TType.I32,None), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.MAP:
+ self.success = {}
+ (_ktype126, _vtype127, _size125 ) = iprot.readMapBegin()
+ for _i129 in xrange(_size125):
+ _key130 = iprot.readString();
+ _val131 = iprot.readI32();
+ self.success[_key130] = _val131
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('multiget_count_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.MAP, 0)
+ oprot.writeMapBegin(TType.STRING, TType.I32, len(self.success))
+ for kiter132,viter133 in self.success.items():
+ oprot.writeString(kiter132)
+ oprot.writeI32(viter133)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_range_slices_args:
+ """
+ Attributes:
+ - column_parent
+ - predicate
+ - range
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'range', (KeyRange, KeyRange.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, column_parent=None, predicate=None, range=None, consistency_level=thrift_spec[4][4],):
+ self.column_parent = column_parent
+ self.predicate = predicate
+ self.range = range
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.range = KeyRange()
+ self.range.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_range_slices_args')
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 1)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 2)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.range != None:
+ oprot.writeFieldBegin('range', TType.STRUCT, 3)
+ self.range.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.predicate is None:
+ raise TProtocol.TProtocolException(message='Required field predicate is unset!')
+ if self.range is None:
+ raise TProtocol.TProtocolException(message='Required field range is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_range_slices_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.STRUCT,(KeySlice, KeySlice.thrift_spec)), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype137, _size134) = iprot.readListBegin()
+ for _i138 in xrange(_size134):
+ _elem139 = KeySlice()
+ _elem139.read(iprot)
+ self.success.append(_elem139)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_range_slices_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.STRUCT, len(self.success))
+ for iter140 in self.success:
+ iter140.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_indexed_slices_args:
+ """
+ Attributes:
+ - column_parent
+ - index_clause
+ - column_predicate
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'index_clause', (IndexClause, IndexClause.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'column_predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, column_parent=None, index_clause=None, column_predicate=None, consistency_level=thrift_spec[4][4],):
+ self.column_parent = column_parent
+ self.index_clause = index_clause
+ self.column_predicate = column_predicate
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.index_clause = IndexClause()
+ self.index_clause.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.column_predicate = SlicePredicate()
+ self.column_predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_indexed_slices_args')
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 1)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.index_clause != None:
+ oprot.writeFieldBegin('index_clause', TType.STRUCT, 2)
+ self.index_clause.write(oprot)
+ oprot.writeFieldEnd()
+ if self.column_predicate != None:
+ oprot.writeFieldBegin('column_predicate', TType.STRUCT, 3)
+ self.column_predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.index_clause is None:
+ raise TProtocol.TProtocolException(message='Required field index_clause is unset!')
+ if self.column_predicate is None:
+ raise TProtocol.TProtocolException(message='Required field column_predicate is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_indexed_slices_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.STRUCT,(KeySlice, KeySlice.thrift_spec)), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype144, _size141) = iprot.readListBegin()
+ for _i145 in xrange(_size141):
+ _elem146 = KeySlice()
+ _elem146.read(iprot)
+ self.success.append(_elem146)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_indexed_slices_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.STRUCT, len(self.success))
+ for iter147 in self.success:
+ iter147.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class insert_args:
+ """
+ Attributes:
+ - key
+ - column_parent
+ - column
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'column', (Column, Column.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, key=None, column_parent=None, column=None, consistency_level=thrift_spec[4][4],):
+ self.key = key
+ self.column_parent = column_parent
+ self.column = column
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.column = Column()
+ self.column.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('insert_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.column != None:
+ oprot.writeFieldBegin('column', TType.STRUCT, 3)
+ self.column.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.column is None:
+ raise TProtocol.TProtocolException(message='Required field column is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class insert_result:
+ """
+ Attributes:
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, ire=None, ue=None, te=None,):
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('insert_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class remove_args:
+ """
+ Attributes:
+ - key
+ - column_path
+ - timestamp
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'column_path', (ColumnPath, ColumnPath.thrift_spec), None, ), # 2
+ (3, TType.I64, 'timestamp', None, None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, key=None, column_path=None, timestamp=None, consistency_level=thrift_spec[4][4],):
+ self.key = key
+ self.column_path = column_path
+ self.timestamp = timestamp
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_path = ColumnPath()
+ self.column_path.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I64:
+ self.timestamp = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('remove_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.column_path != None:
+ oprot.writeFieldBegin('column_path', TType.STRUCT, 2)
+ self.column_path.write(oprot)
+ oprot.writeFieldEnd()
+ if self.timestamp != None:
+ oprot.writeFieldBegin('timestamp', TType.I64, 3)
+ oprot.writeI64(self.timestamp)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.column_path is None:
+ raise TProtocol.TProtocolException(message='Required field column_path is unset!')
+ if self.timestamp is None:
+ raise TProtocol.TProtocolException(message='Required field timestamp is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class remove_result:
+ """
+ Attributes:
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, ire=None, ue=None, te=None,):
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('remove_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class batch_mutate_args:
+ """
+ Attributes:
+ - mutation_map
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.MAP, 'mutation_map', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.LIST,(TType.STRUCT,(Mutation, Mutation.thrift_spec)))), None, ), # 1
+ (2, TType.I32, 'consistency_level', None, 1, ), # 2
+ )
+
+ def __init__(self, mutation_map=None, consistency_level=thrift_spec[2][4],):
+ self.mutation_map = mutation_map
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.MAP:
+ self.mutation_map = {}
+ (_ktype149, _vtype150, _size148 ) = iprot.readMapBegin()
+ for _i152 in xrange(_size148):
+ _key153 = iprot.readString();
+ _val154 = {}
+ (_ktype156, _vtype157, _size155 ) = iprot.readMapBegin()
+ for _i159 in xrange(_size155):
+ _key160 = iprot.readString();
+ _val161 = []
+ (_etype165, _size162) = iprot.readListBegin()
+ for _i166 in xrange(_size162):
+ _elem167 = Mutation()
+ _elem167.read(iprot)
+ _val161.append(_elem167)
+ iprot.readListEnd()
+ _val154[_key160] = _val161
+ iprot.readMapEnd()
+ self.mutation_map[_key153] = _val154
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('batch_mutate_args')
+ if self.mutation_map != None:
+ oprot.writeFieldBegin('mutation_map', TType.MAP, 1)
+ oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.mutation_map))
+ for kiter168,viter169 in self.mutation_map.items():
+ oprot.writeString(kiter168)
+ oprot.writeMapBegin(TType.STRING, TType.LIST, len(viter169))
+ for kiter170,viter171 in viter169.items():
+ oprot.writeString(kiter170)
+ oprot.writeListBegin(TType.STRUCT, len(viter171))
+ for iter172 in viter171:
+ iter172.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeMapEnd()
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 2)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.mutation_map is None:
+ raise TProtocol.TProtocolException(message='Required field mutation_map is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class batch_mutate_result:
+ """
+ Attributes:
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, ire=None, ue=None, te=None,):
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('batch_mutate_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class truncate_args:
+ """
+ Attributes:
+ - cfname
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'cfname', None, None, ), # 1
+ )
+
+ def __init__(self, cfname=None,):
+ self.cfname = cfname
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.cfname = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('truncate_args')
+ if self.cfname != None:
+ oprot.writeFieldBegin('cfname', TType.STRING, 1)
+ oprot.writeString(self.cfname)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.cfname is None:
+ raise TProtocol.TProtocolException(message='Required field cfname is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class truncate_result:
+ """
+ Attributes:
+ - ire
+ - ue
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, ire=None, ue=None,):
+ self.ire = ire
+ self.ue = ue
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('truncate_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class add_args:
+ """
+ Attributes:
+ - key
+ - column_parent
+ - column
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'column', (CounterColumn, CounterColumn.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, key=None, column_parent=None, column=None, consistency_level=thrift_spec[4][4],):
+ self.key = key
+ self.column_parent = column_parent
+ self.column = column
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.column = CounterColumn()
+ self.column.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('add_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.column != None:
+ oprot.writeFieldBegin('column', TType.STRUCT, 3)
+ self.column.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.column is None:
+ raise TProtocol.TProtocolException(message='Required field column is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class add_result:
+ """
+ Attributes:
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, ire=None, ue=None, te=None,):
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('add_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class batch_add_args:
+ """
+ Attributes:
+ - update_map
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.MAP, 'update_map', (TType.STRING,None,TType.MAP,(TType.STRING,None,TType.LIST,(TType.STRUCT,(CounterMutation, CounterMutation.thrift_spec)))), None, ), # 1
+ (2, TType.I32, 'consistency_level', None, 1, ), # 2
+ )
+
+ def __init__(self, update_map=None, consistency_level=thrift_spec[2][4],):
+ self.update_map = update_map
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.MAP:
+ self.update_map = {}
+ (_ktype174, _vtype175, _size173 ) = iprot.readMapBegin()
+ for _i177 in xrange(_size173):
+ _key178 = iprot.readString();
+ _val179 = {}
+ (_ktype181, _vtype182, _size180 ) = iprot.readMapBegin()
+ for _i184 in xrange(_size180):
+ _key185 = iprot.readString();
+ _val186 = []
+ (_etype190, _size187) = iprot.readListBegin()
+ for _i191 in xrange(_size187):
+ _elem192 = CounterMutation()
+ _elem192.read(iprot)
+ _val186.append(_elem192)
+ iprot.readListEnd()
+ _val179[_key185] = _val186
+ iprot.readMapEnd()
+ self.update_map[_key178] = _val179
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('batch_add_args')
+ if self.update_map != None:
+ oprot.writeFieldBegin('update_map', TType.MAP, 1)
+ oprot.writeMapBegin(TType.STRING, TType.MAP, len(self.update_map))
+ for kiter193,viter194 in self.update_map.items():
+ oprot.writeString(kiter193)
+ oprot.writeMapBegin(TType.STRING, TType.LIST, len(viter194))
+ for kiter195,viter196 in viter194.items():
+ oprot.writeString(kiter195)
+ oprot.writeListBegin(TType.STRUCT, len(viter196))
+ for iter197 in viter196:
+ iter197.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeMapEnd()
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 2)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.update_map is None:
+ raise TProtocol.TProtocolException(message='Required field update_map is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class batch_add_result:
+ """
+ Attributes:
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, ire=None, ue=None, te=None,):
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('batch_add_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_counter_args:
+ """
+ Attributes:
+ - key
+ - path
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'path', (ColumnPath, ColumnPath.thrift_spec), None, ), # 2
+ (3, TType.I32, 'consistency_level', None, 1, ), # 3
+ )
+
+ def __init__(self, key=None, path=None, consistency_level=thrift_spec[3][4],):
+ self.key = key
+ self.path = path
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.path = ColumnPath()
+ self.path.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_counter_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.path != None:
+ oprot.writeFieldBegin('path', TType.STRUCT, 2)
+ self.path.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 3)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.path is None:
+ raise TProtocol.TProtocolException(message='Required field path is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_counter_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - nfe
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (Counter, Counter.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'nfe', (NotFoundException, NotFoundException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 3
+ (4, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 4
+ )
+
+ def __init__(self, success=None, ire=None, nfe=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.nfe = nfe
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = Counter()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.nfe = NotFoundException()
+ self.nfe.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_counter_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.nfe != None:
+ oprot.writeFieldBegin('nfe', TType.STRUCT, 2)
+ self.nfe.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 3)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 4)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_counter_slice_args:
+ """
+ Attributes:
+ - key
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, key=None, column_parent=None, predicate=None, consistency_level=thrift_spec[4][4],):
+ self.key = key
+ self.column_parent = column_parent
+ self.predicate = predicate
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_counter_slice_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.predicate is None:
+ raise TProtocol.TProtocolException(message='Required field predicate is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class get_counter_slice_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.STRUCT,(Counter, Counter.thrift_spec)), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype201, _size198) = iprot.readListBegin()
+ for _i202 in xrange(_size198):
+ _elem203 = Counter()
+ _elem203.read(iprot)
+ self.success.append(_elem203)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('get_counter_slice_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.STRUCT, len(self.success))
+ for iter204 in self.success:
+ iter204.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class multiget_counter_slice_args:
+ """
+ Attributes:
+ - keys
+ - column_parent
+ - predicate
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'keys', (TType.STRING,None), None, ), # 1
+ (2, TType.STRUCT, 'column_parent', (ColumnParent, ColumnParent.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ (4, TType.I32, 'consistency_level', None, 1, ), # 4
+ )
+
+ def __init__(self, keys=None, column_parent=None, predicate=None, consistency_level=thrift_spec[4][4],):
+ self.keys = keys
+ self.column_parent = column_parent
+ self.predicate = predicate
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.keys = []
+ (_etype208, _size205) = iprot.readListBegin()
+ for _i209 in xrange(_size205):
+ _elem210 = iprot.readString();
+ self.keys.append(_elem210)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.column_parent = ColumnParent()
+ self.column_parent.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('multiget_counter_slice_args')
+ if self.keys != None:
+ oprot.writeFieldBegin('keys', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRING, len(self.keys))
+ for iter211 in self.keys:
+ oprot.writeString(iter211)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.column_parent != None:
+ oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
+ self.column_parent.write(oprot)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 4)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keys is None:
+ raise TProtocol.TProtocolException(message='Required field keys is unset!')
+ if self.column_parent is None:
+ raise TProtocol.TProtocolException(message='Required field column_parent is unset!')
+ if self.predicate is None:
+ raise TProtocol.TProtocolException(message='Required field predicate is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class multiget_counter_slice_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRUCT,(Counter, Counter.thrift_spec))), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.MAP:
+ self.success = {}
+ (_ktype213, _vtype214, _size212 ) = iprot.readMapBegin()
+ for _i216 in xrange(_size212):
+ _key217 = iprot.readString();
+ _val218 = []
+ (_etype222, _size219) = iprot.readListBegin()
+ for _i223 in xrange(_size219):
+ _elem224 = Counter()
+ _elem224.read(iprot)
+ _val218.append(_elem224)
+ iprot.readListEnd()
+ self.success[_key217] = _val218
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('multiget_counter_slice_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.MAP, 0)
+ oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.success))
+ for kiter225,viter226 in self.success.items():
+ oprot.writeString(kiter225)
+ oprot.writeListBegin(TType.STRUCT, len(viter226))
+ for iter227 in viter226:
+ iter227.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class remove_counter_args:
+ """
+ Attributes:
+ - key
+ - path
+ - consistency_level
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.STRUCT, 'path', (ColumnPath, ColumnPath.thrift_spec), None, ), # 2
+ (3, TType.I32, 'consistency_level', None, 1, ), # 3
+ )
+
+ def __init__(self, key=None, path=None, consistency_level=thrift_spec[3][4],):
+ self.key = key
+ self.path = path
+ self.consistency_level = consistency_level
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.path = ColumnPath()
+ self.path.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.consistency_level = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('remove_counter_args')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.path != None:
+ oprot.writeFieldBegin('path', TType.STRUCT, 2)
+ self.path.write(oprot)
+ oprot.writeFieldEnd()
+ if self.consistency_level != None:
+ oprot.writeFieldBegin('consistency_level', TType.I32, 3)
+ oprot.writeI32(self.consistency_level)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.path is None:
+ raise TProtocol.TProtocolException(message='Required field path is unset!')
+ if self.consistency_level is None:
+ raise TProtocol.TProtocolException(message='Required field consistency_level is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class remove_counter_result:
+ """
+ Attributes:
+ - ire
+ - ue
+ - te
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, ire=None, ue=None, te=None,):
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('remove_counter_result')
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_schema_versions_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_schema_versions_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_schema_versions_result:
+ """
+ Attributes:
+ - success
+ - ire
+ """
+
+ thrift_spec = (
+ (0, TType.MAP, 'success', (TType.STRING,None,TType.LIST,(TType.STRING,None)), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ire=None,):
+ self.success = success
+ self.ire = ire
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.MAP:
+ self.success = {}
+ (_ktype229, _vtype230, _size228 ) = iprot.readMapBegin()
+ for _i232 in xrange(_size228):
+ _key233 = iprot.readString();
+ _val234 = []
+ (_etype238, _size235) = iprot.readListBegin()
+ for _i239 in xrange(_size235):
+ _elem240 = iprot.readString();
+ _val234.append(_elem240)
+ iprot.readListEnd()
+ self.success[_key233] = _val234
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_schema_versions_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.MAP, 0)
+ oprot.writeMapBegin(TType.STRING, TType.LIST, len(self.success))
+ for kiter241,viter242 in self.success.items():
+ oprot.writeString(kiter241)
+ oprot.writeListBegin(TType.STRING, len(viter242))
+ for iter243 in viter242:
+ oprot.writeString(iter243)
+ oprot.writeListEnd()
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_keyspaces_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_keyspaces_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_keyspaces_result:
+ """
+ Attributes:
+ - success
+ - ire
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.STRUCT,(KsDef, KsDef.thrift_spec)), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ire=None,):
+ self.success = success
+ self.ire = ire
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype247, _size244) = iprot.readListBegin()
+ for _i248 in xrange(_size244):
+ _elem249 = KsDef()
+ _elem249.read(iprot)
+ self.success.append(_elem249)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_keyspaces_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.STRUCT, len(self.success))
+ for iter250 in self.success:
+ iter250.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_cluster_name_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_cluster_name_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_cluster_name_result:
+ """
+ Attributes:
+ - success
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ self.success = success
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_cluster_name_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_version_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_version_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_version_result:
+ """
+ Attributes:
+ - success
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ self.success = success
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_version_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_ring_args:
+ """
+ Attributes:
+ - keyspace
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'keyspace', None, None, ), # 1
+ )
+
+ def __init__(self, keyspace=None,):
+ self.keyspace = keyspace
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.keyspace = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_ring_args')
+ if self.keyspace != None:
+ oprot.writeFieldBegin('keyspace', TType.STRING, 1)
+ oprot.writeString(self.keyspace)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keyspace is None:
+ raise TProtocol.TProtocolException(message='Required field keyspace is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_ring_result:
+ """
+ Attributes:
+ - success
+ - ire
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.STRUCT,(TokenRange, TokenRange.thrift_spec)), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ire=None,):
+ self.success = success
+ self.ire = ire
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype254, _size251) = iprot.readListBegin()
+ for _i255 in xrange(_size251):
+ _elem256 = TokenRange()
+ _elem256.read(iprot)
+ self.success.append(_elem256)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_ring_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.STRUCT, len(self.success))
+ for iter257 in self.success:
+ iter257.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_partitioner_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_partitioner_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_partitioner_result:
+ """
+ Attributes:
+ - success
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ self.success = success
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_partitioner_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_snitch_args:
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_snitch_args')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_snitch_result:
+ """
+ Attributes:
+ - success
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ )
+
+ def __init__(self, success=None,):
+ self.success = success
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_snitch_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_keyspace_args:
+ """
+ Attributes:
+ - keyspace
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'keyspace', None, None, ), # 1
+ )
+
+ def __init__(self, keyspace=None,):
+ self.keyspace = keyspace
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.keyspace = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_keyspace_args')
+ if self.keyspace != None:
+ oprot.writeFieldBegin('keyspace', TType.STRING, 1)
+ oprot.writeString(self.keyspace)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keyspace is None:
+ raise TProtocol.TProtocolException(message='Required field keyspace is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_keyspace_result:
+ """
+ Attributes:
+ - success
+ - nfe
+ - ire
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (KsDef, KsDef.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'nfe', (NotFoundException, NotFoundException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, nfe=None, ire=None,):
+ self.success = success
+ self.nfe = nfe
+ self.ire = ire
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = KsDef()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.nfe = NotFoundException()
+ self.nfe.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_keyspace_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.nfe != None:
+ oprot.writeFieldBegin('nfe', TType.STRUCT, 1)
+ self.nfe.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 2)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_splits_args:
+ """
+ Attributes:
+ - cfName
+ - start_token
+ - end_token
+ - keys_per_split
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'cfName', None, None, ), # 1
+ (2, TType.STRING, 'start_token', None, None, ), # 2
+ (3, TType.STRING, 'end_token', None, None, ), # 3
+ (4, TType.I32, 'keys_per_split', None, None, ), # 4
+ )
+
+ def __init__(self, cfName=None, start_token=None, end_token=None, keys_per_split=None,):
+ self.cfName = cfName
+ self.start_token = start_token
+ self.end_token = end_token
+ self.keys_per_split = keys_per_split
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.cfName = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.start_token = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.end_token = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.keys_per_split = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_splits_args')
+ if self.cfName != None:
+ oprot.writeFieldBegin('cfName', TType.STRING, 1)
+ oprot.writeString(self.cfName)
+ oprot.writeFieldEnd()
+ if self.start_token != None:
+ oprot.writeFieldBegin('start_token', TType.STRING, 2)
+ oprot.writeString(self.start_token)
+ oprot.writeFieldEnd()
+ if self.end_token != None:
+ oprot.writeFieldBegin('end_token', TType.STRING, 3)
+ oprot.writeString(self.end_token)
+ oprot.writeFieldEnd()
+ if self.keys_per_split != None:
+ oprot.writeFieldBegin('keys_per_split', TType.I32, 4)
+ oprot.writeI32(self.keys_per_split)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.cfName is None:
+ raise TProtocol.TProtocolException(message='Required field cfName is unset!')
+ if self.start_token is None:
+ raise TProtocol.TProtocolException(message='Required field start_token is unset!')
+ if self.end_token is None:
+ raise TProtocol.TProtocolException(message='Required field end_token is unset!')
+ if self.keys_per_split is None:
+ raise TProtocol.TProtocolException(message='Required field keys_per_split is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class describe_splits_result:
+ """
+ Attributes:
+ - success
+ - ire
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.STRING,None), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, ire=None,):
+ self.success = success
+ self.ire = ire
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype261, _size258) = iprot.readListBegin()
+ for _i262 in xrange(_size258):
+ _elem263 = iprot.readString();
+ self.success.append(_elem263)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('describe_splits_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.STRING, len(self.success))
+ for iter264 in self.success:
+ oprot.writeString(iter264)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_add_column_family_args:
+ """
+ Attributes:
+ - cf_def
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'cf_def', (CfDef, CfDef.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, cf_def=None,):
+ self.cf_def = cf_def
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.cf_def = CfDef()
+ self.cf_def.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_add_column_family_args')
+ if self.cf_def != None:
+ oprot.writeFieldBegin('cf_def', TType.STRUCT, 1)
+ self.cf_def.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.cf_def is None:
+ raise TProtocol.TProtocolException(message='Required field cf_def is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_add_column_family_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - sde
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, ire=None, sde=None,):
+ self.success = success
+ self.ire = ire
+ self.sde = sde
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.sde = SchemaDisagreementException()
+ self.sde.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_add_column_family_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.sde != None:
+ oprot.writeFieldBegin('sde', TType.STRUCT, 2)
+ self.sde.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_drop_column_family_args:
+ """
+ Attributes:
+ - column_family
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'column_family', None, None, ), # 1
+ )
+
+ def __init__(self, column_family=None,):
+ self.column_family = column_family
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.column_family = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_drop_column_family_args')
+ if self.column_family != None:
+ oprot.writeFieldBegin('column_family', TType.STRING, 1)
+ oprot.writeString(self.column_family)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.column_family is None:
+ raise TProtocol.TProtocolException(message='Required field column_family is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_drop_column_family_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - sde
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, ire=None, sde=None,):
+ self.success = success
+ self.ire = ire
+ self.sde = sde
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.sde = SchemaDisagreementException()
+ self.sde.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_drop_column_family_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.sde != None:
+ oprot.writeFieldBegin('sde', TType.STRUCT, 2)
+ self.sde.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_add_keyspace_args:
+ """
+ Attributes:
+ - ks_def
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ks_def', (KsDef, KsDef.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, ks_def=None,):
+ self.ks_def = ks_def
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ks_def = KsDef()
+ self.ks_def.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_add_keyspace_args')
+ if self.ks_def != None:
+ oprot.writeFieldBegin('ks_def', TType.STRUCT, 1)
+ self.ks_def.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.ks_def is None:
+ raise TProtocol.TProtocolException(message='Required field ks_def is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_add_keyspace_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - sde
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, ire=None, sde=None,):
+ self.success = success
+ self.ire = ire
+ self.sde = sde
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.sde = SchemaDisagreementException()
+ self.sde.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_add_keyspace_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.sde != None:
+ oprot.writeFieldBegin('sde', TType.STRUCT, 2)
+ self.sde.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_drop_keyspace_args:
+ """
+ Attributes:
+ - keyspace
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'keyspace', None, None, ), # 1
+ )
+
+ def __init__(self, keyspace=None,):
+ self.keyspace = keyspace
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.keyspace = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_drop_keyspace_args')
+ if self.keyspace != None:
+ oprot.writeFieldBegin('keyspace', TType.STRING, 1)
+ oprot.writeString(self.keyspace)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keyspace is None:
+ raise TProtocol.TProtocolException(message='Required field keyspace is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_drop_keyspace_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - sde
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, ire=None, sde=None,):
+ self.success = success
+ self.ire = ire
+ self.sde = sde
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.sde = SchemaDisagreementException()
+ self.sde.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_drop_keyspace_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.sde != None:
+ oprot.writeFieldBegin('sde', TType.STRUCT, 2)
+ self.sde.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_update_keyspace_args:
+ """
+ Attributes:
+ - ks_def
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'ks_def', (KsDef, KsDef.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, ks_def=None,):
+ self.ks_def = ks_def
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.ks_def = KsDef()
+ self.ks_def.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_update_keyspace_args')
+ if self.ks_def != None:
+ oprot.writeFieldBegin('ks_def', TType.STRUCT, 1)
+ self.ks_def.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.ks_def is None:
+ raise TProtocol.TProtocolException(message='Required field ks_def is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_update_keyspace_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - sde
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, ire=None, sde=None,):
+ self.success = success
+ self.ire = ire
+ self.sde = sde
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.sde = SchemaDisagreementException()
+ self.sde.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_update_keyspace_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.sde != None:
+ oprot.writeFieldBegin('sde', TType.STRUCT, 2)
+ self.sde.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_update_column_family_args:
+ """
+ Attributes:
+ - cf_def
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'cf_def', (CfDef, CfDef.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, cf_def=None,):
+ self.cf_def = cf_def
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.cf_def = CfDef()
+ self.cf_def.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_update_column_family_args')
+ if self.cf_def != None:
+ oprot.writeFieldBegin('cf_def', TType.STRUCT, 1)
+ self.cf_def.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.cf_def is None:
+ raise TProtocol.TProtocolException(message='Required field cf_def is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class system_update_column_family_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - sde
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', None, None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, success=None, ire=None, sde=None,):
+ self.success = success
+ self.ire = ire
+ self.sde = sde
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRING:
+ self.success = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.sde = SchemaDisagreementException()
+ self.sde.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('system_update_column_family_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRING, 0)
+ oprot.writeString(self.success)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.sde != None:
+ oprot.writeFieldBegin('sde', TType.STRUCT, 2)
+ self.sde.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class execute_cql_query_args:
+ """
+ Attributes:
+ - query
+ - compression
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'query', None, None, ), # 1
+ (2, TType.I32, 'compression', None, None, ), # 2
+ )
+
+ def __init__(self, query=None, compression=None,):
+ self.query = query
+ self.compression = compression
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.query = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.compression = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('execute_cql_query_args')
+ if self.query != None:
+ oprot.writeFieldBegin('query', TType.STRING, 1)
+ oprot.writeString(self.query)
+ oprot.writeFieldEnd()
+ if self.compression != None:
+ oprot.writeFieldBegin('compression', TType.I32, 2)
+ oprot.writeI32(self.compression)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.query is None:
+ raise TProtocol.TProtocolException(message='Required field query is unset!')
+ if self.compression is None:
+ raise TProtocol.TProtocolException(message='Required field compression is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class execute_cql_query_result:
+ """
+ Attributes:
+ - success
+ - ire
+ - ue
+ - te
+ - sde
+ """
+
+ thrift_spec = (
+ (0, TType.STRUCT, 'success', (CqlResult, CqlResult.thrift_spec), None, ), # 0
+ (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'ue', (UnavailableException, UnavailableException.thrift_spec), None, ), # 2
+ (3, TType.STRUCT, 'te', (TimedOutException, TimedOutException.thrift_spec), None, ), # 3
+ (4, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), None, ), # 4
+ )
+
+ def __init__(self, success=None, ire=None, ue=None, te=None, sde=None,):
+ self.success = success
+ self.ire = ire
+ self.ue = ue
+ self.te = te
+ self.sde = sde
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.STRUCT:
+ self.success = CqlResult()
+ self.success.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.ire = InvalidRequestException()
+ self.ire.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.ue = UnavailableException()
+ self.ue.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.te = TimedOutException()
+ self.te.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRUCT:
+ self.sde = SchemaDisagreementException()
+ self.sde.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('execute_cql_query_result')
+ if self.success != None:
+ oprot.writeFieldBegin('success', TType.STRUCT, 0)
+ self.success.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ire != None:
+ oprot.writeFieldBegin('ire', TType.STRUCT, 1)
+ self.ire.write(oprot)
+ oprot.writeFieldEnd()
+ if self.ue != None:
+ oprot.writeFieldBegin('ue', TType.STRUCT, 2)
+ self.ue.write(oprot)
+ oprot.writeFieldEnd()
+ if self.te != None:
+ oprot.writeFieldBegin('te', TType.STRUCT, 3)
+ self.te.write(oprot)
+ oprot.writeFieldEnd()
+ if self.sde != None:
+ oprot.writeFieldBegin('sde', TType.STRUCT, 4)
+ self.sde.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
diff --git a/drivers/txpy/txcql/cassandra/__init__.py b/drivers/txpy/txcql/cassandra/__init__.py
new file mode 100644
index 0000000000..2132df03c7
--- /dev/null
+++ b/drivers/txpy/txcql/cassandra/__init__.py
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'Cassandra']
diff --git a/drivers/txpy/txcql/cassandra/constants.py b/drivers/txpy/txcql/cassandra/constants.py
new file mode 100644
index 0000000000..74127c7032
--- /dev/null
+++ b/drivers/txpy/txcql/cassandra/constants.py
@@ -0,0 +1,10 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+from ttypes import *
+
+VERSION = "19.4.0"
diff --git a/drivers/txpy/txcql/cassandra/ttypes.py b/drivers/txpy/txcql/cassandra/ttypes.py
new file mode 100644
index 0000000000..d172f8a2a8
--- /dev/null
+++ b/drivers/txpy/txcql/cassandra/ttypes.py
@@ -0,0 +1,3127 @@
+#
+# Autogenerated by Thrift
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+
+from thrift.transport import TTransport
+from thrift.protocol import TBinaryProtocol, TProtocol
+try:
+ from thrift.protocol import fastbinary
+except:
+ fastbinary = None
+
+
+class ConsistencyLevel:
+ """
+ The ConsistencyLevel is an enum that controls both read and write
+ behavior based on the ReplicationFactor of the keyspace. The
+ different consistency levels have different meanings, depending on
+ if you're doing a write or read operation.
+
+ If W + R > ReplicationFactor, where W is the number of nodes to
+ block for on write, and R the number to block for on reads, you
+ will have strongly consistent behavior; that is, readers will
+ always see the most recent write. Of these, the most interesting is
+ to do QUORUM reads and writes, which gives you consistency while
+ still allowing availability in the face of node failures up to half
+ of . Of course if latency is more important than
+ consistency then you can use lower values for either or both.
+
+ Some ConsistencyLevels (ONE, TWO, THREE) refer to a specific number
+ of replicas rather than a logical concept that adjusts
+ automatically with the replication factor. Of these, only ONE is
+ commonly used; TWO and (even more rarely) THREE are only useful
+ when you care more about guaranteeing a certain level of
+ durability, than consistency.
+
+ Write consistency levels make the following guarantees before reporting success to the client:
+ ANY Ensure that the write has been written once somewhere, including possibly being hinted in a non-target node.
+ ONE Ensure that the write has been written to at least 1 node's commit log and memory table
+ TWO Ensure that the write has been written to at least 2 node's commit log and memory table
+ THREE Ensure that the write has been written to at least 3 node's commit log and memory table
+ QUORUM Ensure that the write has been written to / 2 + 1 nodes
+ LOCAL_QUORUM Ensure that the write has been written to / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
+ EACH_QUORUM Ensure that the write has been written to / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
+ ALL Ensure that the write is written to <ReplicationFactor> nodes before responding to the client.
+
+ Read consistency levels make the following guarantees before returning successful results to the client:
+ ANY Not supported. You probably want ONE instead.
+ ONE Returns the record obtained from a single replica.
+ TWO Returns the record with the most recent timestamp once two replicas have replied.
+ THREE Returns the record with the most recent timestamp once three replicas have replied.
+ QUORUM Returns the record with the most recent timestamp once a majority of replicas have replied.
+ LOCAL_QUORUM Returns the record with the most recent timestamp once a majority of replicas within the local datacenter have replied.
+ EACH_QUORUM Returns the record with the most recent timestamp once a majority of replicas within each datacenter have replied.
+ ALL Returns the record with the most recent timestamp once all replicas have replied (implies no replica may be down)..
+ """
+ ONE = 1
+ QUORUM = 2
+ LOCAL_QUORUM = 3
+ EACH_QUORUM = 4
+ ALL = 5
+ ANY = 6
+ TWO = 7
+ THREE = 8
+
+ _VALUES_TO_NAMES = {
+ 1: "ONE",
+ 2: "QUORUM",
+ 3: "LOCAL_QUORUM",
+ 4: "EACH_QUORUM",
+ 5: "ALL",
+ 6: "ANY",
+ 7: "TWO",
+ 8: "THREE",
+ }
+
+ _NAMES_TO_VALUES = {
+ "ONE": 1,
+ "QUORUM": 2,
+ "LOCAL_QUORUM": 3,
+ "EACH_QUORUM": 4,
+ "ALL": 5,
+ "ANY": 6,
+ "TWO": 7,
+ "THREE": 8,
+ }
+
+class IndexOperator:
+ EQ = 0
+ GTE = 1
+ GT = 2
+ LTE = 3
+ LT = 4
+
+ _VALUES_TO_NAMES = {
+ 0: "EQ",
+ 1: "GTE",
+ 2: "GT",
+ 3: "LTE",
+ 4: "LT",
+ }
+
+ _NAMES_TO_VALUES = {
+ "EQ": 0,
+ "GTE": 1,
+ "GT": 2,
+ "LTE": 3,
+ "LT": 4,
+ }
+
+class IndexType:
+ KEYS = 0
+
+ _VALUES_TO_NAMES = {
+ 0: "KEYS",
+ }
+
+ _NAMES_TO_VALUES = {
+ "KEYS": 0,
+ }
+
+class Compression:
+ """
+ CQL query compression
+ """
+ GZIP = 1
+
+ _VALUES_TO_NAMES = {
+ 1: "GZIP",
+ }
+
+ _NAMES_TO_VALUES = {
+ "GZIP": 1,
+ }
+
+class CqlResultType:
+ ROWS = 1
+ VOID = 2
+ INT = 3
+
+ _VALUES_TO_NAMES = {
+ 1: "ROWS",
+ 2: "VOID",
+ 3: "INT",
+ }
+
+ _NAMES_TO_VALUES = {
+ "ROWS": 1,
+ "VOID": 2,
+ "INT": 3,
+ }
+
+
+class Column:
+ """
+ Basic unit of data within a ColumnFamily.
+ @param name, the name by which this column is set and retrieved. Maximum 64KB long.
+ @param value. The data associated with the name. Maximum 2GB long, but in practice you should limit it to small numbers of MB (since Thrift must read the full value into memory to operate on it).
+ @param timestamp. The timestamp is used for conflict detection/resolution when two columns with same name need to be compared.
+ @param ttl. An optional, positive delay (in seconds) after which the column will be automatically deleted.
+
+ Attributes:
+ - name
+ - value
+ - timestamp
+ - ttl
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.STRING, 'value', None, None, ), # 2
+ (3, TType.I64, 'timestamp', None, None, ), # 3
+ (4, TType.I32, 'ttl', None, None, ), # 4
+ )
+
+ def __init__(self, name=None, value=None, timestamp=None, ttl=None,):
+ self.name = name
+ self.value = value
+ self.timestamp = timestamp
+ self.ttl = ttl
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.value = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I64:
+ self.timestamp = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.ttl = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Column')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.value != None:
+ oprot.writeFieldBegin('value', TType.STRING, 2)
+ oprot.writeString(self.value)
+ oprot.writeFieldEnd()
+ if self.timestamp != None:
+ oprot.writeFieldBegin('timestamp', TType.I64, 3)
+ oprot.writeI64(self.timestamp)
+ oprot.writeFieldEnd()
+ if self.ttl != None:
+ oprot.writeFieldBegin('ttl', TType.I32, 4)
+ oprot.writeI32(self.ttl)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ if self.value is None:
+ raise TProtocol.TProtocolException(message='Required field value is unset!')
+ if self.timestamp is None:
+ raise TProtocol.TProtocolException(message='Required field timestamp is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class SuperColumn:
+ """
+ A named list of columns.
+ @param name. see Column.name.
+ @param columns. A collection of standard Columns. The columns within a super column are defined in an adhoc manner.
+ Columns within a super column do not have to have matching structures (similarly named child columns).
+
+ Attributes:
+ - name
+ - columns
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.LIST, 'columns', (TType.STRUCT,(Column, Column.thrift_spec)), None, ), # 2
+ )
+
+ def __init__(self, name=None, columns=None,):
+ self.name = name
+ self.columns = columns
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.columns = []
+ (_etype3, _size0) = iprot.readListBegin()
+ for _i4 in xrange(_size0):
+ _elem5 = Column()
+ _elem5.read(iprot)
+ self.columns.append(_elem5)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('SuperColumn')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.columns != None:
+ oprot.writeFieldBegin('columns', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.columns))
+ for iter6 in self.columns:
+ iter6.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ if self.columns is None:
+ raise TProtocol.TProtocolException(message='Required field columns is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnOrSuperColumn:
+ """
+ Methods for fetching rows/records from Cassandra will return either a single instance of ColumnOrSuperColumn or a list
+ of ColumnOrSuperColumns (get_slice()). If you're looking up a SuperColumn (or list of SuperColumns) then the resulting
+ instances of ColumnOrSuperColumn will have the requested SuperColumn in the attribute super_column. For queries resulting
+ in Columns, those values will be in the attribute column. This change was made between 0.3 and 0.4 to standardize on
+ single query methods that may return either a SuperColumn or Column.
+
+ @param column. The Column returned by get() or get_slice().
+ @param super_column. The SuperColumn returned by get() or get_slice().
+
+ Attributes:
+ - column
+ - super_column
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'column', (Column, Column.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'super_column', (SuperColumn, SuperColumn.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, column=None, super_column=None,):
+ self.column = column
+ self.super_column = super_column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.column = Column()
+ self.column.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.super_column = SuperColumn()
+ self.super_column.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ColumnOrSuperColumn')
+ if self.column != None:
+ oprot.writeFieldBegin('column', TType.STRUCT, 1)
+ self.column.write(oprot)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRUCT, 2)
+ self.super_column.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class NotFoundException(Exception):
+ """
+ A specific column was requested that does not exist.
+ """
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('NotFoundException')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class InvalidRequestException(Exception):
+ """
+ Invalid request could mean keyspace or column family does not exist, required parameters are missing, or a parameter is malformed.
+ why contains an associated error message.
+
+ Attributes:
+ - why
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'why', None, None, ), # 1
+ )
+
+ def __init__(self, why=None,):
+ self.why = why
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.why = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('InvalidRequestException')
+ if self.why != None:
+ oprot.writeFieldBegin('why', TType.STRING, 1)
+ oprot.writeString(self.why)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.why is None:
+ raise TProtocol.TProtocolException(message='Required field why is unset!')
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class UnavailableException(Exception):
+ """
+ Not all the replicas required could be created and/or read.
+ """
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('UnavailableException')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TimedOutException(Exception):
+ """
+ RPC timeout was exceeded. either a node failed mid-operation, or load was too high, or the requested op was too large.
+ """
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TimedOutException')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class AuthenticationException(Exception):
+ """
+ invalid authentication request (invalid keyspace, user does not exist, or credentials invalid)
+
+ Attributes:
+ - why
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'why', None, None, ), # 1
+ )
+
+ def __init__(self, why=None,):
+ self.why = why
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.why = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('AuthenticationException')
+ if self.why != None:
+ oprot.writeFieldBegin('why', TType.STRING, 1)
+ oprot.writeString(self.why)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.why is None:
+ raise TProtocol.TProtocolException(message='Required field why is unset!')
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class AuthorizationException(Exception):
+ """
+ invalid authorization request (user does not have access to keyspace)
+
+ Attributes:
+ - why
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'why', None, None, ), # 1
+ )
+
+ def __init__(self, why=None,):
+ self.why = why
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.why = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('AuthorizationException')
+ if self.why != None:
+ oprot.writeFieldBegin('why', TType.STRING, 1)
+ oprot.writeString(self.why)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.why is None:
+ raise TProtocol.TProtocolException(message='Required field why is unset!')
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class SchemaDisagreementException(Exception):
+ """
+ schemas are not in agreement across all nodes
+ """
+
+ thrift_spec = (
+ )
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('SchemaDisagreementException')
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __str__(self):
+ return repr(self)
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnParent:
+ """
+ ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine
+ ColumnParent as ColumnPath + '/../'.
+
+ See also ColumnPath
+
+ Attributes:
+ - column_family
+ - super_column
+ """
+
+ thrift_spec = (
+ None, # 0
+ None, # 1
+ None, # 2
+ (3, TType.STRING, 'column_family', None, None, ), # 3
+ (4, TType.STRING, 'super_column', None, None, ), # 4
+ )
+
+ def __init__(self, column_family=None, super_column=None,):
+ self.column_family = column_family
+ self.super_column = super_column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 3:
+ if ftype == TType.STRING:
+ self.column_family = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ColumnParent')
+ if self.column_family != None:
+ oprot.writeFieldBegin('column_family', TType.STRING, 3)
+ oprot.writeString(self.column_family)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 4)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.column_family is None:
+ raise TProtocol.TProtocolException(message='Required field column_family is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnPath:
+ """
+ The ColumnPath is the path to a single column in Cassandra. It might make sense to think of ColumnPath and
+ ColumnParent in terms of a directory structure.
+
+ ColumnPath is used to looking up a single column.
+
+ @param column_family. The name of the CF of the column being looked up.
+ @param super_column. The super column name.
+ @param column. The column name.
+
+ Attributes:
+ - column_family
+ - super_column
+ - column
+ """
+
+ thrift_spec = (
+ None, # 0
+ None, # 1
+ None, # 2
+ (3, TType.STRING, 'column_family', None, None, ), # 3
+ (4, TType.STRING, 'super_column', None, None, ), # 4
+ (5, TType.STRING, 'column', None, None, ), # 5
+ )
+
+ def __init__(self, column_family=None, super_column=None, column=None,):
+ self.column_family = column_family
+ self.super_column = super_column
+ self.column = column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 3:
+ if ftype == TType.STRING:
+ self.column_family = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRING:
+ self.column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ColumnPath')
+ if self.column_family != None:
+ oprot.writeFieldBegin('column_family', TType.STRING, 3)
+ oprot.writeString(self.column_family)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 4)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ if self.column != None:
+ oprot.writeFieldBegin('column', TType.STRING, 5)
+ oprot.writeString(self.column)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.column_family is None:
+ raise TProtocol.TProtocolException(message='Required field column_family is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CounterColumn:
+ """
+ Attributes:
+ - name
+ - value
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.I64, 'value', None, None, ), # 2
+ )
+
+ def __init__(self, name=None, value=None,):
+ self.name = name
+ self.value = value
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I64:
+ self.value = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CounterColumn')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.value != None:
+ oprot.writeFieldBegin('value', TType.I64, 2)
+ oprot.writeI64(self.value)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ if self.value is None:
+ raise TProtocol.TProtocolException(message='Required field value is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CounterSuperColumn:
+ """
+ Attributes:
+ - name
+ - columns
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.LIST, 'columns', (TType.STRUCT,(CounterColumn, CounterColumn.thrift_spec)), None, ), # 2
+ )
+
+ def __init__(self, name=None, columns=None,):
+ self.name = name
+ self.columns = columns
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.columns = []
+ (_etype10, _size7) = iprot.readListBegin()
+ for _i11 in xrange(_size7):
+ _elem12 = CounterColumn()
+ _elem12.read(iprot)
+ self.columns.append(_elem12)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CounterSuperColumn')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.columns != None:
+ oprot.writeFieldBegin('columns', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.columns))
+ for iter13 in self.columns:
+ iter13.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ if self.columns is None:
+ raise TProtocol.TProtocolException(message='Required field columns is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Counter:
+ """
+ Attributes:
+ - column
+ - super_column
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'column', (CounterColumn, CounterColumn.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'super_column', (CounterSuperColumn, CounterSuperColumn.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, column=None, super_column=None,):
+ self.column = column
+ self.super_column = super_column
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.column = CounterColumn()
+ self.column.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.super_column = CounterSuperColumn()
+ self.super_column.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Counter')
+ if self.column != None:
+ oprot.writeFieldBegin('column', TType.STRUCT, 1)
+ self.column.write(oprot)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRUCT, 2)
+ self.super_column.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class SliceRange:
+ """
+ A slice range is a structure that stores basic range, ordering and limit information for a query that will return
+ multiple columns. It could be thought of as Cassandra's version of LIMIT and ORDER BY
+
+ @param start. The column name to start the slice with. This attribute is not required, though there is no default value,
+ and can be safely set to '', i.e., an empty byte array, to start with the first column name. Otherwise, it
+ must a valid value under the rules of the Comparator defined for the given ColumnFamily.
+ @param finish. The column name to stop the slice at. This attribute is not required, though there is no default value,
+ and can be safely set to an empty byte array to not stop until 'count' results are seen. Otherwise, it
+ must also be a valid value to the ColumnFamily Comparator.
+ @param reversed. Whether the results should be ordered in reversed order. Similar to ORDER BY blah DESC in SQL.
+ @param count. How many columns to return. Similar to LIMIT in SQL. May be arbitrarily large, but Thrift will
+ materialize the whole result into memory before returning it to the client, so be aware that you may
+ be better served by iterating through slices by passing the last value of one call in as the 'start'
+ of the next instead of increasing 'count' arbitrarily large.
+
+ Attributes:
+ - start
+ - finish
+ - reversed
+ - count
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'start', None, None, ), # 1
+ (2, TType.STRING, 'finish', None, None, ), # 2
+ (3, TType.BOOL, 'reversed', None, False, ), # 3
+ (4, TType.I32, 'count', None, 100, ), # 4
+ )
+
+ def __init__(self, start=None, finish=None, reversed=thrift_spec[3][4], count=thrift_spec[4][4],):
+ self.start = start
+ self.finish = finish
+ self.reversed = reversed
+ self.count = count
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.start = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.finish = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.BOOL:
+ self.reversed = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.count = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('SliceRange')
+ if self.start != None:
+ oprot.writeFieldBegin('start', TType.STRING, 1)
+ oprot.writeString(self.start)
+ oprot.writeFieldEnd()
+ if self.finish != None:
+ oprot.writeFieldBegin('finish', TType.STRING, 2)
+ oprot.writeString(self.finish)
+ oprot.writeFieldEnd()
+ if self.reversed != None:
+ oprot.writeFieldBegin('reversed', TType.BOOL, 3)
+ oprot.writeBool(self.reversed)
+ oprot.writeFieldEnd()
+ if self.count != None:
+ oprot.writeFieldBegin('count', TType.I32, 4)
+ oprot.writeI32(self.count)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.start is None:
+ raise TProtocol.TProtocolException(message='Required field start is unset!')
+ if self.finish is None:
+ raise TProtocol.TProtocolException(message='Required field finish is unset!')
+ if self.reversed is None:
+ raise TProtocol.TProtocolException(message='Required field reversed is unset!')
+ if self.count is None:
+ raise TProtocol.TProtocolException(message='Required field count is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class SlicePredicate:
+ """
+ A SlicePredicate is similar to a mathematic predicate (see http://en.wikipedia.org/wiki/Predicate_(mathematical_logic)),
+ which is described as "a property that the elements of a set have in common."
+
+ SlicePredicate's in Cassandra are described with either a list of column_names or a SliceRange. If column_names is
+ specified, slice_range is ignored.
+
+ @param column_name. A list of column names to retrieve. This can be used similar to Memcached's "multi-get" feature
+ to fetch N known column names. For instance, if you know you wish to fetch columns 'Joe', 'Jack',
+ and 'Jim' you can pass those column names as a list to fetch all three at once.
+ @param slice_range. A SliceRange describing how to range, order, and/or limit the slice.
+
+ Attributes:
+ - column_names
+ - slice_range
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'column_names', (TType.STRING,None), None, ), # 1
+ (2, TType.STRUCT, 'slice_range', (SliceRange, SliceRange.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, column_names=None, slice_range=None,):
+ self.column_names = column_names
+ self.slice_range = slice_range
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.column_names = []
+ (_etype17, _size14) = iprot.readListBegin()
+ for _i18 in xrange(_size14):
+ _elem19 = iprot.readString();
+ self.column_names.append(_elem19)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.slice_range = SliceRange()
+ self.slice_range.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('SlicePredicate')
+ if self.column_names != None:
+ oprot.writeFieldBegin('column_names', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRING, len(self.column_names))
+ for iter20 in self.column_names:
+ oprot.writeString(iter20)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.slice_range != None:
+ oprot.writeFieldBegin('slice_range', TType.STRUCT, 2)
+ self.slice_range.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class IndexExpression:
+ """
+ Attributes:
+ - column_name
+ - op
+ - value
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'column_name', None, None, ), # 1
+ (2, TType.I32, 'op', None, None, ), # 2
+ (3, TType.STRING, 'value', None, None, ), # 3
+ )
+
+ def __init__(self, column_name=None, op=None, value=None,):
+ self.column_name = column_name
+ self.op = op
+ self.value = value
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.column_name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.op = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.value = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('IndexExpression')
+ if self.column_name != None:
+ oprot.writeFieldBegin('column_name', TType.STRING, 1)
+ oprot.writeString(self.column_name)
+ oprot.writeFieldEnd()
+ if self.op != None:
+ oprot.writeFieldBegin('op', TType.I32, 2)
+ oprot.writeI32(self.op)
+ oprot.writeFieldEnd()
+ if self.value != None:
+ oprot.writeFieldBegin('value', TType.STRING, 3)
+ oprot.writeString(self.value)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.column_name is None:
+ raise TProtocol.TProtocolException(message='Required field column_name is unset!')
+ if self.op is None:
+ raise TProtocol.TProtocolException(message='Required field op is unset!')
+ if self.value is None:
+ raise TProtocol.TProtocolException(message='Required field value is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class IndexClause:
+ """
+ Attributes:
+ - expressions
+ - start_key
+ - count
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'expressions', (TType.STRUCT,(IndexExpression, IndexExpression.thrift_spec)), None, ), # 1
+ (2, TType.STRING, 'start_key', None, None, ), # 2
+ (3, TType.I32, 'count', None, 100, ), # 3
+ )
+
+ def __init__(self, expressions=None, start_key=None, count=thrift_spec[3][4],):
+ self.expressions = expressions
+ self.start_key = start_key
+ self.count = count
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.expressions = []
+ (_etype24, _size21) = iprot.readListBegin()
+ for _i25 in xrange(_size21):
+ _elem26 = IndexExpression()
+ _elem26.read(iprot)
+ self.expressions.append(_elem26)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.start_key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.count = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('IndexClause')
+ if self.expressions != None:
+ oprot.writeFieldBegin('expressions', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRUCT, len(self.expressions))
+ for iter27 in self.expressions:
+ iter27.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.start_key != None:
+ oprot.writeFieldBegin('start_key', TType.STRING, 2)
+ oprot.writeString(self.start_key)
+ oprot.writeFieldEnd()
+ if self.count != None:
+ oprot.writeFieldBegin('count', TType.I32, 3)
+ oprot.writeI32(self.count)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.expressions is None:
+ raise TProtocol.TProtocolException(message='Required field expressions is unset!')
+ if self.start_key is None:
+ raise TProtocol.TProtocolException(message='Required field start_key is unset!')
+ if self.count is None:
+ raise TProtocol.TProtocolException(message='Required field count is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class KeyRange:
+ """
+ The semantics of start keys and tokens are slightly different.
+ Keys are start-inclusive; tokens are start-exclusive. Token
+ ranges may also wrap -- that is, the end token may be less
+ than the start one. Thus, a range from keyX to keyX is a
+ one-element range, but a range from tokenY to tokenY is the
+ full ring.
+
+ Attributes:
+ - start_key
+ - end_key
+ - start_token
+ - end_token
+ - count
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'start_key', None, None, ), # 1
+ (2, TType.STRING, 'end_key', None, None, ), # 2
+ (3, TType.STRING, 'start_token', None, None, ), # 3
+ (4, TType.STRING, 'end_token', None, None, ), # 4
+ (5, TType.I32, 'count', None, 100, ), # 5
+ )
+
+ def __init__(self, start_key=None, end_key=None, start_token=None, end_token=None, count=thrift_spec[5][4],):
+ self.start_key = start_key
+ self.end_key = end_key
+ self.start_token = start_token
+ self.end_token = end_token
+ self.count = count
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.start_key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.end_key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.start_token = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.end_token = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.I32:
+ self.count = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('KeyRange')
+ if self.start_key != None:
+ oprot.writeFieldBegin('start_key', TType.STRING, 1)
+ oprot.writeString(self.start_key)
+ oprot.writeFieldEnd()
+ if self.end_key != None:
+ oprot.writeFieldBegin('end_key', TType.STRING, 2)
+ oprot.writeString(self.end_key)
+ oprot.writeFieldEnd()
+ if self.start_token != None:
+ oprot.writeFieldBegin('start_token', TType.STRING, 3)
+ oprot.writeString(self.start_token)
+ oprot.writeFieldEnd()
+ if self.end_token != None:
+ oprot.writeFieldBegin('end_token', TType.STRING, 4)
+ oprot.writeString(self.end_token)
+ oprot.writeFieldEnd()
+ if self.count != None:
+ oprot.writeFieldBegin('count', TType.I32, 5)
+ oprot.writeI32(self.count)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.count is None:
+ raise TProtocol.TProtocolException(message='Required field count is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class KeySlice:
+ """
+ A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
+
+ @param key. a row key
+ @param columns. List of data represented by the key. Typically, the list is pared down to only the columns specified by
+ a SlicePredicate.
+
+ Attributes:
+ - key
+ - columns
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.LIST, 'columns', (TType.STRUCT,(ColumnOrSuperColumn, ColumnOrSuperColumn.thrift_spec)), None, ), # 2
+ )
+
+ def __init__(self, key=None, columns=None,):
+ self.key = key
+ self.columns = columns
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.columns = []
+ (_etype31, _size28) = iprot.readListBegin()
+ for _i32 in xrange(_size28):
+ _elem33 = ColumnOrSuperColumn()
+ _elem33.read(iprot)
+ self.columns.append(_elem33)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('KeySlice')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.columns != None:
+ oprot.writeFieldBegin('columns', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.columns))
+ for iter34 in self.columns:
+ iter34.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.columns is None:
+ raise TProtocol.TProtocolException(message='Required field columns is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class KeyCount:
+ """
+ Attributes:
+ - key
+ - count
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.I32, 'count', None, None, ), # 2
+ )
+
+ def __init__(self, key=None, count=None,):
+ self.key = key
+ self.count = count
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.count = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('KeyCount')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.count != None:
+ oprot.writeFieldBegin('count', TType.I32, 2)
+ oprot.writeI32(self.count)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.count is None:
+ raise TProtocol.TProtocolException(message='Required field count is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Deletion:
+ """
+ Attributes:
+ - timestamp
+ - super_column
+ - predicate
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I64, 'timestamp', None, None, ), # 1
+ (2, TType.STRING, 'super_column', None, None, ), # 2
+ (3, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 3
+ )
+
+ def __init__(self, timestamp=None, super_column=None, predicate=None,):
+ self.timestamp = timestamp
+ self.super_column = super_column
+ self.predicate = predicate
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I64:
+ self.timestamp = iprot.readI64();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Deletion')
+ if self.timestamp != None:
+ oprot.writeFieldBegin('timestamp', TType.I64, 1)
+ oprot.writeI64(self.timestamp)
+ oprot.writeFieldEnd()
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 2)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 3)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.timestamp is None:
+ raise TProtocol.TProtocolException(message='Required field timestamp is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class Mutation:
+ """
+ A Mutation is either an insert, represented by filling column_or_supercolumn, or a deletion, represented by filling the deletion attribute.
+ @param column_or_supercolumn. An insert to a column or supercolumn
+ @param deletion. A deletion of a column or supercolumn
+
+ Attributes:
+ - column_or_supercolumn
+ - deletion
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'column_or_supercolumn', (ColumnOrSuperColumn, ColumnOrSuperColumn.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'deletion', (Deletion, Deletion.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, column_or_supercolumn=None, deletion=None,):
+ self.column_or_supercolumn = column_or_supercolumn
+ self.deletion = deletion
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.column_or_supercolumn = ColumnOrSuperColumn()
+ self.column_or_supercolumn.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.deletion = Deletion()
+ self.deletion.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('Mutation')
+ if self.column_or_supercolumn != None:
+ oprot.writeFieldBegin('column_or_supercolumn', TType.STRUCT, 1)
+ self.column_or_supercolumn.write(oprot)
+ oprot.writeFieldEnd()
+ if self.deletion != None:
+ oprot.writeFieldBegin('deletion', TType.STRUCT, 2)
+ self.deletion.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CounterDeletion:
+ """
+ Attributes:
+ - super_column
+ - predicate
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'super_column', None, None, ), # 1
+ (2, TType.STRUCT, 'predicate', (SlicePredicate, SlicePredicate.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, super_column=None, predicate=None,):
+ self.super_column = super_column
+ self.predicate = predicate
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.super_column = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.predicate = SlicePredicate()
+ self.predicate.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CounterDeletion')
+ if self.super_column != None:
+ oprot.writeFieldBegin('super_column', TType.STRING, 1)
+ oprot.writeString(self.super_column)
+ oprot.writeFieldEnd()
+ if self.predicate != None:
+ oprot.writeFieldBegin('predicate', TType.STRUCT, 2)
+ self.predicate.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CounterMutation:
+ """
+ A CounterMutation is either an insert, represented by filling counter, or a deletion, represented by filling the deletion attribute.
+ @param counter. An insert to a counter column or supercolumn
+ @param deletion. A deletion of a counter column or supercolumn
+
+ Attributes:
+ - counter
+ - deletion
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRUCT, 'counter', (Counter, Counter.thrift_spec), None, ), # 1
+ (2, TType.STRUCT, 'deletion', (CounterDeletion, CounterDeletion.thrift_spec), None, ), # 2
+ )
+
+ def __init__(self, counter=None, deletion=None,):
+ self.counter = counter
+ self.deletion = deletion
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRUCT:
+ self.counter = Counter()
+ self.counter.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRUCT:
+ self.deletion = CounterDeletion()
+ self.deletion.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CounterMutation')
+ if self.counter != None:
+ oprot.writeFieldBegin('counter', TType.STRUCT, 1)
+ self.counter.write(oprot)
+ oprot.writeFieldEnd()
+ if self.deletion != None:
+ oprot.writeFieldBegin('deletion', TType.STRUCT, 2)
+ self.deletion.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class TokenRange:
+ """
+ Attributes:
+ - start_token
+ - end_token
+ - endpoints
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'start_token', None, None, ), # 1
+ (2, TType.STRING, 'end_token', None, None, ), # 2
+ (3, TType.LIST, 'endpoints', (TType.STRING,None), None, ), # 3
+ )
+
+ def __init__(self, start_token=None, end_token=None, endpoints=None,):
+ self.start_token = start_token
+ self.end_token = end_token
+ self.endpoints = endpoints
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.start_token = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.end_token = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.LIST:
+ self.endpoints = []
+ (_etype38, _size35) = iprot.readListBegin()
+ for _i39 in xrange(_size35):
+ _elem40 = iprot.readString();
+ self.endpoints.append(_elem40)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TokenRange')
+ if self.start_token != None:
+ oprot.writeFieldBegin('start_token', TType.STRING, 1)
+ oprot.writeString(self.start_token)
+ oprot.writeFieldEnd()
+ if self.end_token != None:
+ oprot.writeFieldBegin('end_token', TType.STRING, 2)
+ oprot.writeString(self.end_token)
+ oprot.writeFieldEnd()
+ if self.endpoints != None:
+ oprot.writeFieldBegin('endpoints', TType.LIST, 3)
+ oprot.writeListBegin(TType.STRING, len(self.endpoints))
+ for iter41 in self.endpoints:
+ oprot.writeString(iter41)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.start_token is None:
+ raise TProtocol.TProtocolException(message='Required field start_token is unset!')
+ if self.end_token is None:
+ raise TProtocol.TProtocolException(message='Required field end_token is unset!')
+ if self.endpoints is None:
+ raise TProtocol.TProtocolException(message='Required field endpoints is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class AuthenticationRequest:
+ """
+ Authentication requests can contain any data, dependent on the IAuthenticator used
+
+ Attributes:
+ - credentials
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.MAP, 'credentials', (TType.STRING,None,TType.STRING,None), None, ), # 1
+ )
+
+ def __init__(self, credentials=None,):
+ self.credentials = credentials
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.MAP:
+ self.credentials = {}
+ (_ktype43, _vtype44, _size42 ) = iprot.readMapBegin()
+ for _i46 in xrange(_size42):
+ _key47 = iprot.readString();
+ _val48 = iprot.readString();
+ self.credentials[_key47] = _val48
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('AuthenticationRequest')
+ if self.credentials != None:
+ oprot.writeFieldBegin('credentials', TType.MAP, 1)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.credentials))
+ for kiter49,viter50 in self.credentials.items():
+ oprot.writeString(kiter49)
+ oprot.writeString(viter50)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.credentials is None:
+ raise TProtocol.TProtocolException(message='Required field credentials is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class ColumnDef:
+ """
+ Attributes:
+ - name
+ - validation_class
+ - index_type
+ - index_name
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.STRING, 'validation_class', None, None, ), # 2
+ (3, TType.I32, 'index_type', None, None, ), # 3
+ (4, TType.STRING, 'index_name', None, None, ), # 4
+ )
+
+ def __init__(self, name=None, validation_class=None, index_type=None, index_name=None,):
+ self.name = name
+ self.validation_class = validation_class
+ self.index_type = index_type
+ self.index_name = index_name
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.validation_class = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.index_type = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRING:
+ self.index_name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('ColumnDef')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.validation_class != None:
+ oprot.writeFieldBegin('validation_class', TType.STRING, 2)
+ oprot.writeString(self.validation_class)
+ oprot.writeFieldEnd()
+ if self.index_type != None:
+ oprot.writeFieldBegin('index_type', TType.I32, 3)
+ oprot.writeI32(self.index_type)
+ oprot.writeFieldEnd()
+ if self.index_name != None:
+ oprot.writeFieldBegin('index_name', TType.STRING, 4)
+ oprot.writeString(self.index_name)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ if self.validation_class is None:
+ raise TProtocol.TProtocolException(message='Required field validation_class is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CfDef:
+ """
+ Attributes:
+ - keyspace
+ - name
+ - column_type
+ - comparator_type
+ - subcomparator_type
+ - comment
+ - row_cache_size
+ - key_cache_size
+ - read_repair_chance
+ - column_metadata
+ - gc_grace_seconds
+ - default_validation_class
+ - id
+ - min_compaction_threshold
+ - max_compaction_threshold
+ - row_cache_save_period_in_seconds
+ - key_cache_save_period_in_seconds
+ - memtable_flush_after_mins
+ - memtable_throughput_in_mb
+ - memtable_operations_in_millions
+ - replicate_on_write
+ - merge_shards_chance
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'keyspace', None, None, ), # 1
+ (2, TType.STRING, 'name', None, None, ), # 2
+ (3, TType.STRING, 'column_type', None, "Standard", ), # 3
+ None, # 4
+ (5, TType.STRING, 'comparator_type', None, "BytesType", ), # 5
+ (6, TType.STRING, 'subcomparator_type', None, None, ), # 6
+ None, # 7
+ (8, TType.STRING, 'comment', None, None, ), # 8
+ (9, TType.DOUBLE, 'row_cache_size', None, 0, ), # 9
+ None, # 10
+ (11, TType.DOUBLE, 'key_cache_size', None, 200000, ), # 11
+ (12, TType.DOUBLE, 'read_repair_chance', None, 1, ), # 12
+ (13, TType.LIST, 'column_metadata', (TType.STRUCT,(ColumnDef, ColumnDef.thrift_spec)), None, ), # 13
+ (14, TType.I32, 'gc_grace_seconds', None, None, ), # 14
+ (15, TType.STRING, 'default_validation_class', None, None, ), # 15
+ (16, TType.I32, 'id', None, None, ), # 16
+ (17, TType.I32, 'min_compaction_threshold', None, None, ), # 17
+ (18, TType.I32, 'max_compaction_threshold', None, None, ), # 18
+ (19, TType.I32, 'row_cache_save_period_in_seconds', None, None, ), # 19
+ (20, TType.I32, 'key_cache_save_period_in_seconds', None, None, ), # 20
+ (21, TType.I32, 'memtable_flush_after_mins', None, None, ), # 21
+ (22, TType.I32, 'memtable_throughput_in_mb', None, None, ), # 22
+ (23, TType.DOUBLE, 'memtable_operations_in_millions', None, None, ), # 23
+ (24, TType.BOOL, 'replicate_on_write', None, False, ), # 24
+ (25, TType.DOUBLE, 'merge_shards_chance', None, None, ), # 25
+ )
+
+ def __init__(self, keyspace=None, name=None, column_type=thrift_spec[3][4], comparator_type=thrift_spec[5][4], subcomparator_type=None, comment=None, row_cache_size=thrift_spec[9][4], key_cache_size=thrift_spec[11][4], read_repair_chance=thrift_spec[12][4], column_metadata=None, gc_grace_seconds=None, default_validation_class=None, id=None, min_compaction_threshold=None, max_compaction_threshold=None, row_cache_save_period_in_seconds=None, key_cache_save_period_in_seconds=None, memtable_flush_after_mins=None, memtable_throughput_in_mb=None, memtable_operations_in_millions=None, replicate_on_write=thrift_spec[24][4], merge_shards_chance=None,):
+ self.keyspace = keyspace
+ self.name = name
+ self.column_type = column_type
+ self.comparator_type = comparator_type
+ self.subcomparator_type = subcomparator_type
+ self.comment = comment
+ self.row_cache_size = row_cache_size
+ self.key_cache_size = key_cache_size
+ self.read_repair_chance = read_repair_chance
+ self.column_metadata = column_metadata
+ self.gc_grace_seconds = gc_grace_seconds
+ self.default_validation_class = default_validation_class
+ self.id = id
+ self.min_compaction_threshold = min_compaction_threshold
+ self.max_compaction_threshold = max_compaction_threshold
+ self.row_cache_save_period_in_seconds = row_cache_save_period_in_seconds
+ self.key_cache_save_period_in_seconds = key_cache_save_period_in_seconds
+ self.memtable_flush_after_mins = memtable_flush_after_mins
+ self.memtable_throughput_in_mb = memtable_throughput_in_mb
+ self.memtable_operations_in_millions = memtable_operations_in_millions
+ self.replicate_on_write = replicate_on_write
+ self.merge_shards_chance = merge_shards_chance
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.keyspace = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.column_type = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRING:
+ self.comparator_type = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.STRING:
+ self.subcomparator_type = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 8:
+ if ftype == TType.STRING:
+ self.comment = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 9:
+ if ftype == TType.DOUBLE:
+ self.row_cache_size = iprot.readDouble();
+ else:
+ iprot.skip(ftype)
+ elif fid == 11:
+ if ftype == TType.DOUBLE:
+ self.key_cache_size = iprot.readDouble();
+ else:
+ iprot.skip(ftype)
+ elif fid == 12:
+ if ftype == TType.DOUBLE:
+ self.read_repair_chance = iprot.readDouble();
+ else:
+ iprot.skip(ftype)
+ elif fid == 13:
+ if ftype == TType.LIST:
+ self.column_metadata = []
+ (_etype54, _size51) = iprot.readListBegin()
+ for _i55 in xrange(_size51):
+ _elem56 = ColumnDef()
+ _elem56.read(iprot)
+ self.column_metadata.append(_elem56)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 14:
+ if ftype == TType.I32:
+ self.gc_grace_seconds = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 15:
+ if ftype == TType.STRING:
+ self.default_validation_class = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 16:
+ if ftype == TType.I32:
+ self.id = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 17:
+ if ftype == TType.I32:
+ self.min_compaction_threshold = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 18:
+ if ftype == TType.I32:
+ self.max_compaction_threshold = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 19:
+ if ftype == TType.I32:
+ self.row_cache_save_period_in_seconds = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 20:
+ if ftype == TType.I32:
+ self.key_cache_save_period_in_seconds = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 21:
+ if ftype == TType.I32:
+ self.memtable_flush_after_mins = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 22:
+ if ftype == TType.I32:
+ self.memtable_throughput_in_mb = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 23:
+ if ftype == TType.DOUBLE:
+ self.memtable_operations_in_millions = iprot.readDouble();
+ else:
+ iprot.skip(ftype)
+ elif fid == 24:
+ if ftype == TType.BOOL:
+ self.replicate_on_write = iprot.readBool();
+ else:
+ iprot.skip(ftype)
+ elif fid == 25:
+ if ftype == TType.DOUBLE:
+ self.merge_shards_chance = iprot.readDouble();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CfDef')
+ if self.keyspace != None:
+ oprot.writeFieldBegin('keyspace', TType.STRING, 1)
+ oprot.writeString(self.keyspace)
+ oprot.writeFieldEnd()
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 2)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.column_type != None:
+ oprot.writeFieldBegin('column_type', TType.STRING, 3)
+ oprot.writeString(self.column_type)
+ oprot.writeFieldEnd()
+ if self.comparator_type != None:
+ oprot.writeFieldBegin('comparator_type', TType.STRING, 5)
+ oprot.writeString(self.comparator_type)
+ oprot.writeFieldEnd()
+ if self.subcomparator_type != None:
+ oprot.writeFieldBegin('subcomparator_type', TType.STRING, 6)
+ oprot.writeString(self.subcomparator_type)
+ oprot.writeFieldEnd()
+ if self.comment != None:
+ oprot.writeFieldBegin('comment', TType.STRING, 8)
+ oprot.writeString(self.comment)
+ oprot.writeFieldEnd()
+ if self.row_cache_size != None:
+ oprot.writeFieldBegin('row_cache_size', TType.DOUBLE, 9)
+ oprot.writeDouble(self.row_cache_size)
+ oprot.writeFieldEnd()
+ if self.key_cache_size != None:
+ oprot.writeFieldBegin('key_cache_size', TType.DOUBLE, 11)
+ oprot.writeDouble(self.key_cache_size)
+ oprot.writeFieldEnd()
+ if self.read_repair_chance != None:
+ oprot.writeFieldBegin('read_repair_chance', TType.DOUBLE, 12)
+ oprot.writeDouble(self.read_repair_chance)
+ oprot.writeFieldEnd()
+ if self.column_metadata != None:
+ oprot.writeFieldBegin('column_metadata', TType.LIST, 13)
+ oprot.writeListBegin(TType.STRUCT, len(self.column_metadata))
+ for iter57 in self.column_metadata:
+ iter57.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.gc_grace_seconds != None:
+ oprot.writeFieldBegin('gc_grace_seconds', TType.I32, 14)
+ oprot.writeI32(self.gc_grace_seconds)
+ oprot.writeFieldEnd()
+ if self.default_validation_class != None:
+ oprot.writeFieldBegin('default_validation_class', TType.STRING, 15)
+ oprot.writeString(self.default_validation_class)
+ oprot.writeFieldEnd()
+ if self.id != None:
+ oprot.writeFieldBegin('id', TType.I32, 16)
+ oprot.writeI32(self.id)
+ oprot.writeFieldEnd()
+ if self.min_compaction_threshold != None:
+ oprot.writeFieldBegin('min_compaction_threshold', TType.I32, 17)
+ oprot.writeI32(self.min_compaction_threshold)
+ oprot.writeFieldEnd()
+ if self.max_compaction_threshold != None:
+ oprot.writeFieldBegin('max_compaction_threshold', TType.I32, 18)
+ oprot.writeI32(self.max_compaction_threshold)
+ oprot.writeFieldEnd()
+ if self.row_cache_save_period_in_seconds != None:
+ oprot.writeFieldBegin('row_cache_save_period_in_seconds', TType.I32, 19)
+ oprot.writeI32(self.row_cache_save_period_in_seconds)
+ oprot.writeFieldEnd()
+ if self.key_cache_save_period_in_seconds != None:
+ oprot.writeFieldBegin('key_cache_save_period_in_seconds', TType.I32, 20)
+ oprot.writeI32(self.key_cache_save_period_in_seconds)
+ oprot.writeFieldEnd()
+ if self.memtable_flush_after_mins != None:
+ oprot.writeFieldBegin('memtable_flush_after_mins', TType.I32, 21)
+ oprot.writeI32(self.memtable_flush_after_mins)
+ oprot.writeFieldEnd()
+ if self.memtable_throughput_in_mb != None:
+ oprot.writeFieldBegin('memtable_throughput_in_mb', TType.I32, 22)
+ oprot.writeI32(self.memtable_throughput_in_mb)
+ oprot.writeFieldEnd()
+ if self.memtable_operations_in_millions != None:
+ oprot.writeFieldBegin('memtable_operations_in_millions', TType.DOUBLE, 23)
+ oprot.writeDouble(self.memtable_operations_in_millions)
+ oprot.writeFieldEnd()
+ if self.replicate_on_write != None:
+ oprot.writeFieldBegin('replicate_on_write', TType.BOOL, 24)
+ oprot.writeBool(self.replicate_on_write)
+ oprot.writeFieldEnd()
+ if self.merge_shards_chance != None:
+ oprot.writeFieldBegin('merge_shards_chance', TType.DOUBLE, 25)
+ oprot.writeDouble(self.merge_shards_chance)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.keyspace is None:
+ raise TProtocol.TProtocolException(message='Required field keyspace is unset!')
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class KsDef:
+ """
+ Attributes:
+ - name
+ - strategy_class
+ - strategy_options
+ - replication_factor
+ - cf_defs
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'name', None, None, ), # 1
+ (2, TType.STRING, 'strategy_class', None, None, ), # 2
+ (3, TType.MAP, 'strategy_options', (TType.STRING,None,TType.STRING,None), None, ), # 3
+ (4, TType.I32, 'replication_factor', None, None, ), # 4
+ (5, TType.LIST, 'cf_defs', (TType.STRUCT,(CfDef, CfDef.thrift_spec)), None, ), # 5
+ )
+
+ def __init__(self, name=None, strategy_class=None, strategy_options=None, replication_factor=None, cf_defs=None,):
+ self.name = name
+ self.strategy_class = strategy_class
+ self.strategy_options = strategy_options
+ self.replication_factor = replication_factor
+ self.cf_defs = cf_defs
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.name = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.STRING:
+ self.strategy_class = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.MAP:
+ self.strategy_options = {}
+ (_ktype59, _vtype60, _size58 ) = iprot.readMapBegin()
+ for _i62 in xrange(_size58):
+ _key63 = iprot.readString();
+ _val64 = iprot.readString();
+ self.strategy_options[_key63] = _val64
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.replication_factor = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.LIST:
+ self.cf_defs = []
+ (_etype68, _size65) = iprot.readListBegin()
+ for _i69 in xrange(_size65):
+ _elem70 = CfDef()
+ _elem70.read(iprot)
+ self.cf_defs.append(_elem70)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('KsDef')
+ if self.name != None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.strategy_class != None:
+ oprot.writeFieldBegin('strategy_class', TType.STRING, 2)
+ oprot.writeString(self.strategy_class)
+ oprot.writeFieldEnd()
+ if self.strategy_options != None:
+ oprot.writeFieldBegin('strategy_options', TType.MAP, 3)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.strategy_options))
+ for kiter71,viter72 in self.strategy_options.items():
+ oprot.writeString(kiter71)
+ oprot.writeString(viter72)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.replication_factor != None:
+ oprot.writeFieldBegin('replication_factor', TType.I32, 4)
+ oprot.writeI32(self.replication_factor)
+ oprot.writeFieldEnd()
+ if self.cf_defs != None:
+ oprot.writeFieldBegin('cf_defs', TType.LIST, 5)
+ oprot.writeListBegin(TType.STRUCT, len(self.cf_defs))
+ for iter73 in self.cf_defs:
+ iter73.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ if self.strategy_class is None:
+ raise TProtocol.TProtocolException(message='Required field strategy_class is unset!')
+ if self.replication_factor is None:
+ raise TProtocol.TProtocolException(message='Required field replication_factor is unset!')
+ if self.cf_defs is None:
+ raise TProtocol.TProtocolException(message='Required field cf_defs is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CqlRow:
+ """
+ Row returned from a CQL query
+
+ Attributes:
+ - key
+ - columns
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'key', None, None, ), # 1
+ (2, TType.LIST, 'columns', (TType.STRUCT,(Column, Column.thrift_spec)), None, ), # 2
+ )
+
+ def __init__(self, key=None, columns=None,):
+ self.key = key
+ self.columns = columns
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.key = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.columns = []
+ (_etype77, _size74) = iprot.readListBegin()
+ for _i78 in xrange(_size74):
+ _elem79 = Column()
+ _elem79.read(iprot)
+ self.columns.append(_elem79)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CqlRow')
+ if self.key != None:
+ oprot.writeFieldBegin('key', TType.STRING, 1)
+ oprot.writeString(self.key)
+ oprot.writeFieldEnd()
+ if self.columns != None:
+ oprot.writeFieldBegin('columns', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.columns))
+ for iter80 in self.columns:
+ iter80.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.key is None:
+ raise TProtocol.TProtocolException(message='Required field key is unset!')
+ if self.columns is None:
+ raise TProtocol.TProtocolException(message='Required field columns is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class CqlResult:
+ """
+ Attributes:
+ - type
+ - rows
+ - num
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.I32, 'type', None, None, ), # 1
+ (2, TType.LIST, 'rows', (TType.STRUCT,(CqlRow, CqlRow.thrift_spec)), None, ), # 2
+ (3, TType.I32, 'num', None, None, ), # 3
+ )
+
+ def __init__(self, type=None, rows=None, num=None,):
+ self.type = type
+ self.rows = rows
+ self.num = num
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.I32:
+ self.type = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.rows = []
+ (_etype84, _size81) = iprot.readListBegin()
+ for _i85 in xrange(_size81):
+ _elem86 = CqlRow()
+ _elem86.read(iprot)
+ self.rows.append(_elem86)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.I32:
+ self.num = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('CqlResult')
+ if self.type != None:
+ oprot.writeFieldBegin('type', TType.I32, 1)
+ oprot.writeI32(self.type)
+ oprot.writeFieldEnd()
+ if self.rows != None:
+ oprot.writeFieldBegin('rows', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.rows))
+ for iter87 in self.rows:
+ iter87.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.num != None:
+ oprot.writeFieldBegin('num', TType.I32, 3)
+ oprot.writeI32(self.num)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+ def validate(self):
+ if self.type is None:
+ raise TProtocol.TProtocolException(message='Required field type is unset!')
+ return
+
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
diff --git a/drivers/txpy/txcql/connection.py b/drivers/txpy/txcql/connection.py
index 7574848dcd..ec94758c24 100644
--- a/drivers/txpy/txcql/connection.py
+++ b/drivers/txpy/txcql/connection.py
@@ -20,11 +20,12 @@ from thrift.transport import TTwisted
from thrift.protocol import TBinaryProtocol
from thrift.Thrift import TApplicationException
from twisted.internet import defer, reactor
+from cassandra import Cassandra
+from cassandra.ttypes import Compression, InvalidRequestException, \
+ CqlResultType, AuthenticationRequest, \
+ SchemaDisagreementException
+
try:
- from cassandra import Cassandra
- from cassandra.ttypes import Compression, InvalidRequestException, \
- CqlResultType, AuthenticationRequest, \
- SchemaDisagreementException
from cql.errors import CQLException, InvalidCompressionScheme
from cql.marshal import prepare
from cql.decoders import SchemaDecoder
@@ -33,21 +34,10 @@ try:
except ImportError:
# Hack to run from a source tree
import sys
- sys.path.append(join(abspath(dirname(__file__)),
- '..',
- '..',
- '..',
- 'interface',
- 'thrift',
- 'gen-py.twisted'))
sys.path.append(join(abspath(dirname(__file__)),
'..',
'..',
'py'))
- from cassandra import Cassandra
- from cassandra.ttypes import Compression, InvalidRequestException, \
- CqlResultType, AuthenticationRequest, \
- SchemaDisagreementException
from cql.errors import CQLException, InvalidCompressionScheme
from cql.marshal import prepare
from cql.decoders import SchemaDecoder