Repository: hbase Updated Branches: refs/heads/branch-2 0f39f0874 -> 9b9fd708b
http://git-wip-us.apache.org/repos/asf/hbase/blob/9b9fd708/hbase-examples/src/main/python/thrift2/gen-py/hbase/constants.py ---------------------------------------------------------------------- diff --git a/hbase-examples/src/main/python/thrift2/gen-py/hbase/constants.py b/hbase-examples/src/main/python/thrift2/gen-py/hbase/constants.py index a236326..4a6492b 100644 --- a/hbase-examples/src/main/python/thrift2/gen-py/hbase/constants.py +++ b/hbase-examples/src/main/python/thrift2/gen-py/hbase/constants.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.9.0) +# Autogenerated by Thrift Compiler (0.9.3) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # http://git-wip-us.apache.org/repos/asf/hbase/blob/9b9fd708/hbase-examples/src/main/python/thrift2/gen-py/hbase/ttypes.py ---------------------------------------------------------------------- diff --git a/hbase-examples/src/main/python/thrift2/gen-py/hbase/ttypes.py b/hbase-examples/src/main/python/thrift2/gen-py/hbase/ttypes.py index f80a10d..a5695d6 100644 --- a/hbase-examples/src/main/python/thrift2/gen-py/hbase/ttypes.py +++ b/hbase-examples/src/main/python/thrift2/gen-py/hbase/ttypes.py @@ -1,5 +1,5 @@ # -# Autogenerated by Thrift Compiler (0.9.0) +# Autogenerated by Thrift Compiler (0.9.3) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @@ -35,6 +35,83 @@ class TDeleteType: "DELETE_COLUMNS": 1, } +class TDurability: + """ + Specify Durability: + - SKIP_WAL means do not write the Mutation to the WAL. + - ASYNC_WAL means write the Mutation to the WAL asynchronously, + - SYNC_WAL means write the Mutation to the WAL synchronously, + - FSYNC_WAL means Write the Mutation to the WAL synchronously and force the entries to disk. + """ + SKIP_WAL = 1 + ASYNC_WAL = 2 + SYNC_WAL = 3 + FSYNC_WAL = 4 + + _VALUES_TO_NAMES = { + 1: "SKIP_WAL", + 2: "ASYNC_WAL", + 3: "SYNC_WAL", + 4: "FSYNC_WAL", + } + + _NAMES_TO_VALUES = { + "SKIP_WAL": 1, + "ASYNC_WAL": 2, + "SYNC_WAL": 3, + "FSYNC_WAL": 4, + } + +class TReadType: + DEFAULT = 1 + STREAM = 2 + PREAD = 3 + + _VALUES_TO_NAMES = { + 1: "DEFAULT", + 2: "STREAM", + 3: "PREAD", + } + + _NAMES_TO_VALUES = { + "DEFAULT": 1, + "STREAM": 2, + "PREAD": 3, + } + +class TCompareOp: + """ + Thrift wrapper around + org.apache.hadoop.hbase.filter.CompareFilter$CompareOp. + """ + LESS = 0 + LESS_OR_EQUAL = 1 + EQUAL = 2 + NOT_EQUAL = 3 + GREATER_OR_EQUAL = 4 + GREATER = 5 + NO_OP = 6 + + _VALUES_TO_NAMES = { + 0: "LESS", + 1: "LESS_OR_EQUAL", + 2: "EQUAL", + 3: "NOT_EQUAL", + 4: "GREATER_OR_EQUAL", + 5: "GREATER", + 6: "NO_OP", + } + + _NAMES_TO_VALUES = { + "LESS": 0, + "LESS_OR_EQUAL": 1, + "EQUAL": 2, + "NOT_EQUAL": 3, + "GREATER_OR_EQUAL": 4, + "GREATER": 5, + "NO_OP": 6, + } + class TTimeRange: """ @@ -64,12 +141,12 @@ class TTimeRange: break if fid == 1: if ftype == TType.I64: - self.minStamp = iprot.readI64(); + self.minStamp = iprot.readI64() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: - self.maxStamp = iprot.readI64(); + self.maxStamp = iprot.readI64() else: iprot.skip(ftype) else: @@ -101,6 +178,12 @@ class TTimeRange: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.minStamp) + value = (value * 31) ^ hash(self.maxStamp) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -147,17 +230,17 @@ class TColumn: break if fid == 1: if ftype == TType.STRING: - self.family = iprot.readString(); + self.family = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.qualifier = iprot.readString(); + self.qualifier = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) else: @@ -191,6 +274,13 @@ class TColumn: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.family) + value = (value * 31) ^ hash(self.qualifier) + value = (value * 31) ^ hash(self.timestamp) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -211,6 +301,7 @@ class TColumnValue: - qualifier - value - timestamp + - tags """ thrift_spec = ( @@ -219,13 +310,15 @@ class TColumnValue: (2, TType.STRING, 'qualifier', None, None, ), # 2 (3, TType.STRING, 'value', None, None, ), # 3 (4, TType.I64, 'timestamp', None, None, ), # 4 + (5, TType.STRING, 'tags', None, None, ), # 5 ) - def __init__(self, family=None, qualifier=None, value=None, timestamp=None,): + def __init__(self, family=None, qualifier=None, value=None, timestamp=None, tags=None,): self.family = family self.qualifier = qualifier self.value = value self.timestamp = timestamp + self.tags = tags 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: @@ -238,22 +331,27 @@ class TColumnValue: break if fid == 1: if ftype == TType.STRING: - self.family = iprot.readString(); + self.family = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.qualifier = iprot.readString(); + self.qualifier = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.value = iprot.readString(); + self.value = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.tags = iprot.readString() else: iprot.skip(ftype) else: @@ -282,6 +380,10 @@ class TColumnValue: oprot.writeFieldBegin('timestamp', TType.I64, 4) oprot.writeI64(self.timestamp) oprot.writeFieldEnd() + if self.tags is not None: + oprot.writeFieldBegin('tags', TType.STRING, 5) + oprot.writeString(self.tags) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -295,6 +397,15 @@ class TColumnValue: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.family) + value = (value * 31) ^ hash(self.qualifier) + value = (value * 31) ^ hash(self.value) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.tags) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -339,17 +450,17 @@ class TColumnIncrement: break if fid == 1: if ftype == TType.STRING: - self.family = iprot.readString(); + self.family = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.qualifier = iprot.readString(); + self.qualifier = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: - self.amount = iprot.readI64(); + self.amount = iprot.readI64() else: iprot.skip(ftype) else: @@ -385,6 +496,13 @@ class TColumnIncrement: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.family) + value = (value * 31) ^ hash(self.qualifier) + value = (value * 31) ^ hash(self.amount) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -426,7 +544,7 @@ class TResult: break if fid == 1: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) elif fid == 2: @@ -470,6 +588,150 @@ class TResult: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columnValues) + return value + + 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 TAuthorization: + """ + Attributes: + - labels + """ + + thrift_spec = ( + None, # 0 + (1, TType.LIST, 'labels', (TType.STRING,None), None, ), # 1 + ) + + def __init__(self, labels=None,): + self.labels = labels + + 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.labels = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in xrange(_size7): + _elem12 = iprot.readString() + self.labels.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('TAuthorization') + if self.labels is not None: + oprot.writeFieldBegin('labels', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.labels)) + for iter13 in self.labels: + oprot.writeString(iter13) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.labels) + return value + + 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 TCellVisibility: + """ + Attributes: + - expression + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'expression', None, None, ), # 1 + ) + + def __init__(self, expression=None,): + self.expression = expression + + 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.expression = 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('TCellVisibility') + if self.expression is not None: + oprot.writeFieldBegin('expression', TType.STRING, 1) + oprot.writeString(self.expression) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.expression) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -502,6 +764,8 @@ class TGet: - timeRange - maxVersions - filterString + - attributes + - authorizations """ thrift_spec = ( @@ -512,15 +776,19 @@ class TGet: (4, TType.STRUCT, 'timeRange', (TTimeRange, TTimeRange.thrift_spec), None, ), # 4 (5, TType.I32, 'maxVersions', None, None, ), # 5 (6, TType.STRING, 'filterString', None, None, ), # 6 + (7, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 7 + (8, TType.STRUCT, 'authorizations', (TAuthorization, TAuthorization.thrift_spec), None, ), # 8 ) - def __init__(self, row=None, columns=None, timestamp=None, timeRange=None, maxVersions=None, filterString=None,): + def __init__(self, row=None, columns=None, timestamp=None, timeRange=None, maxVersions=None, filterString=None, attributes=None, authorizations=None,): self.row = row self.columns = columns self.timestamp = timestamp self.timeRange = timeRange self.maxVersions = maxVersions self.filterString = filterString + self.attributes = attributes + self.authorizations = authorizations 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: @@ -533,23 +801,23 @@ class TGet: break if fid == 1: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = 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 = TColumn() - _elem12.read(iprot) - self.columns.append(_elem12) + (_etype17, _size14) = iprot.readListBegin() + for _i18 in xrange(_size14): + _elem19 = TColumn() + _elem19.read(iprot) + self.columns.append(_elem19) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: @@ -560,12 +828,29 @@ class TGet: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: - self.maxVersions = iprot.readI32(); + self.maxVersions = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.filterString = iprot.readString(); + self.filterString = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.MAP: + self.attributes = {} + (_ktype21, _vtype22, _size20 ) = iprot.readMapBegin() + for _i24 in xrange(_size20): + _key25 = iprot.readString() + _val26 = iprot.readString() + self.attributes[_key25] = _val26 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRUCT: + self.authorizations = TAuthorization() + self.authorizations.read(iprot) else: iprot.skip(ftype) else: @@ -585,8 +870,8 @@ class TGet: 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) + for iter27 in self.columns: + iter27.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -605,6 +890,18 @@ class TGet: oprot.writeFieldBegin('filterString', TType.STRING, 6) oprot.writeString(self.filterString) oprot.writeFieldEnd() + if self.attributes is not None: + oprot.writeFieldBegin('attributes', TType.MAP, 7) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) + for kiter28,viter29 in self.attributes.items(): + oprot.writeString(kiter28) + oprot.writeString(viter29) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.authorizations is not None: + oprot.writeFieldBegin('authorizations', TType.STRUCT, 8) + self.authorizations.write(oprot) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -614,6 +911,18 @@ class TGet: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.timeRange) + value = (value * 31) ^ hash(self.maxVersions) + value = (value * 31) ^ hash(self.filterString) + value = (value * 31) ^ hash(self.attributes) + value = (value * 31) ^ hash(self.authorizations) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -634,14 +943,17 @@ class TPut: don't have one. If you don't provide a default timestamp the current time is inserted. - You can also specify if this Put should be written - to the write-ahead Log (WAL) or not. It defaults to true. + You can specify how this Put should be written to the write-ahead Log (WAL) + by changing the durability. If you don't provide durability, it defaults to + column family's default setting for durability. Attributes: - row - columnValues - timestamp - - writeToWal + - attributes + - durability + - cellVisibility """ thrift_spec = ( @@ -649,14 +961,19 @@ class TPut: (1, TType.STRING, 'row', None, None, ), # 1 (2, TType.LIST, 'columnValues', (TType.STRUCT,(TColumnValue, TColumnValue.thrift_spec)), None, ), # 2 (3, TType.I64, 'timestamp', None, None, ), # 3 - (4, TType.BOOL, 'writeToWal', None, True, ), # 4 + None, # 4 + (5, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 5 + (6, TType.I32, 'durability', None, None, ), # 6 + (7, TType.STRUCT, 'cellVisibility', (TCellVisibility, TCellVisibility.thrift_spec), None, ), # 7 ) - def __init__(self, row=None, columnValues=None, timestamp=None, writeToWal=thrift_spec[4][4],): + def __init__(self, row=None, columnValues=None, timestamp=None, attributes=None, durability=None, cellVisibility=None,): self.row = row self.columnValues = columnValues self.timestamp = timestamp - self.writeToWal = writeToWal + self.attributes = attributes + self.durability = durability + self.cellVisibility = cellVisibility 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: @@ -669,28 +986,45 @@ class TPut: break if fid == 1: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.columnValues = [] - (_etype17, _size14) = iprot.readListBegin() - for _i18 in xrange(_size14): - _elem19 = TColumnValue() - _elem19.read(iprot) - self.columnValues.append(_elem19) + (_etype33, _size30) = iprot.readListBegin() + for _i34 in xrange(_size30): + _elem35 = TColumnValue() + _elem35.read(iprot) + self.columnValues.append(_elem35) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) - elif fid == 4: - if ftype == TType.BOOL: - self.writeToWal = iprot.readBool(); + elif fid == 5: + if ftype == TType.MAP: + self.attributes = {} + (_ktype37, _vtype38, _size36 ) = iprot.readMapBegin() + for _i40 in xrange(_size36): + _key41 = iprot.readString() + _val42 = iprot.readString() + self.attributes[_key41] = _val42 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I32: + self.durability = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.cellVisibility = TCellVisibility() + self.cellVisibility.read(iprot) else: iprot.skip(ftype) else: @@ -710,17 +1044,29 @@ class TPut: if self.columnValues is not None: oprot.writeFieldBegin('columnValues', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.columnValues)) - for iter20 in self.columnValues: - iter20.write(oprot) + for iter43 in self.columnValues: + iter43.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: oprot.writeFieldBegin('timestamp', TType.I64, 3) oprot.writeI64(self.timestamp) oprot.writeFieldEnd() - if self.writeToWal is not None: - oprot.writeFieldBegin('writeToWal', TType.BOOL, 4) - oprot.writeBool(self.writeToWal) + if self.attributes is not None: + oprot.writeFieldBegin('attributes', TType.MAP, 5) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) + for kiter44,viter45 in self.attributes.items(): + oprot.writeString(kiter44) + oprot.writeString(viter45) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.durability is not None: + oprot.writeFieldBegin('durability', TType.I32, 6) + oprot.writeI32(self.durability) + oprot.writeFieldEnd() + if self.cellVisibility is not None: + oprot.writeFieldBegin('cellVisibility', TType.STRUCT, 7) + self.cellVisibility.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -733,6 +1079,16 @@ class TPut: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columnValues) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + value = (value * 31) ^ hash(self.durability) + value = (value * 31) ^ hash(self.cellVisibility) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -767,13 +1123,17 @@ class TDelete: as if you had added a TColumn for every column family and this timestamp (i.e. all versions older than or equal in all column families will be deleted) + You can specify how this Delete should be written to the write-ahead Log (WAL) + by changing the durability. If you don't provide durability, it defaults to + column family's default setting for durability. Attributes: - row - columns - timestamp - deleteType - - writeToWal + - attributes + - durability """ thrift_spec = ( @@ -782,15 +1142,18 @@ class TDelete: (2, TType.LIST, 'columns', (TType.STRUCT,(TColumn, TColumn.thrift_spec)), None, ), # 2 (3, TType.I64, 'timestamp', None, None, ), # 3 (4, TType.I32, 'deleteType', None, 1, ), # 4 - (5, TType.BOOL, 'writeToWal', None, True, ), # 5 + None, # 5 + (6, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 6 + (7, TType.I32, 'durability', None, None, ), # 7 ) - def __init__(self, row=None, columns=None, timestamp=None, deleteType=thrift_spec[4][4], writeToWal=thrift_spec[5][4],): + def __init__(self, row=None, columns=None, timestamp=None, deleteType=thrift_spec[4][4], attributes=None, durability=None,): self.row = row self.columns = columns self.timestamp = timestamp self.deleteType = deleteType - self.writeToWal = writeToWal + self.attributes = attributes + self.durability = durability 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: @@ -803,33 +1166,44 @@ class TDelete: break if fid == 1: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.columns = [] - (_etype24, _size21) = iprot.readListBegin() - for _i25 in xrange(_size21): - _elem26 = TColumn() - _elem26.read(iprot) - self.columns.append(_elem26) + (_etype49, _size46) = iprot.readListBegin() + for _i50 in xrange(_size46): + _elem51 = TColumn() + _elem51.read(iprot) + self.columns.append(_elem51) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: - self.deleteType = iprot.readI32(); + self.deleteType = iprot.readI32() else: iprot.skip(ftype) - elif fid == 5: - if ftype == TType.BOOL: - self.writeToWal = iprot.readBool(); + elif fid == 6: + if ftype == TType.MAP: + self.attributes = {} + (_ktype53, _vtype54, _size52 ) = iprot.readMapBegin() + for _i56 in xrange(_size52): + _key57 = iprot.readString() + _val58 = iprot.readString() + self.attributes[_key57] = _val58 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.I32: + self.durability = iprot.readI32() else: iprot.skip(ftype) else: @@ -849,8 +1223,8 @@ class TDelete: 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 iter59 in self.columns: + iter59.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -861,9 +1235,17 @@ class TDelete: oprot.writeFieldBegin('deleteType', TType.I32, 4) oprot.writeI32(self.deleteType) oprot.writeFieldEnd() - if self.writeToWal is not None: - oprot.writeFieldBegin('writeToWal', TType.BOOL, 5) - oprot.writeBool(self.writeToWal) + if self.attributes is not None: + oprot.writeFieldBegin('attributes', TType.MAP, 6) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) + for kiter60,viter61 in self.attributes.items(): + oprot.writeString(kiter60) + oprot.writeString(viter61) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.durability is not None: + oprot.writeFieldBegin('durability', TType.I32, 7) + oprot.writeI32(self.durability) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -874,6 +1256,16 @@ class TDelete: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.deleteType) + value = (value * 31) ^ hash(self.attributes) + value = (value * 31) ^ hash(self.durability) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -889,26 +1281,34 @@ class TIncrement: """ Used to perform Increment operations for a single row. - You can specify if this Increment should be written - to the write-ahead Log (WAL) or not. It defaults to true. + You can specify how this Increment should be written to the write-ahead Log (WAL) + by changing the durability. If you don't provide durability, it defaults to + column family's default setting for durability. Attributes: - row - columns - - writeToWal + - attributes + - durability + - cellVisibility """ thrift_spec = ( None, # 0 (1, TType.STRING, 'row', None, None, ), # 1 (2, TType.LIST, 'columns', (TType.STRUCT,(TColumnIncrement, TColumnIncrement.thrift_spec)), None, ), # 2 - (3, TType.BOOL, 'writeToWal', None, True, ), # 3 + None, # 3 + (4, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 4 + (5, TType.I32, 'durability', None, None, ), # 5 + (6, TType.STRUCT, 'cellVisibility', (TCellVisibility, TCellVisibility.thrift_spec), None, ), # 6 ) - def __init__(self, row=None, columns=None, writeToWal=thrift_spec[3][4],): + def __init__(self, row=None, columns=None, attributes=None, durability=None, cellVisibility=None,): self.row = row self.columns = columns - self.writeToWal = writeToWal + self.attributes = attributes + self.durability = durability + self.cellVisibility = cellVisibility 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: @@ -921,23 +1321,40 @@ class TIncrement: break if fid == 1: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = 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 = TColumnIncrement() - _elem33.read(iprot) - self.columns.append(_elem33) + (_etype65, _size62) = iprot.readListBegin() + for _i66 in xrange(_size62): + _elem67 = TColumnIncrement() + _elem67.read(iprot) + self.columns.append(_elem67) iprot.readListEnd() else: iprot.skip(ftype) - elif fid == 3: - if ftype == TType.BOOL: - self.writeToWal = iprot.readBool(); + elif fid == 4: + if ftype == TType.MAP: + self.attributes = {} + (_ktype69, _vtype70, _size68 ) = iprot.readMapBegin() + for _i72 in xrange(_size68): + _key73 = iprot.readString() + _val74 = iprot.readString() + self.attributes[_key73] = _val74 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.durability = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.cellVisibility = TCellVisibility() + self.cellVisibility.read(iprot) else: iprot.skip(ftype) else: @@ -957,13 +1374,25 @@ class TIncrement: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.columns)) - for iter34 in self.columns: - iter34.write(oprot) + for iter75 in self.columns: + iter75.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() - if self.writeToWal is not None: - oprot.writeFieldBegin('writeToWal', TType.BOOL, 3) - oprot.writeBool(self.writeToWal) + if self.attributes is not None: + oprot.writeFieldBegin('attributes', TType.MAP, 4) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) + for kiter76,viter77 in self.attributes.items(): + oprot.writeString(kiter76) + oprot.writeString(viter77) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.durability is not None: + oprot.writeFieldBegin('durability', TType.I32, 5) + oprot.writeI32(self.durability) + oprot.writeFieldEnd() + if self.cellVisibility is not None: + oprot.writeFieldBegin('cellVisibility', TType.STRUCT, 6) + self.cellVisibility.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -976,6 +1405,15 @@ class TIncrement: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.attributes) + value = (value * 31) ^ hash(self.durability) + value = (value * 31) ^ hash(self.cellVisibility) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -987,43 +1425,31 @@ class TIncrement: def __ne__(self, other): return not (self == other) -class TScan: +class TAppend: """ - Any timestamps in the columns are ignored, use timeRange to select by timestamp. - Max versions defaults to 1. - Attributes: - - startRow - - stopRow + - row - columns - - caching - - maxVersions - - timeRange - - filterString - - batchSize + - attributes + - durability + - cellVisibility """ thrift_spec = ( None, # 0 - (1, TType.STRING, 'startRow', None, None, ), # 1 - (2, TType.STRING, 'stopRow', None, None, ), # 2 - (3, TType.LIST, 'columns', (TType.STRUCT,(TColumn, TColumn.thrift_spec)), None, ), # 3 - (4, TType.I32, 'caching', None, None, ), # 4 - (5, TType.I32, 'maxVersions', None, 1, ), # 5 - (6, TType.STRUCT, 'timeRange', (TTimeRange, TTimeRange.thrift_spec), None, ), # 6 - (7, TType.STRING, 'filterString', None, None, ), # 7 - (8, TType.I32, 'batchSize', None, None, ), # 8 + (1, TType.STRING, 'row', None, None, ), # 1 + (2, TType.LIST, 'columns', (TType.STRUCT,(TColumnValue, TColumnValue.thrift_spec)), None, ), # 2 + (3, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 3 + (4, TType.I32, 'durability', None, None, ), # 4 + (5, TType.STRUCT, 'cellVisibility', (TCellVisibility, TCellVisibility.thrift_spec), None, ), # 5 ) - def __init__(self, startRow=None, stopRow=None, columns=None, caching=None, maxVersions=thrift_spec[5][4], timeRange=None, filterString=None, batchSize=None,): - self.startRow = startRow - self.stopRow = stopRow + def __init__(self, row=None, columns=None, attributes=None, durability=None, cellVisibility=None,): + self.row = row self.columns = columns - self.caching = caching - self.maxVersions = maxVersions - self.timeRange = timeRange - self.filterString = filterString - self.batchSize = batchSize + self.attributes = attributes + self.durability = durability + self.cellVisibility = cellVisibility 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: @@ -1036,49 +1462,40 @@ class TScan: break if fid == 1: if ftype == TType.STRING: - self.startRow = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) elif fid == 2: - if ftype == TType.STRING: - self.stopRow = iprot.readString(); - else: - iprot.skip(ftype) - elif fid == 3: if ftype == TType.LIST: self.columns = [] - (_etype38, _size35) = iprot.readListBegin() - for _i39 in xrange(_size35): - _elem40 = TColumn() - _elem40.read(iprot) - self.columns.append(_elem40) + (_etype81, _size78) = iprot.readListBegin() + for _i82 in xrange(_size78): + _elem83 = TColumnValue() + _elem83.read(iprot) + self.columns.append(_elem83) iprot.readListEnd() else: iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.caching = iprot.readI32(); + elif fid == 3: + if ftype == TType.MAP: + self.attributes = {} + (_ktype85, _vtype86, _size84 ) = iprot.readMapBegin() + for _i88 in xrange(_size84): + _key89 = iprot.readString() + _val90 = iprot.readString() + self.attributes[_key89] = _val90 + iprot.readMapEnd() else: iprot.skip(ftype) - elif fid == 5: + elif fid == 4: if ftype == TType.I32: - self.maxVersions = iprot.readI32(); + self.durability = iprot.readI32() else: iprot.skip(ftype) - elif fid == 6: + elif fid == 5: if ftype == TType.STRUCT: - self.timeRange = TTimeRange() - self.timeRange.read(iprot) - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRING: - self.filterString = iprot.readString(); - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.I32: - self.batchSize = iprot.readI32(); + self.cellVisibility = TCellVisibility() + self.cellVisibility.read(iprot) else: iprot.skip(ftype) else: @@ -1090,10 +1507,242 @@ class TScan: 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('TScan') - if self.startRow is not None: - oprot.writeFieldBegin('startRow', TType.STRING, 1) - oprot.writeString(self.startRow) + oprot.writeStructBegin('TAppend') + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 1) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.columns)) + for iter91 in self.columns: + iter91.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.attributes is not None: + oprot.writeFieldBegin('attributes', TType.MAP, 3) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) + for kiter92,viter93 in self.attributes.items(): + oprot.writeString(kiter92) + oprot.writeString(viter93) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.durability is not None: + oprot.writeFieldBegin('durability', TType.I32, 4) + oprot.writeI32(self.durability) + oprot.writeFieldEnd() + if self.cellVisibility is not None: + oprot.writeFieldBegin('cellVisibility', TType.STRUCT, 5) + self.cellVisibility.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.row is None: + raise TProtocol.TProtocolException(message='Required field row is unset!') + if self.columns is None: + raise TProtocol.TProtocolException(message='Required field columns is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.attributes) + value = (value * 31) ^ hash(self.durability) + value = (value * 31) ^ hash(self.cellVisibility) + return value + + 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 TScan: + """ + Any timestamps in the columns are ignored but the colFamTimeRangeMap included, use timeRange to select by timestamp. + Max versions defaults to 1. + + Attributes: + - startRow + - stopRow + - columns + - caching + - maxVersions + - timeRange + - filterString + - batchSize + - attributes + - authorizations + - reversed + - cacheBlocks + - colFamTimeRangeMap + - readType + - limit + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'startRow', None, None, ), # 1 + (2, TType.STRING, 'stopRow', None, None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRUCT,(TColumn, TColumn.thrift_spec)), None, ), # 3 + (4, TType.I32, 'caching', None, None, ), # 4 + (5, TType.I32, 'maxVersions', None, 1, ), # 5 + (6, TType.STRUCT, 'timeRange', (TTimeRange, TTimeRange.thrift_spec), None, ), # 6 + (7, TType.STRING, 'filterString', None, None, ), # 7 + (8, TType.I32, 'batchSize', None, None, ), # 8 + (9, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 9 + (10, TType.STRUCT, 'authorizations', (TAuthorization, TAuthorization.thrift_spec), None, ), # 10 + (11, TType.BOOL, 'reversed', None, None, ), # 11 + (12, TType.BOOL, 'cacheBlocks', None, None, ), # 12 + (13, TType.MAP, 'colFamTimeRangeMap', (TType.STRING,None,TType.STRUCT,(TTimeRange, TTimeRange.thrift_spec)), None, ), # 13 + (14, TType.I32, 'readType', None, None, ), # 14 + (15, TType.I32, 'limit', None, None, ), # 15 + ) + + def __init__(self, startRow=None, stopRow=None, columns=None, caching=None, maxVersions=thrift_spec[5][4], timeRange=None, filterString=None, batchSize=None, attributes=None, authorizations=None, reversed=None, cacheBlocks=None, colFamTimeRangeMap=None, readType=None, limit=None,): + self.startRow = startRow + self.stopRow = stopRow + self.columns = columns + self.caching = caching + self.maxVersions = maxVersions + self.timeRange = timeRange + self.filterString = filterString + self.batchSize = batchSize + self.attributes = attributes + self.authorizations = authorizations + self.reversed = reversed + self.cacheBlocks = cacheBlocks + self.colFamTimeRangeMap = colFamTimeRangeMap + self.readType = readType + self.limit = limit + + 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.startRow = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.stopRow = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype97, _size94) = iprot.readListBegin() + for _i98 in xrange(_size94): + _elem99 = TColumn() + _elem99.read(iprot) + self.columns.append(_elem99) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.caching = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.maxVersions = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.timeRange = TTimeRange() + self.timeRange.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.filterString = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.I32: + self.batchSize = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.MAP: + self.attributes = {} + (_ktype101, _vtype102, _size100 ) = iprot.readMapBegin() + for _i104 in xrange(_size100): + _key105 = iprot.readString() + _val106 = iprot.readString() + self.attributes[_key105] = _val106 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 10: + if ftype == TType.STRUCT: + self.authorizations = TAuthorization() + self.authorizations.read(iprot) + else: + iprot.skip(ftype) + elif fid == 11: + if ftype == TType.BOOL: + self.reversed = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 12: + if ftype == TType.BOOL: + self.cacheBlocks = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 13: + if ftype == TType.MAP: + self.colFamTimeRangeMap = {} + (_ktype108, _vtype109, _size107 ) = iprot.readMapBegin() + for _i111 in xrange(_size107): + _key112 = iprot.readString() + _val113 = TTimeRange() + _val113.read(iprot) + self.colFamTimeRangeMap[_key112] = _val113 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 14: + if ftype == TType.I32: + self.readType = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 15: + if ftype == TType.I32: + self.limit = 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('TScan') + if self.startRow is not None: + oprot.writeFieldBegin('startRow', TType.STRING, 1) + oprot.writeString(self.startRow) oprot.writeFieldEnd() if self.stopRow is not None: oprot.writeFieldBegin('stopRow', TType.STRING, 2) @@ -1102,8 +1751,8 @@ class TScan: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.columns)) - for iter41 in self.columns: - iter41.write(oprot) + for iter114 in self.columns: + iter114.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.caching is not None: @@ -1126,6 +1775,42 @@ class TScan: oprot.writeFieldBegin('batchSize', TType.I32, 8) oprot.writeI32(self.batchSize) oprot.writeFieldEnd() + if self.attributes is not None: + oprot.writeFieldBegin('attributes', TType.MAP, 9) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) + for kiter115,viter116 in self.attributes.items(): + oprot.writeString(kiter115) + oprot.writeString(viter116) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.authorizations is not None: + oprot.writeFieldBegin('authorizations', TType.STRUCT, 10) + self.authorizations.write(oprot) + oprot.writeFieldEnd() + if self.reversed is not None: + oprot.writeFieldBegin('reversed', TType.BOOL, 11) + oprot.writeBool(self.reversed) + oprot.writeFieldEnd() + if self.cacheBlocks is not None: + oprot.writeFieldBegin('cacheBlocks', TType.BOOL, 12) + oprot.writeBool(self.cacheBlocks) + oprot.writeFieldEnd() + if self.colFamTimeRangeMap is not None: + oprot.writeFieldBegin('colFamTimeRangeMap', TType.MAP, 13) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.colFamTimeRangeMap)) + for kiter117,viter118 in self.colFamTimeRangeMap.items(): + oprot.writeString(kiter117) + viter118.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.readType is not None: + oprot.writeFieldBegin('readType', TType.I32, 14) + oprot.writeI32(self.readType) + oprot.writeFieldEnd() + if self.limit is not None: + oprot.writeFieldBegin('limit', TType.I32, 15) + oprot.writeI32(self.limit) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1133,6 +1818,524 @@ class TScan: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.startRow) + value = (value * 31) ^ hash(self.stopRow) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.caching) + value = (value * 31) ^ hash(self.maxVersions) + value = (value * 31) ^ hash(self.timeRange) + value = (value * 31) ^ hash(self.filterString) + value = (value * 31) ^ hash(self.batchSize) + value = (value * 31) ^ hash(self.attributes) + value = (value * 31) ^ hash(self.authorizations) + value = (value * 31) ^ hash(self.reversed) + value = (value * 31) ^ hash(self.cacheBlocks) + value = (value * 31) ^ hash(self.colFamTimeRangeMap) + value = (value * 31) ^ hash(self.readType) + value = (value * 31) ^ hash(self.limit) + return value + + 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 TMutation: + """ + Atomic mutation for the specified row. It can be either Put or Delete. + + Attributes: + - put + - deleteSingle + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'put', (TPut, TPut.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'deleteSingle', (TDelete, TDelete.thrift_spec), None, ), # 2 + ) + + def __init__(self, put=None, deleteSingle=None,): + self.put = put + self.deleteSingle = deleteSingle + + 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.put = TPut() + self.put.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.deleteSingle = TDelete() + self.deleteSingle.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('TMutation') + if self.put is not None: + oprot.writeFieldBegin('put', TType.STRUCT, 1) + self.put.write(oprot) + oprot.writeFieldEnd() + if self.deleteSingle is not None: + oprot.writeFieldBegin('deleteSingle', TType.STRUCT, 2) + self.deleteSingle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.put) + value = (value * 31) ^ hash(self.deleteSingle) + return value + + 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 TRowMutations: + """ + A TRowMutations object is used to apply a number of Mutations to a single row. + + Attributes: + - row + - mutations + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'row', None, None, ), # 1 + (2, TType.LIST, 'mutations', (TType.STRUCT,(TMutation, TMutation.thrift_spec)), None, ), # 2 + ) + + def __init__(self, row=None, mutations=None,): + self.row = row + self.mutations = mutations + + 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.row = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.mutations = [] + (_etype122, _size119) = iprot.readListBegin() + for _i123 in xrange(_size119): + _elem124 = TMutation() + _elem124.read(iprot) + self.mutations.append(_elem124) + 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('TRowMutations') + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 1) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.mutations is not None: + oprot.writeFieldBegin('mutations', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.mutations)) + for iter125 in self.mutations: + iter125.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.row is None: + raise TProtocol.TProtocolException(message='Required field row is unset!') + if self.mutations is None: + raise TProtocol.TProtocolException(message='Required field mutations is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.mutations) + return value + + 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 THRegionInfo: + """ + Attributes: + - regionId + - tableName + - startKey + - endKey + - offline + - split + - replicaId + """ + + thrift_spec = ( + None, # 0 + (1, TType.I64, 'regionId', None, None, ), # 1 + (2, TType.STRING, 'tableName', None, None, ), # 2 + (3, TType.STRING, 'startKey', None, None, ), # 3 + (4, TType.STRING, 'endKey', None, None, ), # 4 + (5, TType.BOOL, 'offline', None, None, ), # 5 + (6, TType.BOOL, 'split', None, None, ), # 6 + (7, TType.I32, 'replicaId', None, None, ), # 7 + ) + + def __init__(self, regionId=None, tableName=None, startKey=None, endKey=None, offline=None, split=None, replicaId=None,): + self.regionId = regionId + self.tableName = tableName + self.startKey = startKey + self.endKey = endKey + self.offline = offline + self.split = split + self.replicaId = replicaId + + 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.regionId = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.tableName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.startKey = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.endKey = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.BOOL: + self.offline = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.BOOL: + self.split = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.I32: + self.replicaId = 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('THRegionInfo') + if self.regionId is not None: + oprot.writeFieldBegin('regionId', TType.I64, 1) + oprot.writeI64(self.regionId) + oprot.writeFieldEnd() + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 2) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() + if self.startKey is not None: + oprot.writeFieldBegin('startKey', TType.STRING, 3) + oprot.writeString(self.startKey) + oprot.writeFieldEnd() + if self.endKey is not None: + oprot.writeFieldBegin('endKey', TType.STRING, 4) + oprot.writeString(self.endKey) + oprot.writeFieldEnd() + if self.offline is not None: + oprot.writeFieldBegin('offline', TType.BOOL, 5) + oprot.writeBool(self.offline) + oprot.writeFieldEnd() + if self.split is not None: + oprot.writeFieldBegin('split', TType.BOOL, 6) + oprot.writeBool(self.split) + oprot.writeFieldEnd() + if self.replicaId is not None: + oprot.writeFieldBegin('replicaId', TType.I32, 7) + oprot.writeI32(self.replicaId) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.regionId is None: + raise TProtocol.TProtocolException(message='Required field regionId is unset!') + if self.tableName is None: + raise TProtocol.TProtocolException(message='Required field tableName is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.regionId) + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.startKey) + value = (value * 31) ^ hash(self.endKey) + value = (value * 31) ^ hash(self.offline) + value = (value * 31) ^ hash(self.split) + value = (value * 31) ^ hash(self.replicaId) + return value + + 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 TServerName: + """ + Attributes: + - hostName + - port + - startCode + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'hostName', None, None, ), # 1 + (2, TType.I32, 'port', None, None, ), # 2 + (3, TType.I64, 'startCode', None, None, ), # 3 + ) + + def __init__(self, hostName=None, port=None, startCode=None,): + self.hostName = hostName + self.port = port + self.startCode = startCode + + 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.hostName = 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.I64: + self.startCode = 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('TServerName') + if self.hostName is not None: + oprot.writeFieldBegin('hostName', TType.STRING, 1) + oprot.writeString(self.hostName) + oprot.writeFieldEnd() + if self.port is not None: + oprot.writeFieldBegin('port', TType.I32, 2) + oprot.writeI32(self.port) + oprot.writeFieldEnd() + if self.startCode is not None: + oprot.writeFieldBegin('startCode', TType.I64, 3) + oprot.writeI64(self.startCode) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.hostName is None: + raise TProtocol.TProtocolException(message='Required field hostName is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.hostName) + value = (value * 31) ^ hash(self.port) + value = (value * 31) ^ hash(self.startCode) + return value + + 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 THRegionLocation: + """ + Attributes: + - serverName + - regionInfo + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'serverName', (TServerName, TServerName.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'regionInfo', (THRegionInfo, THRegionInfo.thrift_spec), None, ), # 2 + ) + + def __init__(self, serverName=None, regionInfo=None,): + self.serverName = serverName + self.regionInfo = regionInfo + + 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.serverName = TServerName() + self.serverName.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.regionInfo = THRegionInfo() + self.regionInfo.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('THRegionLocation') + if self.serverName is not None: + oprot.writeFieldBegin('serverName', TType.STRUCT, 1) + self.serverName.write(oprot) + oprot.writeFieldEnd() + if self.regionInfo is not None: + oprot.writeFieldBegin('regionInfo', TType.STRUCT, 2) + self.regionInfo.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.serverName is None: + raise TProtocol.TProtocolException(message='Required field serverName is unset!') + if self.regionInfo is None: + raise TProtocol.TProtocolException(message='Required field regionInfo is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.serverName) + value = (value * 31) ^ hash(self.regionInfo) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1173,7 +2376,7 @@ class TIOError(TException): break if fid == 1: if ftype == TType.STRING: - self.message = iprot.readString(); + self.message = iprot.readString() else: iprot.skip(ftype) else: @@ -1200,6 +2403,11 @@ class TIOError(TException): def __str__(self): return repr(self) + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.message) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1239,7 +2447,7 @@ class TIllegalArgument(TException): break if fid == 1: if ftype == TType.STRING: - self.message = iprot.readString(); + self.message = iprot.readString() else: iprot.skip(ftype) else: @@ -1266,6 +2474,11 @@ class TIllegalArgument(TException): def __str__(self): return repr(self) + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.message) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()]
