Permalink
Browse files

Initial 1.0 compatibility work

  • Loading branch information...
1 parent 8aa260e commit cf0a370b98902f7ee0daf95ab6bcfba4b6a3389c @thobbs thobbs committed Nov 4, 2011
View
9 pycassa/cassandra/c07/constants.py
@@ -1,10 +1 @@
-#
-# 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"
View
1,374 pycassa/cassandra/c08/Cassandra.py → pycassa/cassandra/c10/Cassandra.py
718 additions, 656 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 pycassa/cassandra/c10/__init__.py
@@ -0,0 +1 @@
+__all__ = ['ttypes', 'constants', 'Cassandra']
View
10 pycassa/cassandra/c10/constants.py
@@ -0,0 +1,10 @@
+#
+# Autogenerated by Thrift Compiler (0.7.0)
+#
+# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+#
+
+from thrift.Thrift import *
+from ttypes import *
+
+VERSION = "19.18.0"
View
1,543 pycassa/cassandra/c07/ttypes.py → pycassa/cassandra/c10/ttypes.py
<
@@ -1,5 +1,5 @@
#
-# Autogenerated by Thrift
+# Autogenerated by Thrift Compiler (0.7.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
@@ -14,38 +14,57 @@
fastbinary = None
-class ConsistencyLevel:
+class ConsistencyLevel(object):
"""
- The ConsistencyLevel is an enum that controls both read and write behavior based on <ReplicationFactor> in your
- storage-conf.xml. The different consistency levels have different meanings, depending on if you're doing a write or read
- operation. Note that 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 <ReplicationFactor>. Of course if latency is more
- important than consistency then you can use lower values for either or both.
+ 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 <ReplicationFactor>. 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 <ReplicationFactor> / 2 + 1 nodes
LOCAL_QUORUM Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes, within the local datacenter (requires NetworkTopologyStrategy)
EACH_QUORUM Ensure that the write has been written to <ReplicationFactor> / 2 + 1 nodes in each datacenter (requires NetworkTopologyStrategy)
ALL Ensure that the write is written to <code>&lt;ReplicationFactor&gt;</code> nodes before responding to the client.
- Read:
+ Read consistency levels make the following guarantees before returning successful results to the client:
ANY Not supported. You probably want ONE instead.
- ONE Will return the record returned by the first node to respond. A consistency check is always done in a background thread to fix any consistency issues when ConsistencyLevel.ONE is used. This means subsequent calls will have correct data even if the initial read gets an older value. (This is called 'read repair'.)
- QUORUM Will query all storage nodes and return the record with the most recent timestamp once it has at least a majority of replicas reported. Again, the remaining replicas will be checked in the background.
+ 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 Queries all storage nodes and returns the record with the most recent timestamp.
+ 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",
@@ -54,6 +73,8 @@ class ConsistencyLevel:
4: "EACH_QUORUM",
5: "ALL",
6: "ANY",
+ 7: "TWO",
+ 8: "THREE",
}
_NAMES_TO_VALUES = {
@@ -63,9 +84,11 @@ class ConsistencyLevel:
"EACH_QUORUM": 4,
"ALL": 5,
"ANY": 6,
+ "TWO": 7,
+ "THREE": 8,
}
-class IndexOperator:
+class IndexOperator(object):
EQ = 0
GTE = 1
GT = 2
@@ -88,19 +111,56 @@ class IndexOperator:
"LT": 4,
}
-class IndexType:
+class IndexType(object):
KEYS = 0
+ CUSTOM = 1
_VALUES_TO_NAMES = {
0: "KEYS",
+ 1: "CUSTOM",
}
_NAMES_TO_VALUES = {
"KEYS": 0,
+ "CUSTOM": 1,
+ }
+
+class Compression(object):
+ """
+ CQL query compression
+ """
+ GZIP = 1
+ NONE = 2
+
+ _VALUES_TO_NAMES = {
+ 1: "GZIP",
+ 2: "NONE",
+ }
+
+ _NAMES_TO_VALUES = {
+ "GZIP": 1,
+ "NONE": 2,
+ }
+
+class CqlResultType(object):
+ 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:
+class Column(object):
"""
Basic unit of data within a ColumnFamily.
@param name, the name by which this column is set and retrieved. Maximum 64KB long.
@@ -168,32 +228,29 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Column')
- if self.name != None:
+ if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 1)
oprot.writeString(self.name)
oprot.writeFieldEnd()
- if self.value != None:
+ if self.value is not None:
oprot.writeFieldBegin('value', TType.STRING, 2)
oprot.writeString(self.value)
oprot.writeFieldEnd()
- if self.timestamp != None:
+ if self.timestamp is not None:
oprot.writeFieldBegin('timestamp', TType.I64, 3)
oprot.writeI64(self.timestamp)
oprot.writeFieldEnd()
- if self.ttl != None:
+ if self.ttl is not 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 validate(self):
+ if self.name is None:
+ raise TProtocol.TProtocolException(message='Required field name is unset!')
+ return
def __repr__(self):
@@ -207,7 +264,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class SuperColumn:
+class SuperColumn(object):
"""
A named list of columns.
@param name. see Column.name.
@@ -264,11 +321,11 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('SuperColumn')
- if self.name != None:
+ if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 1)
oprot.writeString(self.name)
oprot.writeFieldEnd()
- if self.columns != None:
+ if self.columns is not None:
oprot.writeFieldBegin('columns', TType.LIST, 2)
oprot.writeListBegin(TType.STRUCT, len(self.columns))
for iter6 in self.columns:
@@ -277,12 +334,174 @@ def write(self, oprot):
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!')
+
+ 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 CounterColumn(object):
+ """
+ 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 is not None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.value is not 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(object):
+ """
+ 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 is not None:
+ oprot.writeFieldBegin('name', TType.STRING, 1)
+ oprot.writeString(self.name)
+ oprot.writeFieldEnd()
+ if self.columns is not 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):
@@ -296,31 +515,42 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class ColumnOrSuperColumn:
+class ColumnOrSuperColumn(object):
"""
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.
+ If the query was on a counter column family, you will either get a counter_column (instead of a column) or a
+ counter_super_column (instead of a super_column)
+
@param column. The Column returned by get() or get_slice().
@param super_column. The SuperColumn returned by get() or get_slice().
+ @param counter_column. The Counterolumn returned by get() or get_slice().
+ @param counter_super_column. The CounterSuperColumn returned by get() or get_slice().
Attributes:
- column
- super_column
+ - counter_column
+ - counter_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
+ (3, TType.STRUCT, 'counter_column', (CounterColumn, CounterColumn.thrift_spec), None, ), # 3
+ (4, TType.STRUCT, 'counter_super_column', (CounterSuperColumn, CounterSuperColumn.thrift_spec), None, ), # 4
)
- def __init__(self, column=None, super_column=None,):
+ def __init__(self, column=None, super_column=None, counter_column=None, counter_super_column=None,):
self.column = column
self.super_column = super_column
+ self.counter_column = counter_column
+ self.counter_super_column = counter_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:
@@ -343,6 +573,18 @@ def read(self, iprot):
self.super_column.read(iprot)
else:
iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRUCT:
+ self.counter_column = CounterColumn()
+ self.counter_column.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.STRUCT:
+ self.counter_super_column = CounterSuperColumn()
+ self.counter_super_column.read(iprot)
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -353,18 +595,27 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ColumnOrSuperColumn')
- if self.column != None:
+ if self.column is not None:
oprot.writeFieldBegin('column', TType.STRUCT, 1)
self.column.write(oprot)
oprot.writeFieldEnd()
- if self.super_column != None:
+ if self.super_column is not None:
oprot.writeFieldBegin('super_column', TType.STRUCT, 2)
self.super_column.write(oprot)
oprot.writeFieldEnd()
+ if self.counter_column is not None:
+ oprot.writeFieldBegin('counter_column', TType.STRUCT, 3)
+ self.counter_column.write(oprot)
+ oprot.writeFieldEnd()
+ if self.counter_super_column is not None:
+ oprot.writeFieldBegin('counter_super_column', TType.STRUCT, 4)
+ self.counter_super_column.write(oprot)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
- def validate(self):
- return
+
+ def validate(self):
+ return
def __repr__(self):
@@ -407,8 +658,9 @@ def write(self, oprot):
oprot.writeStructBegin('NotFoundException')
oprot.writeFieldStop()
oprot.writeStructEnd()
- def validate(self):
- return
+
+ def validate(self):
+ return
def __str__(self):
@@ -466,16 +718,17 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('InvalidRequestException')
- if self.why != None:
+ if self.why is not 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 validate(self):
+ if self.why is None:
+ raise TProtocol.TProtocolException(message='Required field why is unset!')
+ return
def __str__(self):
@@ -521,8 +774,9 @@ def write(self, oprot):
oprot.writeStructBegin('UnavailableException')
oprot.writeFieldStop()
oprot.writeStructEnd()
- def validate(self):
- return
+
+ def validate(self):
+ return
def __str__(self):
@@ -568,8 +822,9 @@ def write(self, oprot):
oprot.writeStructBegin('TimedOutException')
oprot.writeFieldStop()
oprot.writeStructEnd()
- def validate(self):
- return
+
+ def validate(self):
+ return
def __str__(self):
@@ -626,16 +881,17 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AuthenticationException')
- if self.why != None:
+ if self.why is not 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 validate(self):
+ if self.why is None:
+ raise TProtocol.TProtocolException(message='Required field why is unset!')
+ return
def __str__(self):
@@ -692,16 +948,65 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AuthorizationException')
- if self.why != None:
+ if self.why is not 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!')
+
+ 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):
@@ -718,7 +1023,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class ColumnParent:
+class ColumnParent(object):
"""
ColumnParent is used when selecting groups of columns from the same ColumnFamily. In directory structure terms, imagine
ColumnParent as ColumnPath + '/../'.
@@ -771,20 +1076,21 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ColumnParent')
- if self.column_family != None:
+ if self.column_family is not None:
oprot.writeFieldBegin('column_family', TType.STRING, 3)
oprot.writeString(self.column_family)
oprot.writeFieldEnd()
- if self.super_column != None:
+ if self.super_column is not 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 validate(self):
+ if self.column_family is None:
+ raise TProtocol.TProtocolException(message='Required field column_family is unset!')
+ return
def __repr__(self):
@@ -798,7 +1104,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class ColumnPath:
+class ColumnPath(object):
"""
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.
@@ -863,24 +1169,25 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ColumnPath')
- if self.column_family != None:
+ if self.column_family is not None:
oprot.writeFieldBegin('column_family', TType.STRING, 3)
oprot.writeString(self.column_family)
oprot.writeFieldEnd()
- if self.super_column != None:
+ if self.super_column is not None:
oprot.writeFieldBegin('super_column', TType.STRING, 4)
oprot.writeString(self.super_column)
oprot.writeFieldEnd()
- if self.column != None:
+ if self.column is not 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 validate(self):
+ if self.column_family is None:
+ raise TProtocol.TProtocolException(message='Required field column_family is unset!')
+ return
def __repr__(self):
@@ -894,7 +1201,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class SliceRange:
+class SliceRange(object):
"""
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
@@ -971,34 +1278,35 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('SliceRange')
- if self.start != None:
+ if self.start is not None:
oprot.writeFieldBegin('start', TType.STRING, 1)
oprot.writeString(self.start)
oprot.writeFieldEnd()
- if self.finish != None:
+ if self.finish is not None:
oprot.writeFieldBegin('finish', TType.STRING, 2)
oprot.writeString(self.finish)
oprot.writeFieldEnd()
- if self.reversed != None:
+ if self.reversed is not None:
oprot.writeFieldBegin('reversed', TType.BOOL, 3)
oprot.writeBool(self.reversed)
oprot.writeFieldEnd()
- if self.count != None:
+ if self.count is not 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 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):
@@ -1012,7 +1320,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class SlicePredicate:
+class SlicePredicate(object):
"""
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."
@@ -1052,10 +1360,10 @@ def read(self, iprot):
if fid == 1:
if ftype == TType.LIST:
self.column_names = []
- (_etype10, _size7) = iprot.readListBegin()
- for _i11 in xrange(_size7):
- _elem12 = iprot.readString();
- self.column_names.append(_elem12)
+ (_etype17, _size14) = iprot.readListBegin()
+ for _i18 in xrange(_size14):
+ _elem19 = iprot.readString();
+ self.column_names.append(_elem19)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -1075,21 +1383,22 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('SlicePredicate')
- if self.column_names != None:
+ if self.column_names is not None:
oprot.writeFieldBegin('column_names', TType.LIST, 1)
oprot.writeListBegin(TType.STRING, len(self.column_names))
- for iter13 in self.column_names:
- oprot.writeString(iter13)
+ for iter20 in self.column_names:
+ oprot.writeString(iter20)
oprot.writeListEnd()
oprot.writeFieldEnd()
- if self.slice_range != None:
+ if self.slice_range is not None:
oprot.writeFieldBegin('slice_range', TType.STRUCT, 2)
self.slice_range.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
- def validate(self):
- return
+
+ def validate(self):
+ return
def __repr__(self):
@@ -1103,7 +1412,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class IndexExpression:
+class IndexExpression(object):
"""
Attributes:
- column_name
@@ -1157,28 +1466,29 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('IndexExpression')
- if self.column_name != None:
+ if self.column_name is not None:
oprot.writeFieldBegin('column_name', TType.STRING, 1)
oprot.writeString(self.column_name)
oprot.writeFieldEnd()
- if self.op != None:
+ if self.op is not None:
oprot.writeFieldBegin('op', TType.I32, 2)
oprot.writeI32(self.op)
oprot.writeFieldEnd()
- if self.value != None:
+ if self.value is not 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 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):
@@ -1192,7 +1502,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class IndexClause:
+class IndexClause(object):
"""
Attributes:
- expressions
@@ -1224,11 +1534,11 @@ def read(self, iprot):
if fid == 1:
if ftype == TType.LIST:
self.expressions = []
- (_etype17, _size14) = iprot.readListBegin()
- for _i18 in xrange(_size14):
- _elem19 = IndexExpression()
- _elem19.read(iprot)
- self.expressions.append(_elem19)
+ (_etype24, _size21) = iprot.readListBegin()
+ for _i25 in xrange(_size21):
+ _elem26 = IndexExpression()
+ _elem26.read(iprot)
+ self.expressions.append(_elem26)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -1252,31 +1562,32 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('IndexClause')
- if self.expressions != None:
+ if self.expressions is not None:
oprot.writeFieldBegin('expressions', TType.LIST, 1)
oprot.writeListBegin(TType.STRUCT, len(self.expressions))
- for iter20 in self.expressions:
- iter20.write(oprot)
+ for iter27 in self.expressions:
+ iter27.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
- if self.start_key != None:
+ if self.start_key is not None:
oprot.writeFieldBegin('start_key', TType.STRING, 2)
oprot.writeString(self.start_key)
oprot.writeFieldEnd()
- if self.count != None:
+ if self.count is not 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 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):
@@ -1290,7 +1601,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class KeyRange:
+class KeyRange(object):
"""
The semantics of start keys and tokens are slightly different.
Keys are start-inclusive; tokens are start-exclusive. Token
@@ -1367,32 +1678,33 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('KeyRange')
- if self.start_key != None:
+ if self.start_key is not None:
oprot.writeFieldBegin('start_key', TType.STRING, 1)
oprot.writeString(self.start_key)
oprot.writeFieldEnd()
- if self.end_key != None:
+ if self.end_key is not None:
oprot.writeFieldBegin('end_key', TType.STRING, 2)
oprot.writeString(self.end_key)
oprot.writeFieldEnd()
- if self.start_token != None:
+ if self.start_token is not None:
oprot.writeFieldBegin('start_token', TType.STRING, 3)
oprot.writeString(self.start_token)
oprot.writeFieldEnd()
- if self.end_token != None:
+ if self.end_token is not None:
oprot.writeFieldBegin('end_token', TType.STRING, 4)
oprot.writeString(self.end_token)
oprot.writeFieldEnd()
- if self.count != None:
+ if self.count is not 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 validate(self):
+ if self.count is None:
+ raise TProtocol.TProtocolException(message='Required field count is unset!')
+ return
def __repr__(self):
@@ -1406,7 +1718,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class KeySlice:
+class KeySlice(object):
"""
A KeySlice is key followed by the data it maps to. A collection of KeySlice is returned by the get_range_slice operation.
@@ -1446,11 +1758,11 @@ def read(self, iprot):
elif fid == 2:
if ftype == TType.LIST:
self.columns = []
- (_etype24, _size21) = iprot.readListBegin()
- for _i25 in xrange(_size21):
- _elem26 = ColumnOrSuperColumn()
- _elem26.read(iprot)
- self.columns.append(_elem26)
+ (_etype31, _size28) = iprot.readListBegin()
+ for _i32 in xrange(_size28):
+ _elem33 = ColumnOrSuperColumn()
+ _elem33.read(iprot)
+ self.columns.append(_elem33)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -1464,25 +1776,26 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('KeySlice')
- if self.key != None:
+ if self.key is not None:
oprot.writeFieldBegin('key', TType.STRING, 1)
oprot.writeString(self.key)
oprot.writeFieldEnd()
- if self.columns != None:
+ if self.columns is not None:
oprot.writeFieldBegin('columns', TType.LIST, 2)
oprot.writeListBegin(TType.STRUCT, len(self.columns))
- for iter27 in self.columns:
- iter27.write(oprot)
+ 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 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):
@@ -1496,7 +1809,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class KeyCount:
+class KeyCount(object):
"""
Attributes:
- key
@@ -1542,22 +1855,23 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('KeyCount')
- if self.key != None:
+ if self.key is not None:
oprot.writeFieldBegin('key', TType.STRING, 1)
oprot.writeString(self.key)
oprot.writeFieldEnd()
- if self.count != None:
+ if self.count is not 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 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):
@@ -1571,8 +1885,10 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class Deletion:
+class Deletion(object):
"""
+ Note that the timestamp is only optional in case of counter deletion.
+
Attributes:
- timestamp
- super_column
@@ -1626,24 +1942,23 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Deletion')
- if self.timestamp != None:
+ if self.timestamp is not None:
oprot.writeFieldBegin('timestamp', TType.I64, 1)
oprot.writeI64(self.timestamp)
oprot.writeFieldEnd()
- if self.super_column != None:
+ if self.super_column is not None:
oprot.writeFieldBegin('super_column', TType.STRING, 2)
oprot.writeString(self.super_column)
oprot.writeFieldEnd()
- if self.predicate != None:
+ if self.predicate is not 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 validate(self):
+ return
def __repr__(self):
@@ -1657,10 +1972,10 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class Mutation:
+class Mutation(object):
"""
- 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
+ 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 (possibly counter column or supercolumn)
@param deletion. A deletion of a column or supercolumn
Attributes:
@@ -1709,18 +2024,19 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('Mutation')
- if self.column_or_supercolumn != None:
+ if self.column_or_supercolumn is not None:
oprot.writeFieldBegin('column_or_supercolumn', TType.STRUCT, 1)
self.column_or_supercolumn.write(oprot)
oprot.writeFieldEnd()
- if self.deletion != None:
+ if self.deletion is not None:
oprot.writeFieldBegin('deletion', TType.STRUCT, 2)
self.deletion.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
- def validate(self):
- return
+
+ def validate(self):
+ return
def __repr__(self):
@@ -1734,25 +2050,122 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class TokenRange:
+class EndpointDetails(object):
"""
Attributes:
- - start_token
- - end_token
- - endpoints
+ - host
+ - port
+ - datacenter
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'host', None, None, ), # 1
+ (2, TType.I32, 'port', None, None, ), # 2
+ (3, TType.STRING, 'datacenter', None, None, ), # 3
+ )
+
+ def __init__(self, host=None, port=None, datacenter=None,):
+ self.host = host
+ self.port = port
+ self.datacenter = datacenter
+
+ 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.host = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.I32:
+ self.port = iprot.readI32();
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.STRING:
+ self.datacenter = 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('EndpointDetails')
+ if self.host is not None:
+ oprot.writeFieldBegin('host', TType.STRING, 1)
+ oprot.writeString(self.host)
+ oprot.writeFieldEnd()
+ if self.port is not None:
+ oprot.writeFieldBegin('port', TType.I32, 2)
+ oprot.writeI32(self.port)
+ oprot.writeFieldEnd()
+ if self.datacenter is not None:
+ oprot.writeFieldBegin('datacenter', TType.STRING, 3)
+ oprot.writeString(self.datacenter)
+ 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(object):
+ """
+ A TokenRange describes part of the Cassandra ring, it is a mapping from a range to
+ endpoints responsible for that range.
+ @param start_token The first token in the range
+ @param end_token The last token in the range
+ @param endpoints The endpoints responsible for the range (listed by their configured listen_address)
+ @param rpc_endpoints The endpoints responsible for the range (listed by their configured rpc_address)
+
+ Attributes:
+ - start_token
+ - end_token
+ - endpoints
+ - rpc_endpoints
+ - endpoint_details
"""
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
+ (4, TType.LIST, 'rpc_endpoints', (TType.STRING,None), None, ), # 4
+ (5, TType.LIST, 'endpoint_details', (TType.STRUCT,(EndpointDetails, EndpointDetails.thrift_spec)), None, ), # 5
)
- def __init__(self, start_token=None, end_token=None, endpoints=None,):
+ def __init__(self, start_token=None, end_token=None, endpoints=None, rpc_endpoints=None, endpoint_details=None,):
self.start_token = start_token
self.end_token = end_token
self.endpoints = endpoints
+ self.rpc_endpoints = rpc_endpoints
+ self.endpoint_details = endpoint_details
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:
@@ -1776,10 +2189,31 @@ def read(self, iprot):
elif fid == 3:
if ftype == TType.LIST:
self.endpoints = []
- (_etype31, _size28) = iprot.readListBegin()
- for _i32 in xrange(_size28):
- _elem33 = iprot.readString();
- self.endpoints.append(_elem33)
+ (_etype38, _size35) = iprot.readListBegin()
+ for _i39 in xrange(_size35):
+ _elem40 = iprot.readString();
+ self.endpoints.append(_elem40)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.LIST:
+ self.rpc_endpoints = []
+ (_etype44, _size41) = iprot.readListBegin()
+ for _i45 in xrange(_size41):
+ _elem46 = iprot.readString();
+ self.rpc_endpoints.append(_elem46)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.LIST:
+ self.endpoint_details = []
+ (_etype50, _size47) = iprot.readListBegin()
+ for _i51 in xrange(_size47):
+ _elem52 = EndpointDetails()
+ _elem52.read(iprot)
+ self.endpoint_details.append(_elem52)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -1793,31 +2227,46 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('TokenRange')
- if self.start_token != None:
+ if self.start_token is not None:
oprot.writeFieldBegin('start_token', TType.STRING, 1)
oprot.writeString(self.start_token)
oprot.writeFieldEnd()
- if self.end_token != None:
+ if self.end_token is not None:
oprot.writeFieldBegin('end_token', TType.STRING, 2)
oprot.writeString(self.end_token)
oprot.writeFieldEnd()
- if self.endpoints != None:
+ if self.endpoints is not None:
oprot.writeFieldBegin('endpoints', TType.LIST, 3)
oprot.writeListBegin(TType.STRING, len(self.endpoints))
- for iter34 in self.endpoints:
- oprot.writeString(iter34)
+ for iter53 in self.endpoints:
+ oprot.writeString(iter53)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.rpc_endpoints is not None:
+ oprot.writeFieldBegin('rpc_endpoints', TType.LIST, 4)
+ oprot.writeListBegin(TType.STRING, len(self.rpc_endpoints))
+ for iter54 in self.rpc_endpoints:
+ oprot.writeString(iter54)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.endpoint_details is not None:
+ oprot.writeFieldBegin('endpoint_details', TType.LIST, 5)
+ oprot.writeListBegin(TType.STRUCT, len(self.endpoint_details))
+ for iter55 in self.endpoint_details:
+ iter55.write(oprot)
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 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):
@@ -1831,7 +2280,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class AuthenticationRequest:
+class AuthenticationRequest(object):
"""
Authentication requests can contain any data, dependent on the IAuthenticator used
@@ -1859,11 +2308,11 @@ def read(self, iprot):
if fid == 1:
if ftype == TType.MAP:
self.credentials = {}
- (_ktype36, _vtype37, _size35 ) = iprot.readMapBegin()
- for _i39 in xrange(_size35):
- _key40 = iprot.readString();
- _val41 = iprot.readString();
- self.credentials[_key40] = _val41
+ (_ktype57, _vtype58, _size56 ) = iprot.readMapBegin()
+ for _i60 in xrange(_size56):
+ _key61 = iprot.readString();
+ _val62 = iprot.readString();
+ self.credentials[_key61] = _val62
iprot.readMapEnd()
else:
iprot.skip(ftype)
@@ -1877,20 +2326,21 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('AuthenticationRequest')
- if self.credentials != None:
+ if self.credentials is not None:
oprot.writeFieldBegin('credentials', TType.MAP, 1)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.credentials))
- for kiter42,viter43 in self.credentials.items():
- oprot.writeString(kiter42)
- oprot.writeString(viter43)
+ for kiter63,viter64 in self.credentials.items():
+ oprot.writeString(kiter63)
+ oprot.writeString(viter64)
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 validate(self):
+ if self.credentials is None:
+ raise TProtocol.TProtocolException(message='Required field credentials is unset!')
+ return
def __repr__(self):
@@ -1904,13 +2354,14 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class ColumnDef:
+class ColumnDef(object):
"""
Attributes:
- name
- validation_class
- index_type
- index_name
+ - index_options
"""
thrift_spec = (
@@ -1919,13 +2370,15 @@ class ColumnDef:
(2, TType.STRING, 'validation_class', None, None, ), # 2
(3, TType.I32, 'index_type', None, None, ), # 3
(4, TType.STRING, 'index_name', None, None, ), # 4
+ (5, TType.MAP, 'index_options', (TType.STRING,None,TType.STRING,None), None, ), # 5
)
- def __init__(self, name=None, validation_class=None, index_type=None, index_name=None,):
+ def __init__(self, name=None, validation_class=None, index_type=None, index_name=None, index_options=None,):
self.name = name
self.validation_class = validation_class
self.index_type = index_type
self.index_name = index_name
+ self.index_options = index_options
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:
@@ -1956,6 +2409,17 @@ def read(self, iprot):
self.index_name = iprot.readString();
else:
iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.MAP:
+ self.index_options = {}
+ (_ktype66, _vtype67, _size65 ) = iprot.readMapBegin()
+ for _i69 in xrange(_size65):
+ _key70 = iprot.readString();
+ _val71 = iprot.readString();
+ self.index_options[_key70] = _val71
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -1966,30 +2430,39 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('ColumnDef')
- if self.name != None:
+ if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 1)
oprot.writeString(self.name)
oprot.writeFieldEnd()
- if self.validation_class != None:
+ if self.validation_class is not None:
oprot.writeFieldBegin('validation_class', TType.STRING, 2)
oprot.writeString(self.validation_class)
oprot.writeFieldEnd()
- if self.index_type != None:
+ if self.index_type is not None:
oprot.writeFieldBegin('index_type', TType.I32, 3)
oprot.writeI32(self.index_type)
oprot.writeFieldEnd()
- if self.index_name != None:
+ if self.index_name is not None:
oprot.writeFieldBegin('index_name', TType.STRING, 4)
oprot.writeString(self.index_name)
oprot.writeFieldEnd()
+ if self.index_options is not None:
+ oprot.writeFieldBegin('index_options', TType.MAP, 5)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.index_options))
+ for kiter72,viter73 in self.index_options.items():
+ oprot.writeString(kiter72)
+ oprot.writeString(viter73)
+ oprot.writeMapEnd()
+ 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 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):
@@ -2003,7 +2476,7 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class CfDef:
+class CfDef(object):
"""
Attributes:
- keyspace
@@ -2023,9 +2496,15 @@ class CfDef:
- 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
+ - key_validation_class
+ - row_cache_provider
+ - key_alias
+ - compaction_strategy
+ - compaction_strategy_options
+ - row_cache_keys_to_save
+ - compression_options
"""
thrift_spec = (
@@ -2050,12 +2529,21 @@ class CfDef:
(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
+ None, # 21
+ None, # 22
+ None, # 23
+ (24, TType.BOOL, 'replicate_on_write', None, None, ), # 24
+ (25, TType.DOUBLE, 'merge_shards_chance', None, None, ), # 25
+ (26, TType.STRING, 'key_validation_class', None, None, ), # 26
+ (27, TType.STRING, 'row_cache_provider', None, None, ), # 27
+ (28, TType.STRING, 'key_alias', None, None, ), # 28
+ (29, TType.STRING, 'compaction_strategy', None, None, ), # 29
+ (30, TType.MAP, 'compaction_strategy_options', (TType.STRING,None,TType.STRING,None), None, ), # 30
+ (31, TType.I32, 'row_cache_keys_to_save', None, None, ), # 31
+ (32, TType.MAP, 'compression_options', (TType.STRING,None,TType.STRING,None), None, ), # 32
)
- 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,):
+ 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, replicate_on_write=None, merge_shards_chance=None, key_validation_class=None, row_cache_provider=None, key_alias=None, compaction_strategy=None, compaction_strategy_options=None, row_cache_keys_to_save=None, compression_options=None,):
self.keyspace = keyspace
self.name = name
self.column_type = column_type
@@ -2073,9 +2561,15 @@ def __init__(self, keyspace=None, name=None, column_type=thrift_spec[3][4], comp
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
+ self.key_validation_class = key_validation_class
+ self.row_cache_provider = row_cache_provider
+ self.key_alias = key_alias
+ self.compaction_strategy = compaction_strategy
+ self.compaction_strategy_options = compaction_strategy_options
+ self.row_cache_keys_to_save = row_cache_keys_to_save
+ self.compression_options = compression_options
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:
@@ -2134,11 +2628,11 @@ def read(self, iprot):
elif fid == 13:
if ftype == TType.LIST:
self.column_metadata = []
- (_etype47, _size44) = iprot.readListBegin()
- for _i48 in xrange(_size44):
- _elem49 = ColumnDef()
- _elem49.read(iprot)
- self.column_metadata.append(_elem49)
+ (_etype77, _size74) = iprot.readListBegin()
+ for _i78 in xrange(_size74):
+ _elem79 = ColumnDef()
+ _elem79.read(iprot)
+ self.column_metadata.append(_elem79)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -2177,19 +2671,61 @@ def read(self, iprot):
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();
+ 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)
+ elif fid == 26:
+ if ftype == TType.STRING:
+ self.key_validation_class = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 27:
+ if ftype == TType.STRING:
+ self.row_cache_provider = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 28:
+ if ftype == TType.STRING:
+ self.key_alias = iprot.readString();
+ else:
+ iprot.skip(ftype)
+ elif fid == 29:
+ if ftype == TType.STRING:
+ self.compaction_strategy = iprot.readString();
else:
iprot.skip(ftype)
- elif fid == 22:
+ elif fid == 30:
+ if ftype == TType.MAP:
+ self.compaction_strategy_options = {}
+ (_ktype81, _vtype82, _size80 ) = iprot.readMapBegin()
+ for _i84 in xrange(_size80):
+ _key85 = iprot.readString();
+ _val86 = iprot.readString();
+ self.compaction_strategy_options[_key85] = _val86
+ iprot.readMapEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 31:
if ftype == TType.I32:
- self.memtable_throughput_in_mb = iprot.readI32();
+ self.row_cache_keys_to_save = iprot.readI32();
else:
iprot.skip(ftype)
- elif fid == 23:
- if ftype == TType.DOUBLE:
- self.memtable_operations_in_millions = iprot.readDouble();
+ elif fid == 32:
+ if ftype == TType.MAP:
+ self.compression_options = {}
+ (_ktype88, _vtype89, _size87 ) = iprot.readMapBegin()
+ for _i91 in xrange(_size87):
+ _key92 = iprot.readString();
+ _val93 = iprot.readString();
+ self.compression_options[_key92] = _val93
+ iprot.readMapEnd()
else:
iprot.skip(ftype)
else:
@@ -2202,97 +2738,130 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('CfDef')
- if self.keyspace != None:
+ if self.keyspace is not None:
oprot.writeFieldBegin('keyspace', TType.STRING, 1)
oprot.writeString(self.keyspace)
oprot.writeFieldEnd()
- if self.name != None:
+ if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 2)
oprot.writeString(self.name)
oprot.writeFieldEnd()
- if self.column_type != None:
+ if self.column_type is not None:
oprot.writeFieldBegin('column_type', TType.STRING, 3)
oprot.writeString(self.column_type)
oprot.writeFieldEnd()
- if self.comparator_type != None:
+ if self.comparator_type is not None:
oprot.writeFieldBegin('comparator_type', TType.STRING, 5)
oprot.writeString(self.comparator_type)
oprot.writeFieldEnd()
- if self.subcomparator_type != None:
+ if self.subcomparator_type is not None:
oprot.writeFieldBegin('subcomparator_type', TType.STRING, 6)
oprot.writeString(self.subcomparator_type)
oprot.writeFieldEnd()
- if self.comment != None:
+ if self.comment is not None:
oprot.writeFieldBegin('comment', TType.STRING, 8)
oprot.writeString(self.comment)
oprot.writeFieldEnd()
- if self.row_cache_size != None:
+ if self.row_cache_size is not None:
oprot.writeFieldBegin('row_cache_size', TType.DOUBLE, 9)
oprot.writeDouble(self.row_cache_size)
oprot.writeFieldEnd()
- if self.key_cache_size != None:
+ if self.key_cache_size is not None:
oprot.writeFieldBegin('key_cache_size', TType.DOUBLE, 11)
oprot.writeDouble(self.key_cache_size)
oprot.writeFieldEnd()
- if self.read_repair_chance != None:
+ if self.read_repair_chance is not None:
oprot.writeFieldBegin('read_repair_chance', TType.DOUBLE, 12)
oprot.writeDouble(self.read_repair_chance)
oprot.writeFieldEnd()
- if self.column_metadata != None:
+ if self.column_metadata is not None:
oprot.writeFieldBegin('column_metadata', TType.LIST, 13)
oprot.writeListBegin(TType.STRUCT, len(self.column_metadata))
- for iter50 in self.column_metadata:
- iter50.write(oprot)
+ for iter94 in self.column_metadata:
+ iter94.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
- if self.gc_grace_seconds != None:
+ if self.gc_grace_seconds is not None:
oprot.writeFieldBegin('gc_grace_seconds', TType.I32, 14)
oprot.writeI32(self.gc_grace_seconds)
oprot.writeFieldEnd()
- if self.default_validation_class != None:
+ if self.default_validation_class is not None:
oprot.writeFieldBegin('default_validation_class', TType.STRING, 15)
oprot.writeString(self.default_validation_class)
oprot.writeFieldEnd()
- if self.id != None:
+ if self.id is not None:
oprot.writeFieldBegin('id', TType.I32, 16)
oprot.writeI32(self.id)
oprot.writeFieldEnd()
- if self.min_compaction_threshold != None:
+ if self.min_compaction_threshold is not None:
oprot.writeFieldBegin('min_compaction_threshold', TType.I32, 17)
oprot.writeI32(self.min_compaction_threshold)
oprot.writeFieldEnd()
- if self.max_compaction_threshold != None:
+ if self.max_compaction_threshold is not 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:
+ if self.row_cache_save_period_in_seconds is not 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:
+ if self.key_cache_save_period_in_seconds is not 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)
+ if self.replicate_on_write is not None:
+ oprot.writeFieldBegin('replicate_on_write', TType.BOOL, 24)
+ oprot.writeBool(self.replicate_on_write)
+ oprot.writeFieldEnd()
+ if self.merge_shards_chance is not None:
+ oprot.writeFieldBegin('merge_shards_chance', TType.DOUBLE, 25)
+ oprot.writeDouble(self.merge_shards_chance)
+ oprot.writeFieldEnd()
+ if self.key_validation_class is not None:
+ oprot.writeFieldBegin('key_validation_class', TType.STRING, 26)
+ oprot.writeString(self.key_validation_class)
+ oprot.writeFieldEnd()
+ if self.row_cache_provider is not None:
+ oprot.writeFieldBegin('row_cache_provider', TType.STRING, 27)
+ oprot.writeString(self.row_cache_provider)
+ oprot.writeFieldEnd()
+ if self.key_alias is not None:
+ oprot.writeFieldBegin('key_alias', TType.STRING, 28)
+ oprot.writeString(self.key_alias)
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)
+ if self.compaction_strategy is not None:
+ oprot.writeFieldBegin('compaction_strategy', TType.STRING, 29)
+ oprot.writeString(self.compaction_strategy)
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)
+ if self.compaction_strategy_options is not None:
+ oprot.writeFieldBegin('compaction_strategy_options', TType.MAP, 30)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.compaction_strategy_options))
+ for kiter95,viter96 in self.compaction_strategy_options.items():
+ oprot.writeString(kiter95)
+ oprot.writeString(viter96)
+ oprot.writeMapEnd()
+ oprot.writeFieldEnd()
+ if self.row_cache_keys_to_save is not None:
+ oprot.writeFieldBegin('row_cache_keys_to_save', TType.I32, 31)
+ oprot.writeI32(self.row_cache_keys_to_save)
+ oprot.writeFieldEnd()
+ if self.compression_options is not None:
+ oprot.writeFieldBegin('compression_options', TType.MAP, 32)
+ oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.compression_options))
+ for kiter97,viter98 in self.compression_options.items():
+ oprot.writeString(kiter97)
+ oprot.writeString(viter98)
+ oprot.writeMapEnd()
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 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):
@@ -2306,14 +2875,15 @@ def __eq__(self, other):
def __ne__(self, other):
return not (self == other)
-class KsDef:
+class KsDef(object):
"""
Attributes:
- name
- strategy_class
- strategy_options
- - replication_factor
+ - replication_factor: @deprecated
- cf_defs
+ - durable_writes
"""
thrift_spec = (
@@ -2323,14 +2893,16 @@ class KsDef:
(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
+ (6, TType.BOOL, 'durable_writes', None, True, ), # 6
)
- def __init__(self, name=None, strategy_class=None, strategy_options=None, replication_factor=None, cf_defs=None,):
+ def __init__(self, name=None, strategy_class=None, strategy_options=None, replication_factor=None, cf_defs=None, durable_writes=thrift_spec[6][4],):
self.name = name
self.strategy_class = strategy_class
self.strategy_options = strategy_options
self.replication_factor = replication_factor
self.cf_defs = cf_defs
+ self.durable_writes = durable_writes
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:
@@ -2354,11 +2926,11 @@ def read(self, iprot):
elif fid == 3:
if ftype == TType.MAP:
self.strategy_options = {}
- (_ktype52, _vtype53, _size51 ) = iprot.readMapBegin()
- for _i55 in xrange(_size51):
- _key56 = iprot.readString();
- _val57 = iprot.readString();
- self.strategy_options[_key56] = _val57
+ (_ktype100, _vtype101, _size99 ) = iprot.readMapBegin()
+ for _i103 in xrange(_size99):
+ _key104 = iprot.readString();
+ _val105 = iprot.readString();
+ self.strategy_options[_key104] = _val105
iprot.readMapEnd()
else:
iprot.skip(ftype)
@@ -2370,14 +2942,19 @@ def read(self, iprot):
elif fid == 5:
if ftype == TType.LIST:
self.cf_defs = []
- (_etype61, _size58) = iprot.readListBegin()
- for _i62 in xrange(_size58):
- _elem63 = CfDef()
- _elem63.read(iprot)
- self.cf_defs.append(_elem63)
+ (_etype109, _size106) = iprot.readListBegin()
+ for _i110 in xrange(_size106):
+ _elem111 = CfDef()
+ _elem111.read(iprot)
+ self.cf_defs.append(_elem111)
iprot.readListEnd()
else:
iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.BOOL:
+ self.durable_writes = iprot.readBool();
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -2388,45 +2965,367 @@ def write(self, oprot):
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('KsDef')
- if self.name != None:
+ if self.name is not None:
oprot.writeFieldBegin('name', TType.STRING, 1)
oprot.writeString(self.name)
oprot.writeFieldEnd()
- if self.strategy_class != None:
+ if self.strategy_class is not None:
oprot.writeFieldBegin('strategy_class', TType.STRING, 2)
oprot.writeString(self.strategy_class)
oprot.writeFieldEnd()
- if self.strategy_options != None:
+ if self.strategy_options is not None:
oprot.writeFieldBegin('strategy_options', TType.MAP, 3)
oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.strategy_options))
- for kiter64,viter65 in self.strategy_options.items():