Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update trift bindings to 13.0.0

  • Loading branch information...
commit fb4ce8410d7fd0799fc7a2f32a1dbfc2deaa4d55 1 parent e6900dd
Jon Hermes authored
View
402 pycassa/cassandra/Cassandra.py
@@ -299,6 +299,24 @@ def system_rename_keyspace(self, old_name, new_name):
"""
pass
+ def system_update_keyspace(self, ks_def):
+ """
+ updates properties of a keyspace. returns the new schema id.
+
+ Parameters:
+ - ks_def
+ """
+ pass
+
+ def system_update_column_family(self, cf_def):
+ """
+ updates properties of a column family. returns the new schema id.
+
+ Parameters:
+ - cf_def
+ """
+ pass
+
class Client(Iface):
def __init__(self, iprot, oprot=None):
@@ -1317,6 +1335,74 @@ def recv_system_rename_keyspace(self, ):
raise result.ire
raise TApplicationException(TApplicationException.MISSING_RESULT, "system_rename_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.send_system_update_keyspace(ks_def)
+ return self.recv_system_update_keyspace()
+
+ def send_system_update_keyspace(self, ks_def):
+ self._oprot.writeMessageBegin('system_update_keyspace', TMessageType.CALL, self._seqid)
+ args = system_update_keyspace_args()
+ args.ks_def = ks_def
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_system_update_keyspace(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = system_update_keyspace_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ire != None:
+ raise result.ire
+ raise 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.send_system_update_column_family(cf_def)
+ return self.recv_system_update_column_family()
+
+ def send_system_update_column_family(self, cf_def):
+ self._oprot.writeMessageBegin('system_update_column_family', TMessageType.CALL, self._seqid)
+ args = system_update_column_family_args()
+ args.cf_def = cf_def
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_system_update_column_family(self, ):
+ (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(self._iprot)
+ self._iprot.readMessageEnd()
+ raise x
+ result = system_update_column_family_result()
+ result.read(self._iprot)
+ self._iprot.readMessageEnd()
+ if result.success != None:
+ return result.success
+ if result.ire != None:
+ raise result.ire
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "system_update_column_family failed: unknown result");
+
class Processor(Iface, TProcessor):
def __init__(self, handler):
@@ -1349,6 +1435,8 @@ def __init__(self, handler):
self._processMap["system_add_keyspace"] = Processor.process_system_add_keyspace
self._processMap["system_drop_keyspace"] = Processor.process_system_drop_keyspace
self._processMap["system_rename_keyspace"] = Processor.process_system_rename_keyspace
+ self._processMap["system_update_keyspace"] = Processor.process_system_update_keyspace
+ self._processMap["system_update_column_family"] = Processor.process_system_update_column_family
def process(self, iprot, oprot):
(name, type, seqid) = iprot.readMessageBegin()
@@ -1774,6 +1862,34 @@ def process_system_rename_keyspace(self, seqid, iprot, 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()
+ try:
+ result.success = self._handler.system_update_keyspace(args.ks_def)
+ except InvalidRequestException, ire:
+ result.ire = ire
+ 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()
+ try:
+ result.success = self._handler.system_update_column_family(args.cf_def)
+ except InvalidRequestException, ire:
+ result.ire = ire
+ oprot.writeMessageBegin("system_update_column_family", TMessageType.REPLY, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
# HELPER FUNCTIONS AND STRUCTURES
@@ -2602,7 +2718,7 @@ class multiget_slice_args:
thrift_spec = (
None, # 0
- (1, TType.LIST, 'keys', (TType.STRING,None), None, ), # 1
+ (1, TType.SET, '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
@@ -2624,13 +2740,13 @@ def read(self, iprot):
if ftype == TType.STOP:
break
if fid == 1:
- if ftype == TType.LIST:
- self.keys = []
- (_etype77, _size74) = iprot.readListBegin()
+ if ftype == TType.SET:
+ self.keys = set()
+ (_etype77, _size74) = iprot.readSetBegin()
for _i78 in xrange(_size74):
_elem79 = iprot.readString();
- self.keys.append(_elem79)
- iprot.readListEnd()
+ self.keys.add(_elem79)
+ iprot.readSetEnd()
else:
iprot.skip(ftype)
elif fid == 2:
@@ -2661,11 +2777,11 @@ def write(self, oprot):
return
oprot.writeStructBegin('multiget_slice_args')
if self.keys != None:
- oprot.writeFieldBegin('keys', TType.LIST, 1)
- oprot.writeListBegin(TType.STRING, len(self.keys))
+ oprot.writeFieldBegin('keys', TType.SET, 1)
+ oprot.writeSetBegin(TType.STRING, len(self.keys))
for iter80 in self.keys:
oprot.writeString(iter80)
- oprot.writeListEnd()
+ oprot.writeSetEnd()
oprot.writeFieldEnd()
if self.column_parent != None:
oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
@@ -2817,7 +2933,7 @@ class multiget_count_args:
thrift_spec = (
None, # 0
- (1, TType.LIST, 'keys', (TType.STRING,None), None, ), # 1
+ (1, TType.SET, '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
@@ -2839,13 +2955,13 @@ def read(self, iprot):
if ftype == TType.STOP:
break
if fid == 1:
- if ftype == TType.LIST:
- self.keys = []
- (_etype100, _size97) = iprot.readListBegin()
+ if ftype == TType.SET:
+ self.keys = set()
+ (_etype100, _size97) = iprot.readSetBegin()
for _i101 in xrange(_size97):
_elem102 = iprot.readString();
- self.keys.append(_elem102)
- iprot.readListEnd()
+ self.keys.add(_elem102)
+ iprot.readSetEnd()
else:
iprot.skip(ftype)
elif fid == 2:
@@ -2876,11 +2992,11 @@ def write(self, oprot):
return
oprot.writeStructBegin('multiget_count_args')
if self.keys != None:
- oprot.writeFieldBegin('keys', TType.LIST, 1)
- oprot.writeListBegin(TType.STRING, len(self.keys))
+ oprot.writeFieldBegin('keys', TType.SET, 1)
+ oprot.writeSetBegin(TType.STRING, len(self.keys))
for iter103 in self.keys:
oprot.writeString(iter103)
- oprot.writeListEnd()
+ oprot.writeSetEnd()
oprot.writeFieldEnd()
if self.column_parent != None:
oprot.writeFieldBegin('column_parent', TType.STRUCT, 2)
@@ -5768,4 +5884,254 @@ def __eq__(self, other):
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 __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
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', 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.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)
+ 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()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ 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 __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
+ """
+
+ thrift_spec = (
+ (0, TType.STRING, 'success', 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.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)
+ 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()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ 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)
+
View
2  pycassa/cassandra/constants.py
@@ -7,5 +7,5 @@
from thrift.Thrift import *
from ttypes import *
-VERSION = "12.0.0"
+VERSION = "13.0.0"
View
54 pycassa/cassandra/ttypes.py
@@ -93,34 +93,6 @@ class IndexOperator:
"LT": 4,
}
-class AccessLevel:
- """
- The AccessLevel is an enum that expresses the authorized access level granted to an API user:
-
- NONE No access permitted.
- READONLY Only read access is allowed.
- READWRITE Read and write access is allowed.
- FULL Read, write, and remove access is allowed.
- """
- NONE = 0
- READONLY = 16
- READWRITE = 32
- FULL = 64
-
- _VALUES_TO_NAMES = {
- 0: "NONE",
- 16: "READONLY",
- 32: "READWRITE",
- 64: "FULL",
- }
-
- _NAMES_TO_VALUES = {
- "NONE": 0,
- "READONLY": 16,
- "READWRITE": 32,
- "FULL": 64,
- }
-
class IndexType:
KEYS = 0
@@ -1983,6 +1955,8 @@ class CfDef:
- read_repair_chance
- column_metadata
- gc_grace_seconds
+ - default_validation_class
+ - id
"""
thrift_spec = (
@@ -2001,9 +1975,11 @@ class CfDef:
(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
)
- def __init__(self, keyspace=None, name=None, column_type=thrift_spec[3][4], clock_type=thrift_spec[4][4], comparator_type=thrift_spec[5][4], subcomparator_type=thrift_spec[6][4], reconciler=thrift_spec[7][4], comment=thrift_spec[8][4], row_cache_size=thrift_spec[9][4], preload_row_cache=thrift_spec[10][4], key_cache_size=thrift_spec[11][4], read_repair_chance=thrift_spec[12][4], column_metadata=None, gc_grace_seconds=None,):
+ def __init__(self, keyspace=None, name=None, column_type=thrift_spec[3][4], clock_type=thrift_spec[4][4], comparator_type=thrift_spec[5][4], subcomparator_type=thrift_spec[6][4], reconciler=thrift_spec[7][4], comment=thrift_spec[8][4], row_cache_size=thrift_spec[9][4], preload_row_cache=thrift_spec[10][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,):
self.keyspace = keyspace
self.name = name
self.column_type = column_type
@@ -2018,6 +1994,8 @@ def __init__(self, keyspace=None, name=None, column_type=thrift_spec[3][4], cloc
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
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:
@@ -2104,6 +2082,16 @@ def read(self, iprot):
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)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -2173,6 +2161,14 @@ def write(self, oprot):
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()
oprot.writeFieldStop()
oprot.writeStructEnd()
Please sign in to comment.
Something went wrong with that request. Please try again.