diff --git a/hbase-examples/src/main/python/thrift2/DemoClient.py b/hbase-examples/src/main/python/thrift2/DemoClient.py index c9811a6b2cd..63719f0e0b1 100644 --- a/hbase-examples/src/main/python/thrift2/DemoClient.py +++ b/hbase-examples/src/main/python/thrift2/DemoClient.py @@ -18,12 +18,12 @@ """ # Instructions: # 1. Run Thrift to generate the python module hbase -# thrift --gen py ../../../../../hbase-server/src/main/resources/org/apache/hadoop \ +# thrift --gen py ../../../../../hbase-thrift/src/main/resources/org/apache/hadoop \ # /hbase/thrift2/hbase.thrift # 2. Create a directory of your choosing that contains: # a. This file (DemoClient.py). # b. The directory gen-py/hbase (generated by instruction step 1). -# 3. pip install thrift==0.9.0 +# 3. pip install thrift==0.9.3 # 4. Create a table call "example", with a family called "family1" using the hbase shell. # 5. Start the hbase thrift2 server # bin/hbase thrift2 start diff --git a/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService-remote b/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService-remote index 8d3eeb94dbf..2b80916556c 100755 --- a/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService-remote +++ b/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService-remote @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# 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 # @@ -12,31 +12,39 @@ import pprint from urlparse import urlparse from thrift.transport import TTransport from thrift.transport import TSocket +from thrift.transport import TSSLSocket from thrift.transport import THttpClient from thrift.protocol import TBinaryProtocol -import THBaseService -from ttypes import * +from hbase import THBaseService +from hbase.ttypes import * if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print '' - print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]' - print '' - print 'Functions:' - print ' bool exists(string table, TGet get)' - print ' TResult get(string table, TGet get)' - print ' getMultiple(string table, gets)' - print ' void put(string table, TPut put)' - print ' bool checkAndPut(string table, string row, string family, string qualifier, string value, TPut put)' - print ' void putMultiple(string table, puts)' - print ' void deleteSingle(string table, TDelete deleteSingle)' - print ' deleteMultiple(string table, deletes)' - print ' bool checkAndDelete(string table, string row, string family, string qualifier, string value, TDelete deleteSingle)' - print ' TResult increment(string table, TIncrement increment)' - print ' i32 openScanner(string table, TScan scan)' - print ' getScannerRows(i32 scannerId, i32 numRows)' - print ' void closeScanner(i32 scannerId)' - print '' + print('') + print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] function [arg1 [arg2...]]') + print('') + print('Functions:') + print(' bool exists(string table, TGet tget)') + print(' existsAll(string table, tgets)') + print(' TResult get(string table, TGet tget)') + print(' getMultiple(string table, tgets)') + print(' void put(string table, TPut tput)') + print(' bool checkAndPut(string table, string row, string family, string qualifier, string value, TPut tput)') + print(' void putMultiple(string table, tputs)') + print(' void deleteSingle(string table, TDelete tdelete)') + print(' deleteMultiple(string table, tdeletes)') + print(' bool checkAndDelete(string table, string row, string family, string qualifier, string value, TDelete tdelete)') + print(' TResult increment(string table, TIncrement tincrement)') + print(' TResult append(string table, TAppend tappend)') + print(' i32 openScanner(string table, TScan tscan)') + print(' getScannerRows(i32 scannerId, i32 numRows)') + print(' void closeScanner(i32 scannerId)') + print(' void mutateRow(string table, TRowMutations trowMutations)') + print(' getScannerResults(string table, TScan tscan, i32 numRows)') + print(' THRegionLocation getRegionLocation(string table, string row, bool reload)') + print(' getAllRegionLocations(string table)') + print(' bool checkAndMutate(string table, string row, string family, string qualifier, TCompareOp compareOp, string value, TRowMutations rowMutations)') + print('') sys.exit(0) pp = pprint.PrettyPrinter(indent = 2) @@ -44,6 +52,7 @@ host = 'localhost' port = 9090 uri = '' framed = False +ssl = False http = False argi = 1 @@ -72,13 +81,17 @@ if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': framed = True argi += 1 +if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl': + ssl = True + argi += 1 + cmd = sys.argv[argi] args = sys.argv[argi+1:] if http: transport = THttpClient.THttpClient(host, port, uri) else: - socket = TSocket.TSocket(host, port) + socket = TSSLSocket.TSSLSocket(host, port, validate=False) if ssl else TSocket.TSocket(host, port) if framed: transport = TTransport.TFramedTransport(socket) else: @@ -89,84 +102,126 @@ transport.open() if cmd == 'exists': if len(args) != 2: - print 'exists requires 2 args' + print('exists requires 2 args') sys.exit(1) pp.pprint(client.exists(args[0],eval(args[1]),)) +elif cmd == 'existsAll': + if len(args) != 2: + print('existsAll requires 2 args') + sys.exit(1) + pp.pprint(client.existsAll(args[0],eval(args[1]),)) + elif cmd == 'get': if len(args) != 2: - print 'get requires 2 args' + print('get requires 2 args') sys.exit(1) pp.pprint(client.get(args[0],eval(args[1]),)) elif cmd == 'getMultiple': if len(args) != 2: - print 'getMultiple requires 2 args' + print('getMultiple requires 2 args') sys.exit(1) pp.pprint(client.getMultiple(args[0],eval(args[1]),)) elif cmd == 'put': if len(args) != 2: - print 'put requires 2 args' + print('put requires 2 args') sys.exit(1) pp.pprint(client.put(args[0],eval(args[1]),)) elif cmd == 'checkAndPut': if len(args) != 6: - print 'checkAndPut requires 6 args' + print('checkAndPut requires 6 args') sys.exit(1) pp.pprint(client.checkAndPut(args[0],args[1],args[2],args[3],args[4],eval(args[5]),)) elif cmd == 'putMultiple': if len(args) != 2: - print 'putMultiple requires 2 args' + print('putMultiple requires 2 args') sys.exit(1) pp.pprint(client.putMultiple(args[0],eval(args[1]),)) elif cmd == 'deleteSingle': if len(args) != 2: - print 'deleteSingle requires 2 args' + print('deleteSingle requires 2 args') sys.exit(1) pp.pprint(client.deleteSingle(args[0],eval(args[1]),)) elif cmd == 'deleteMultiple': if len(args) != 2: - print 'deleteMultiple requires 2 args' + print('deleteMultiple requires 2 args') sys.exit(1) pp.pprint(client.deleteMultiple(args[0],eval(args[1]),)) elif cmd == 'checkAndDelete': if len(args) != 6: - print 'checkAndDelete requires 6 args' + print('checkAndDelete requires 6 args') sys.exit(1) pp.pprint(client.checkAndDelete(args[0],args[1],args[2],args[3],args[4],eval(args[5]),)) elif cmd == 'increment': if len(args) != 2: - print 'increment requires 2 args' + print('increment requires 2 args') sys.exit(1) pp.pprint(client.increment(args[0],eval(args[1]),)) +elif cmd == 'append': + if len(args) != 2: + print('append requires 2 args') + sys.exit(1) + pp.pprint(client.append(args[0],eval(args[1]),)) + elif cmd == 'openScanner': if len(args) != 2: - print 'openScanner requires 2 args' + print('openScanner requires 2 args') sys.exit(1) pp.pprint(client.openScanner(args[0],eval(args[1]),)) elif cmd == 'getScannerRows': if len(args) != 2: - print 'getScannerRows requires 2 args' + print('getScannerRows requires 2 args') sys.exit(1) pp.pprint(client.getScannerRows(eval(args[0]),eval(args[1]),)) elif cmd == 'closeScanner': if len(args) != 1: - print 'closeScanner requires 1 args' + print('closeScanner requires 1 args') sys.exit(1) pp.pprint(client.closeScanner(eval(args[0]),)) +elif cmd == 'mutateRow': + if len(args) != 2: + print('mutateRow requires 2 args') + sys.exit(1) + pp.pprint(client.mutateRow(args[0],eval(args[1]),)) + +elif cmd == 'getScannerResults': + if len(args) != 3: + print('getScannerResults requires 3 args') + sys.exit(1) + pp.pprint(client.getScannerResults(args[0],eval(args[1]),eval(args[2]),)) + +elif cmd == 'getRegionLocation': + if len(args) != 3: + print('getRegionLocation requires 3 args') + sys.exit(1) + pp.pprint(client.getRegionLocation(args[0],args[1],eval(args[2]),)) + +elif cmd == 'getAllRegionLocations': + if len(args) != 1: + print('getAllRegionLocations requires 1 args') + sys.exit(1) + pp.pprint(client.getAllRegionLocations(args[0],)) + +elif cmd == 'checkAndMutate': + if len(args) != 7: + print('checkAndMutate requires 7 args') + sys.exit(1) + pp.pprint(client.checkAndMutate(args[0],args[1],args[2],args[3],eval(args[4]),args[5],eval(args[6]),)) + else: - print 'Unrecognized method %s' % cmd + print('Unrecognized method %s' % cmd) sys.exit(1) transport.close() diff --git a/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.py b/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.py index 405a8de2862..da8f4a392a1 100644 --- a/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.py +++ b/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.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 # @@ -7,6 +7,7 @@ # from thrift.Thrift import TType, TMessageType, TException, TApplicationException +import logging from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport @@ -18,7 +19,7 @@ except: class Iface: - def exists(self, table, get): + def exists(self, table, tget): """ Test for the existence of columns in the table, as specified in the TGet. @@ -26,11 +27,24 @@ class Iface: Parameters: - table: the table to check on - - get: the TGet to check for + - tget: the TGet to check for """ pass - def get(self, table, get): + def existsAll(self, table, tgets): + """ + Test for the existence of columns in the table, as specified by the TGets. + + This will return an array of booleans. Each value will be true if the related Get matches + one or more keys, false if not. + + Parameters: + - table: the table to check on + - tgets: a list of TGets to check for + """ + pass + + def get(self, table, tget): """ Method for getting data from a row. @@ -41,11 +55,11 @@ class Iface: Parameters: - table: the table to get from - - get: the TGet to fetch + - tget: the TGet to fetch """ pass - def getMultiple(self, table, gets): + def getMultiple(self, table, tgets): """ Method for getting multiple rows. @@ -57,23 +71,23 @@ class Iface: Parameters: - table: the table to get from - - gets: a list of TGets to fetch, the Result list + - tgets: a list of TGets to fetch, the Result list will have the Results at corresponding positions or null if there was an error """ pass - def put(self, table, put): + def put(self, table, tput): """ Commit a TPut to a table. Parameters: - table: the table to put data in - - put: the TPut to put + - tput: the TPut to put """ pass - def checkAndPut(self, table, row, family, qualifier, value, put): + def checkAndPut(self, table, row, family, qualifier, value, tput): """ Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the TPut. @@ -88,21 +102,21 @@ class Iface: - value: the expected value, if not provided the check is for the non-existence of the column in question - - put: the TPut to put if the check succeeds + - tput: the TPut to put if the check succeeds """ pass - def putMultiple(self, table, puts): + def putMultiple(self, table, tputs): """ Commit a List of Puts to the table. Parameters: - table: the table to put data in - - puts: a list of TPuts to commit + - tputs: a list of TPuts to commit """ pass - def deleteSingle(self, table, deleteSingle): + def deleteSingle(self, table, tdelete): """ Deletes as specified by the TDelete. @@ -111,11 +125,11 @@ class Iface: Parameters: - table: the table to delete from - - deleteSingle: the TDelete to delete + - tdelete: the TDelete to delete """ pass - def deleteMultiple(self, table, deletes): + def deleteMultiple(self, table, tdeletes): """ Bulk commit a List of TDeletes to the table. @@ -125,11 +139,11 @@ class Iface: Parameters: - table: the table to delete from - - deletes: list of TDeletes to delete + - tdeletes: list of TDeletes to delete """ pass - def checkAndDelete(self, table, row, family, qualifier, value, deleteSingle): + def checkAndDelete(self, table, row, family, qualifier, value, tdelete): """ Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the delete. @@ -144,19 +158,27 @@ class Iface: - value: the expected value, if not provided the check is for the non-existence of the column in question - - deleteSingle: the TDelete to execute if the check succeeds + - tdelete: the TDelete to execute if the check succeeds """ pass - def increment(self, table, increment): + def increment(self, table, tincrement): """ Parameters: - table: the table to increment the value on - - increment: the TIncrement to increment + - tincrement: the TIncrement to increment """ pass - def openScanner(self, table, scan): + def append(self, table, tappend): + """ + Parameters: + - table: the table to append the value on + - tappend: the TAppend to append + """ + pass + + def openScanner(self, table, tscan): """ Get a Scanner for the provided TScan object. @@ -164,7 +186,7 @@ class Iface: Parameters: - table: the table to get the Scanner for - - scan: the scan object to get a Scanner for + - tscan: the scan object to get a Scanner for """ pass @@ -182,16 +204,83 @@ class Iface: def closeScanner(self, scannerId): """ - Closes the scanner. Should be called if you need to close - the Scanner before all results are read. - - Exhausted scanners are closed automatically. + Closes the scanner. Should be called to free server side resources timely. + Typically close once the scanner is not needed anymore, i.e. after looping + over it to get all the required rows. Parameters: - scannerId: the Id of the Scanner to close * """ pass + def mutateRow(self, table, trowMutations): + """ + mutateRow performs multiple mutations atomically on a single row. + + Parameters: + - table: table to apply the mutations + - trowMutations: mutations to apply + """ + pass + + def getScannerResults(self, table, tscan, numRows): + """ + Get results for the provided TScan object. + This helper function opens a scanner, get the results and close the scanner. + + @return between zero and numRows TResults + + Parameters: + - table: the table to get the Scanner for + - tscan: the scan object to get a Scanner for + - numRows: number of rows to return + """ + pass + + def getRegionLocation(self, table, row, reload): + """ + Given a table and a row get the location of the region that + would contain the given row key. + + reload = true means the cache will be cleared and the location + will be fetched from meta. + + Parameters: + - table + - row + - reload + """ + pass + + def getAllRegionLocations(self, table): + """ + Get all of the region locations for a given table. + + + Parameters: + - table + """ + pass + + def checkAndMutate(self, table, row, family, qualifier, compareOp, value, rowMutations): + """ + Atomically checks if a row/family/qualifier value matches the expected + value. If it does, it mutates the row. + + @return true if the row was mutated, false otherwise + + Parameters: + - table: to check in and delete from + - row: row to check + - family: column family to check + - qualifier: column qualifier to check + - compareOp: comparison to make on the value + - value: the expected value to be compared against, if not provided the + check is for the non-existence of the column in question + - rowMutations: row mutations to execute if the value matches + """ + pass + class Client(Iface): def __init__(self, iprot, oprot=None): @@ -200,7 +289,7 @@ class Client(Iface): self._oprot = oprot self._seqid = 0 - def exists(self, table, get): + def exists(self, table, tget): """ Test for the existence of columns in the table, as specified in the TGet. @@ -208,37 +297,78 @@ class Client(Iface): Parameters: - table: the table to check on - - get: the TGet to check for + - tget: the TGet to check for """ - self.send_exists(table, get) + self.send_exists(table, tget) return self.recv_exists() - def send_exists(self, table, get): + def send_exists(self, table, tget): self._oprot.writeMessageBegin('exists', TMessageType.CALL, self._seqid) args = exists_args() args.table = table - args.get = get + args.tget = tget args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_exists(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_exists(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = exists_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "exists failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "exists failed: unknown result") - def get(self, table, get): + def existsAll(self, table, tgets): + """ + Test for the existence of columns in the table, as specified by the TGets. + + This will return an array of booleans. Each value will be true if the related Get matches + one or more keys, false if not. + + Parameters: + - table: the table to check on + - tgets: a list of TGets to check for + """ + self.send_existsAll(table, tgets) + return self.recv_existsAll() + + def send_existsAll(self, table, tgets): + self._oprot.writeMessageBegin('existsAll', TMessageType.CALL, self._seqid) + args = existsAll_args() + args.table = table + args.tgets = tgets + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_existsAll(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = existsAll_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "existsAll failed: unknown result") + + def get(self, table, tget): """ Method for getting data from a row. @@ -249,37 +379,38 @@ class Client(Iface): Parameters: - table: the table to get from - - get: the TGet to fetch + - tget: the TGet to fetch """ - self.send_get(table, get) + self.send_get(table, tget) return self.recv_get() - def send_get(self, table, get): + def send_get(self, table, tget): self._oprot.writeMessageBegin('get', TMessageType.CALL, self._seqid) args = get_args() args.table = table - args.get = get + args.tget = tget args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_get(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_get(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = get_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result") - def getMultiple(self, table, gets): + def getMultiple(self, table, tgets): """ Method for getting multiple rows. @@ -291,73 +422,75 @@ class Client(Iface): Parameters: - table: the table to get from - - gets: a list of TGets to fetch, the Result list + - tgets: a list of TGets to fetch, the Result list will have the Results at corresponding positions or null if there was an error """ - self.send_getMultiple(table, gets) + self.send_getMultiple(table, tgets) return self.recv_getMultiple() - def send_getMultiple(self, table, gets): + def send_getMultiple(self, table, tgets): self._oprot.writeMessageBegin('getMultiple', TMessageType.CALL, self._seqid) args = getMultiple_args() args.table = table - args.gets = gets + args.tgets = tgets args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getMultiple(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getMultiple(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = getMultiple_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "getMultiple failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getMultiple failed: unknown result") - def put(self, table, put): + def put(self, table, tput): """ Commit a TPut to a table. Parameters: - table: the table to put data in - - put: the TPut to put + - tput: the TPut to put """ - self.send_put(table, put) + self.send_put(table, tput) self.recv_put() - def send_put(self, table, put): + def send_put(self, table, tput): self._oprot.writeMessageBegin('put', TMessageType.CALL, self._seqid) args = put_args() args.table = table - args.put = put + args.tput = tput args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_put(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_put(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = put_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return - def checkAndPut(self, table, row, family, qualifier, value, put): + def checkAndPut(self, table, row, family, qualifier, value, tput): """ Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the TPut. @@ -372,12 +505,12 @@ class Client(Iface): - value: the expected value, if not provided the check is for the non-existence of the column in question - - put: the TPut to put if the check succeeds + - tput: the TPut to put if the check succeeds """ - self.send_checkAndPut(table, row, family, qualifier, value, put) + self.send_checkAndPut(table, row, family, qualifier, value, tput) return self.recv_checkAndPut() - def send_checkAndPut(self, table, row, family, qualifier, value, put): + def send_checkAndPut(self, table, row, family, qualifier, value, tput): self._oprot.writeMessageBegin('checkAndPut', TMessageType.CALL, self._seqid) args = checkAndPut_args() args.table = table @@ -385,62 +518,64 @@ class Client(Iface): args.family = family args.qualifier = qualifier args.value = value - args.put = put + args.tput = tput args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_checkAndPut(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_checkAndPut(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = checkAndPut_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result") - def putMultiple(self, table, puts): + def putMultiple(self, table, tputs): """ Commit a List of Puts to the table. Parameters: - table: the table to put data in - - puts: a list of TPuts to commit + - tputs: a list of TPuts to commit """ - self.send_putMultiple(table, puts) + self.send_putMultiple(table, tputs) self.recv_putMultiple() - def send_putMultiple(self, table, puts): + def send_putMultiple(self, table, tputs): self._oprot.writeMessageBegin('putMultiple', TMessageType.CALL, self._seqid) args = putMultiple_args() args.table = table - args.puts = puts + args.tputs = tputs args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_putMultiple(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_putMultiple(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = putMultiple_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return - def deleteSingle(self, table, deleteSingle): + def deleteSingle(self, table, tdelete): """ Deletes as specified by the TDelete. @@ -449,35 +584,36 @@ class Client(Iface): Parameters: - table: the table to delete from - - deleteSingle: the TDelete to delete + - tdelete: the TDelete to delete """ - self.send_deleteSingle(table, deleteSingle) + self.send_deleteSingle(table, tdelete) self.recv_deleteSingle() - def send_deleteSingle(self, table, deleteSingle): + def send_deleteSingle(self, table, tdelete): self._oprot.writeMessageBegin('deleteSingle', TMessageType.CALL, self._seqid) args = deleteSingle_args() args.table = table - args.deleteSingle = deleteSingle + args.tdelete = tdelete args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteSingle(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_deleteSingle(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = deleteSingle_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return - def deleteMultiple(self, table, deletes): + def deleteMultiple(self, table, tdeletes): """ Bulk commit a List of TDeletes to the table. @@ -487,37 +623,38 @@ class Client(Iface): Parameters: - table: the table to delete from - - deletes: list of TDeletes to delete + - tdeletes: list of TDeletes to delete """ - self.send_deleteMultiple(table, deletes) + self.send_deleteMultiple(table, tdeletes) return self.recv_deleteMultiple() - def send_deleteMultiple(self, table, deletes): + def send_deleteMultiple(self, table, tdeletes): self._oprot.writeMessageBegin('deleteMultiple', TMessageType.CALL, self._seqid) args = deleteMultiple_args() args.table = table - args.deletes = deletes + args.tdeletes = tdeletes args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteMultiple(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_deleteMultiple(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = deleteMultiple_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteMultiple failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteMultiple failed: unknown result") - def checkAndDelete(self, table, row, family, qualifier, value, deleteSingle): + def checkAndDelete(self, table, row, family, qualifier, value, tdelete): """ Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the delete. @@ -532,12 +669,12 @@ class Client(Iface): - value: the expected value, if not provided the check is for the non-existence of the column in question - - deleteSingle: the TDelete to execute if the check succeeds + - tdelete: the TDelete to execute if the check succeeds """ - self.send_checkAndDelete(table, row, family, qualifier, value, deleteSingle) + self.send_checkAndDelete(table, row, family, qualifier, value, tdelete) return self.recv_checkAndDelete() - def send_checkAndDelete(self, table, row, family, qualifier, value, deleteSingle): + def send_checkAndDelete(self, table, row, family, qualifier, value, tdelete): self._oprot.writeMessageBegin('checkAndDelete', TMessageType.CALL, self._seqid) args = checkAndDelete_args() args.table = table @@ -545,62 +682,99 @@ class Client(Iface): args.family = family args.qualifier = qualifier args.value = value - args.deleteSingle = deleteSingle + args.tdelete = tdelete args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_checkAndDelete(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_checkAndDelete(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = checkAndDelete_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndDelete failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndDelete failed: unknown result") - def increment(self, table, increment): + def increment(self, table, tincrement): """ Parameters: - table: the table to increment the value on - - increment: the TIncrement to increment + - tincrement: the TIncrement to increment """ - self.send_increment(table, increment) + self.send_increment(table, tincrement) return self.recv_increment() - def send_increment(self, table, increment): + def send_increment(self, table, tincrement): self._oprot.writeMessageBegin('increment', TMessageType.CALL, self._seqid) args = increment_args() args.table = table - args.increment = increment + args.tincrement = tincrement args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_increment(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_increment(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = increment_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "increment failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "increment failed: unknown result") - def openScanner(self, table, scan): + def append(self, table, tappend): + """ + Parameters: + - table: the table to append the value on + - tappend: the TAppend to append + """ + self.send_append(table, tappend) + return self.recv_append() + + def send_append(self, table, tappend): + self._oprot.writeMessageBegin('append', TMessageType.CALL, self._seqid) + args = append_args() + args.table = table + args.tappend = tappend + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_append(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = append_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "append failed: unknown result") + + def openScanner(self, table, tscan): """ Get a Scanner for the provided TScan object. @@ -608,35 +782,36 @@ class Client(Iface): Parameters: - table: the table to get the Scanner for - - scan: the scan object to get a Scanner for + - tscan: the scan object to get a Scanner for """ - self.send_openScanner(table, scan) + self.send_openScanner(table, tscan) return self.recv_openScanner() - def send_openScanner(self, table, scan): + def send_openScanner(self, table, tscan): self._oprot.writeMessageBegin('openScanner', TMessageType.CALL, self._seqid) args = openScanner_args() args.table = table - args.scan = scan + args.tscan = tscan args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_openScanner(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_openScanner(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = openScanner_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io - raise TApplicationException(TApplicationException.MISSING_RESULT, "openScanner failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "openScanner failed: unknown result") def getScannerRows(self, scannerId, numRows): """ @@ -660,30 +835,30 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getScannerRows(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getScannerRows(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = getScannerRows_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.success is not None: return result.success if result.io is not None: raise result.io if result.ia is not None: raise result.ia - raise TApplicationException(TApplicationException.MISSING_RESULT, "getScannerRows failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getScannerRows failed: unknown result") def closeScanner(self, scannerId): """ - Closes the scanner. Should be called if you need to close - the Scanner before all results are read. - - Exhausted scanners are closed automatically. + Closes the scanner. Should be called to free server side resources timely. + Typically close once the scanner is not needed anymore, i.e. after looping + over it to get all the required rows. Parameters: - scannerId: the Id of the Scanner to close * @@ -699,28 +874,237 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_closeScanner(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_closeScanner(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() if mtype == TMessageType.EXCEPTION: x = TApplicationException() - x.read(self._iprot) - self._iprot.readMessageEnd() + x.read(iprot) + iprot.readMessageEnd() raise x result = closeScanner_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io if result.ia is not None: raise result.ia return + def mutateRow(self, table, trowMutations): + """ + mutateRow performs multiple mutations atomically on a single row. + + Parameters: + - table: table to apply the mutations + - trowMutations: mutations to apply + """ + self.send_mutateRow(table, trowMutations) + self.recv_mutateRow() + + def send_mutateRow(self, table, trowMutations): + self._oprot.writeMessageBegin('mutateRow', TMessageType.CALL, self._seqid) + args = mutateRow_args() + args.table = table + args.trowMutations = trowMutations + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_mutateRow(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = mutateRow_result() + result.read(iprot) + iprot.readMessageEnd() + if result.io is not None: + raise result.io + return + + def getScannerResults(self, table, tscan, numRows): + """ + Get results for the provided TScan object. + This helper function opens a scanner, get the results and close the scanner. + + @return between zero and numRows TResults + + Parameters: + - table: the table to get the Scanner for + - tscan: the scan object to get a Scanner for + - numRows: number of rows to return + """ + self.send_getScannerResults(table, tscan, numRows) + return self.recv_getScannerResults() + + def send_getScannerResults(self, table, tscan, numRows): + self._oprot.writeMessageBegin('getScannerResults', TMessageType.CALL, self._seqid) + args = getScannerResults_args() + args.table = table + args.tscan = tscan + args.numRows = numRows + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getScannerResults(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getScannerResults_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getScannerResults failed: unknown result") + + def getRegionLocation(self, table, row, reload): + """ + Given a table and a row get the location of the region that + would contain the given row key. + + reload = true means the cache will be cleared and the location + will be fetched from meta. + + Parameters: + - table + - row + - reload + """ + self.send_getRegionLocation(table, row, reload) + return self.recv_getRegionLocation() + + def send_getRegionLocation(self, table, row, reload): + self._oprot.writeMessageBegin('getRegionLocation', TMessageType.CALL, self._seqid) + args = getRegionLocation_args() + args.table = table + args.row = row + args.reload = reload + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getRegionLocation(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getRegionLocation_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRegionLocation failed: unknown result") + + def getAllRegionLocations(self, table): + """ + Get all of the region locations for a given table. + + + Parameters: + - table + """ + self.send_getAllRegionLocations(table) + return self.recv_getAllRegionLocations() + + def send_getAllRegionLocations(self, table): + self._oprot.writeMessageBegin('getAllRegionLocations', TMessageType.CALL, self._seqid) + args = getAllRegionLocations_args() + args.table = table + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getAllRegionLocations(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getAllRegionLocations_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllRegionLocations failed: unknown result") + + def checkAndMutate(self, table, row, family, qualifier, compareOp, value, rowMutations): + """ + Atomically checks if a row/family/qualifier value matches the expected + value. If it does, it mutates the row. + + @return true if the row was mutated, false otherwise + + Parameters: + - table: to check in and delete from + - row: row to check + - family: column family to check + - qualifier: column qualifier to check + - compareOp: comparison to make on the value + - value: the expected value to be compared against, if not provided the + check is for the non-existence of the column in question + - rowMutations: row mutations to execute if the value matches + """ + self.send_checkAndMutate(table, row, family, qualifier, compareOp, value, rowMutations) + return self.recv_checkAndMutate() + + def send_checkAndMutate(self, table, row, family, qualifier, compareOp, value, rowMutations): + self._oprot.writeMessageBegin('checkAndMutate', TMessageType.CALL, self._seqid) + args = checkAndMutate_args() + args.table = table + args.row = row + args.family = family + args.qualifier = qualifier + args.compareOp = compareOp + args.value = value + args.rowMutations = rowMutations + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_checkAndMutate(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = checkAndMutate_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + if result.io is not None: + raise result.io + raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndMutate failed: unknown result") + class Processor(Iface, TProcessor): def __init__(self, handler): self._handler = handler self._processMap = {} self._processMap["exists"] = Processor.process_exists + self._processMap["existsAll"] = Processor.process_existsAll self._processMap["get"] = Processor.process_get self._processMap["getMultiple"] = Processor.process_getMultiple self._processMap["put"] = Processor.process_put @@ -730,9 +1114,15 @@ class Processor(Iface, TProcessor): self._processMap["deleteMultiple"] = Processor.process_deleteMultiple self._processMap["checkAndDelete"] = Processor.process_checkAndDelete self._processMap["increment"] = Processor.process_increment + self._processMap["append"] = Processor.process_append self._processMap["openScanner"] = Processor.process_openScanner self._processMap["getScannerRows"] = Processor.process_getScannerRows self._processMap["closeScanner"] = Processor.process_closeScanner + self._processMap["mutateRow"] = Processor.process_mutateRow + self._processMap["getScannerResults"] = Processor.process_getScannerResults + self._processMap["getRegionLocation"] = Processor.process_getRegionLocation + self._processMap["getAllRegionLocations"] = Processor.process_getAllRegionLocations + self._processMap["checkAndMutate"] = Processor.process_checkAndMutate def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() @@ -755,10 +1145,40 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = exists_result() try: - result.success = self._handler.exists(args.table, args.get) + result.success = self._handler.exists(args.table, args.tget) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("exists", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("exists", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_existsAll(self, seqid, iprot, oprot): + args = existsAll_args() + args.read(iprot) + iprot.readMessageEnd() + result = existsAll_result() + try: + result.success = self._handler.existsAll(args.table, args.tgets) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except TIOError as io: + msg_type = TMessageType.REPLY + result.io = io + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("existsAll", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -769,10 +1189,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = get_result() try: - result.success = self._handler.get(args.table, args.get) + result.success = self._handler.get(args.table, args.tget) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("get", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("get", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -783,10 +1211,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = getMultiple_result() try: - result.success = self._handler.getMultiple(args.table, args.gets) + result.success = self._handler.getMultiple(args.table, args.tgets) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getMultiple", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getMultiple", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -797,10 +1233,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = put_result() try: - self._handler.put(args.table, args.put) + self._handler.put(args.table, args.tput) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("put", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("put", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -811,10 +1255,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = checkAndPut_result() try: - result.success = self._handler.checkAndPut(args.table, args.row, args.family, args.qualifier, args.value, args.put) + result.success = self._handler.checkAndPut(args.table, args.row, args.family, args.qualifier, args.value, args.tput) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("checkAndPut", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("checkAndPut", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -825,10 +1277,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = putMultiple_result() try: - self._handler.putMultiple(args.table, args.puts) + self._handler.putMultiple(args.table, args.tputs) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("putMultiple", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("putMultiple", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -839,10 +1299,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = deleteSingle_result() try: - self._handler.deleteSingle(args.table, args.deleteSingle) + self._handler.deleteSingle(args.table, args.tdelete) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("deleteSingle", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("deleteSingle", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -853,10 +1321,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = deleteMultiple_result() try: - result.success = self._handler.deleteMultiple(args.table, args.deletes) + result.success = self._handler.deleteMultiple(args.table, args.tdeletes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("deleteMultiple", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("deleteMultiple", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -867,10 +1343,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = checkAndDelete_result() try: - result.success = self._handler.checkAndDelete(args.table, args.row, args.family, args.qualifier, args.value, args.deleteSingle) + result.success = self._handler.checkAndDelete(args.table, args.row, args.family, args.qualifier, args.value, args.tdelete) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("checkAndDelete", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("checkAndDelete", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -881,10 +1365,40 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = increment_result() try: - result.success = self._handler.increment(args.table, args.increment) + result.success = self._handler.increment(args.table, args.tincrement) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("increment", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("increment", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_append(self, seqid, iprot, oprot): + args = append_args() + args.read(iprot) + iprot.readMessageEnd() + result = append_result() + try: + result.success = self._handler.append(args.table, args.tappend) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except TIOError as io: + msg_type = TMessageType.REPLY + result.io = io + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("append", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -895,10 +1409,18 @@ class Processor(Iface, TProcessor): iprot.readMessageEnd() result = openScanner_result() try: - result.success = self._handler.openScanner(args.table, args.scan) + result.success = self._handler.openScanner(args.table, args.tscan) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("openScanner", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("openScanner", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -910,11 +1432,20 @@ class Processor(Iface, TProcessor): result = getScannerRows_result() try: result.success = self._handler.getScannerRows(args.scannerId, args.numRows) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io except TIllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("getScannerRows", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getScannerRows", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -926,11 +1457,130 @@ class Processor(Iface, TProcessor): result = closeScanner_result() try: self._handler.closeScanner(args.scannerId) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except TIOError as io: + msg_type = TMessageType.REPLY result.io = io except TIllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("closeScanner", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("closeScanner", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_mutateRow(self, seqid, iprot, oprot): + args = mutateRow_args() + args.read(iprot) + iprot.readMessageEnd() + result = mutateRow_result() + try: + self._handler.mutateRow(args.table, args.trowMutations) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except TIOError as io: + msg_type = TMessageType.REPLY + result.io = io + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("mutateRow", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getScannerResults(self, seqid, iprot, oprot): + args = getScannerResults_args() + args.read(iprot) + iprot.readMessageEnd() + result = getScannerResults_result() + try: + result.success = self._handler.getScannerResults(args.table, args.tscan, args.numRows) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except TIOError as io: + msg_type = TMessageType.REPLY + result.io = io + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getScannerResults", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRegionLocation(self, seqid, iprot, oprot): + args = getRegionLocation_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRegionLocation_result() + try: + result.success = self._handler.getRegionLocation(args.table, args.row, args.reload) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except TIOError as io: + msg_type = TMessageType.REPLY + result.io = io + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRegionLocation", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getAllRegionLocations(self, seqid, iprot, oprot): + args = getAllRegionLocations_args() + args.read(iprot) + iprot.readMessageEnd() + result = getAllRegionLocations_result() + try: + result.success = self._handler.getAllRegionLocations(args.table) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except TIOError as io: + msg_type = TMessageType.REPLY + result.io = io + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getAllRegionLocations", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_checkAndMutate(self, seqid, iprot, oprot): + args = checkAndMutate_args() + args.read(iprot) + iprot.readMessageEnd() + result = checkAndMutate_result() + try: + result.success = self._handler.checkAndMutate(args.table, args.row, args.family, args.qualifier, args.compareOp, args.value, args.rowMutations) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except TIOError as io: + msg_type = TMessageType.REPLY + result.io = io + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("checkAndMutate", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -942,18 +1592,18 @@ class exists_args: """ Attributes: - table: the table to check on - - get: the TGet to check for + - tget: the TGet to check for """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.STRUCT, 'get', (TGet, TGet.thrift_spec), None, ), # 2 + (2, TType.STRUCT, 'tget', (TGet, TGet.thrift_spec), None, ), # 2 ) - def __init__(self, table=None, get=None,): + def __init__(self, table=None, tget=None,): self.table = table - self.get = get + self.tget = tget 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: @@ -966,13 +1616,13 @@ class exists_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.get = TGet() - self.get.read(iprot) + self.tget = TGet() + self.tget.read(iprot) else: iprot.skip(ftype) else: @@ -989,9 +1639,9 @@ class exists_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.get is not None: - oprot.writeFieldBegin('get', TType.STRUCT, 2) - self.get.write(oprot) + if self.tget is not None: + oprot.writeFieldBegin('tget', TType.STRUCT, 2) + self.tget.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -999,11 +1649,17 @@ class exists_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.get is None: - raise TProtocol.TProtocolException(message='Required field get is unset!') + if self.tget is None: + raise TProtocol.TProtocolException(message='Required field tget is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tget) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1042,7 +1698,7 @@ class exists_result: break if fid == 0: if ftype == TType.BOOL: - self.success = iprot.readBool(); + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: @@ -1076,6 +1732,189 @@ class exists_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + 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 existsAll_args: + """ + Attributes: + - table: the table to check on + - tgets: a list of TGets to check for + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + (2, TType.LIST, 'tgets', (TType.STRUCT,(TGet, TGet.thrift_spec)), None, ), # 2 + ) + + def __init__(self, table=None, tgets=None,): + self.table = table + self.tgets = tgets + + 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.table = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.tgets = [] + (_etype129, _size126) = iprot.readListBegin() + for _i130 in xrange(_size126): + _elem131 = TGet() + _elem131.read(iprot) + self.tgets.append(_elem131) + 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('existsAll_args') + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 1) + oprot.writeString(self.table) + oprot.writeFieldEnd() + if self.tgets is not None: + oprot.writeFieldBegin('tgets', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.tgets)) + for iter132 in self.tgets: + iter132.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.table is None: + raise TProtocol.TProtocolException(message='Required field table is unset!') + if self.tgets is None: + raise TProtocol.TProtocolException(message='Required field tgets is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tgets) + 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 existsAll_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.BOOL,None), None, ), # 0 + (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype136, _size133) = iprot.readListBegin() + for _i137 in xrange(_size133): + _elem138 = iprot.readBool() + self.success.append(_elem138) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = TIOError() + self.io.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('existsAll_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.BOOL, len(self.success)) + for iter139 in self.success: + oprot.writeBool(iter139) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1091,18 +1930,18 @@ class get_args: """ Attributes: - table: the table to get from - - get: the TGet to fetch + - tget: the TGet to fetch """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.STRUCT, 'get', (TGet, TGet.thrift_spec), None, ), # 2 + (2, TType.STRUCT, 'tget', (TGet, TGet.thrift_spec), None, ), # 2 ) - def __init__(self, table=None, get=None,): + def __init__(self, table=None, tget=None,): self.table = table - self.get = get + self.tget = tget 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: @@ -1115,13 +1954,13 @@ class get_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.get = TGet() - self.get.read(iprot) + self.tget = TGet() + self.tget.read(iprot) else: iprot.skip(ftype) else: @@ -1138,9 +1977,9 @@ class get_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.get is not None: - oprot.writeFieldBegin('get', TType.STRUCT, 2) - self.get.write(oprot) + if self.tget is not None: + oprot.writeFieldBegin('tget', TType.STRUCT, 2) + self.tget.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1148,11 +1987,17 @@ class get_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.get is None: - raise TProtocol.TProtocolException(message='Required field get is unset!') + if self.tget is None: + raise TProtocol.TProtocolException(message='Required field tget is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tget) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1226,6 +2071,12 @@ class get_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1241,7 +2092,7 @@ class getMultiple_args: """ Attributes: - table: the table to get from - - gets: a list of TGets to fetch, the Result list + - tgets: a list of TGets to fetch, the Result list will have the Results at corresponding positions or null if there was an error """ @@ -1249,12 +2100,12 @@ class getMultiple_args: thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.LIST, 'gets', (TType.STRUCT,(TGet, TGet.thrift_spec)), None, ), # 2 + (2, TType.LIST, 'tgets', (TType.STRUCT,(TGet, TGet.thrift_spec)), None, ), # 2 ) - def __init__(self, table=None, gets=None,): + def __init__(self, table=None, tgets=None,): self.table = table - self.gets = gets + self.tgets = tgets 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: @@ -1267,17 +2118,17 @@ class getMultiple_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: - self.gets = [] - (_etype45, _size42) = iprot.readListBegin() - for _i46 in xrange(_size42): - _elem47 = TGet() - _elem47.read(iprot) - self.gets.append(_elem47) + self.tgets = [] + (_etype143, _size140) = iprot.readListBegin() + for _i144 in xrange(_size140): + _elem145 = TGet() + _elem145.read(iprot) + self.tgets.append(_elem145) iprot.readListEnd() else: iprot.skip(ftype) @@ -1295,11 +2146,11 @@ class getMultiple_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.gets is not None: - oprot.writeFieldBegin('gets', TType.LIST, 2) - oprot.writeListBegin(TType.STRUCT, len(self.gets)) - for iter48 in self.gets: - iter48.write(oprot) + if self.tgets is not None: + oprot.writeFieldBegin('tgets', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.tgets)) + for iter146 in self.tgets: + iter146.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -1308,11 +2159,17 @@ class getMultiple_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.gets is None: - raise TProtocol.TProtocolException(message='Required field gets is unset!') + if self.tgets is None: + raise TProtocol.TProtocolException(message='Required field tgets is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tgets) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1352,11 +2209,11 @@ class getMultiple_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype52, _size49) = iprot.readListBegin() - for _i53 in xrange(_size49): - _elem54 = TResult() - _elem54.read(iprot) - self.success.append(_elem54) + (_etype150, _size147) = iprot.readListBegin() + for _i151 in xrange(_size147): + _elem152 = TResult() + _elem152.read(iprot) + self.success.append(_elem152) iprot.readListEnd() else: iprot.skip(ftype) @@ -1379,8 +2236,8 @@ class getMultiple_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter55 in self.success: - iter55.write(oprot) + for iter153 in self.success: + iter153.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -1394,6 +2251,12 @@ class getMultiple_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1409,18 +2272,18 @@ class put_args: """ Attributes: - table: the table to put data in - - put: the TPut to put + - tput: the TPut to put """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.STRUCT, 'put', (TPut, TPut.thrift_spec), None, ), # 2 + (2, TType.STRUCT, 'tput', (TPut, TPut.thrift_spec), None, ), # 2 ) - def __init__(self, table=None, put=None,): + def __init__(self, table=None, tput=None,): self.table = table - self.put = put + self.tput = tput 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: @@ -1433,13 +2296,13 @@ class put_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.put = TPut() - self.put.read(iprot) + self.tput = TPut() + self.tput.read(iprot) else: iprot.skip(ftype) else: @@ -1456,9 +2319,9 @@ class put_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.put is not None: - oprot.writeFieldBegin('put', TType.STRUCT, 2) - self.put.write(oprot) + if self.tput is not None: + oprot.writeFieldBegin('tput', TType.STRUCT, 2) + self.tput.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1466,11 +2329,17 @@ class put_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.put is None: - raise TProtocol.TProtocolException(message='Required field put is unset!') + if self.tput is None: + raise TProtocol.TProtocolException(message='Required field tput is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tput) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1532,6 +2401,11 @@ class put_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1553,7 +2427,7 @@ class checkAndPut_args: - value: the expected value, if not provided the check is for the non-existence of the column in question - - put: the TPut to put if the check succeeds + - tput: the TPut to put if the check succeeds """ thrift_spec = ( @@ -1563,16 +2437,16 @@ class checkAndPut_args: (3, TType.STRING, 'family', None, None, ), # 3 (4, TType.STRING, 'qualifier', None, None, ), # 4 (5, TType.STRING, 'value', None, None, ), # 5 - (6, TType.STRUCT, 'put', (TPut, TPut.thrift_spec), None, ), # 6 + (6, TType.STRUCT, 'tput', (TPut, TPut.thrift_spec), None, ), # 6 ) - def __init__(self, table=None, row=None, family=None, qualifier=None, value=None, put=None,): + def __init__(self, table=None, row=None, family=None, qualifier=None, value=None, tput=None,): self.table = table self.row = row self.family = family self.qualifier = qualifier self.value = value - self.put = put + self.tput = tput 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: @@ -1585,33 +2459,33 @@ class checkAndPut_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.family = iprot.readString(); + self.family = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.qualifier = iprot.readString(); + self.qualifier = iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.value = iprot.readString(); + self.value = iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: - self.put = TPut() - self.put.read(iprot) + self.tput = TPut() + self.tput.read(iprot) else: iprot.skip(ftype) else: @@ -1644,9 +2518,9 @@ class checkAndPut_args: oprot.writeFieldBegin('value', TType.STRING, 5) oprot.writeString(self.value) oprot.writeFieldEnd() - if self.put is not None: - oprot.writeFieldBegin('put', TType.STRUCT, 6) - self.put.write(oprot) + if self.tput is not None: + oprot.writeFieldBegin('tput', TType.STRUCT, 6) + self.tput.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1660,11 +2534,21 @@ class checkAndPut_args: raise TProtocol.TProtocolException(message='Required field family is unset!') if self.qualifier is None: raise TProtocol.TProtocolException(message='Required field qualifier is unset!') - if self.put is None: - raise TProtocol.TProtocolException(message='Required field put is unset!') + if self.tput is None: + raise TProtocol.TProtocolException(message='Required field tput is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.family) + value = (value * 31) ^ hash(self.qualifier) + value = (value * 31) ^ hash(self.value) + value = (value * 31) ^ hash(self.tput) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1703,7 +2587,7 @@ class checkAndPut_result: break if fid == 0: if ftype == TType.BOOL: - self.success = iprot.readBool(); + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: @@ -1737,6 +2621,12 @@ class checkAndPut_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1752,18 +2642,18 @@ class putMultiple_args: """ Attributes: - table: the table to put data in - - puts: a list of TPuts to commit + - tputs: a list of TPuts to commit """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.LIST, 'puts', (TType.STRUCT,(TPut, TPut.thrift_spec)), None, ), # 2 + (2, TType.LIST, 'tputs', (TType.STRUCT,(TPut, TPut.thrift_spec)), None, ), # 2 ) - def __init__(self, table=None, puts=None,): + def __init__(self, table=None, tputs=None,): self.table = table - self.puts = puts + self.tputs = tputs 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,17 +2666,17 @@ class putMultiple_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: - self.puts = [] - (_etype59, _size56) = iprot.readListBegin() - for _i60 in xrange(_size56): - _elem61 = TPut() - _elem61.read(iprot) - self.puts.append(_elem61) + self.tputs = [] + (_etype157, _size154) = iprot.readListBegin() + for _i158 in xrange(_size154): + _elem159 = TPut() + _elem159.read(iprot) + self.tputs.append(_elem159) iprot.readListEnd() else: iprot.skip(ftype) @@ -1804,11 +2694,11 @@ class putMultiple_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.puts is not None: - oprot.writeFieldBegin('puts', TType.LIST, 2) - oprot.writeListBegin(TType.STRUCT, len(self.puts)) - for iter62 in self.puts: - iter62.write(oprot) + if self.tputs is not None: + oprot.writeFieldBegin('tputs', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.tputs)) + for iter160 in self.tputs: + iter160.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -1817,11 +2707,17 @@ class putMultiple_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.puts is None: - raise TProtocol.TProtocolException(message='Required field puts is unset!') + if self.tputs is None: + raise TProtocol.TProtocolException(message='Required field tputs is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tputs) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1883,6 +2779,11 @@ class putMultiple_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -1898,18 +2799,18 @@ class deleteSingle_args: """ Attributes: - table: the table to delete from - - deleteSingle: the TDelete to delete + - tdelete: the TDelete to delete """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.STRUCT, 'deleteSingle', (TDelete, TDelete.thrift_spec), None, ), # 2 + (2, TType.STRUCT, 'tdelete', (TDelete, TDelete.thrift_spec), None, ), # 2 ) - def __init__(self, table=None, deleteSingle=None,): + def __init__(self, table=None, tdelete=None,): self.table = table - self.deleteSingle = deleteSingle + self.tdelete = tdelete 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: @@ -1922,13 +2823,13 @@ class deleteSingle_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.deleteSingle = TDelete() - self.deleteSingle.read(iprot) + self.tdelete = TDelete() + self.tdelete.read(iprot) else: iprot.skip(ftype) else: @@ -1945,9 +2846,9 @@ class deleteSingle_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.deleteSingle is not None: - oprot.writeFieldBegin('deleteSingle', TType.STRUCT, 2) - self.deleteSingle.write(oprot) + if self.tdelete is not None: + oprot.writeFieldBegin('tdelete', TType.STRUCT, 2) + self.tdelete.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -1955,11 +2856,17 @@ class deleteSingle_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.deleteSingle is None: - raise TProtocol.TProtocolException(message='Required field deleteSingle is unset!') + if self.tdelete is None: + raise TProtocol.TProtocolException(message='Required field tdelete is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tdelete) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2021,6 +2928,11 @@ class deleteSingle_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2036,18 +2948,18 @@ class deleteMultiple_args: """ Attributes: - table: the table to delete from - - deletes: list of TDeletes to delete + - tdeletes: list of TDeletes to delete """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.LIST, 'deletes', (TType.STRUCT,(TDelete, TDelete.thrift_spec)), None, ), # 2 + (2, TType.LIST, 'tdeletes', (TType.STRUCT,(TDelete, TDelete.thrift_spec)), None, ), # 2 ) - def __init__(self, table=None, deletes=None,): + def __init__(self, table=None, tdeletes=None,): self.table = table - self.deletes = deletes + self.tdeletes = tdeletes 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: @@ -2060,17 +2972,17 @@ class deleteMultiple_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: - self.deletes = [] - (_etype66, _size63) = iprot.readListBegin() - for _i67 in xrange(_size63): - _elem68 = TDelete() - _elem68.read(iprot) - self.deletes.append(_elem68) + self.tdeletes = [] + (_etype164, _size161) = iprot.readListBegin() + for _i165 in xrange(_size161): + _elem166 = TDelete() + _elem166.read(iprot) + self.tdeletes.append(_elem166) iprot.readListEnd() else: iprot.skip(ftype) @@ -2088,11 +3000,11 @@ class deleteMultiple_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.deletes is not None: - oprot.writeFieldBegin('deletes', TType.LIST, 2) - oprot.writeListBegin(TType.STRUCT, len(self.deletes)) - for iter69 in self.deletes: - iter69.write(oprot) + if self.tdeletes is not None: + oprot.writeFieldBegin('tdeletes', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.tdeletes)) + for iter167 in self.tdeletes: + iter167.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -2101,11 +3013,17 @@ class deleteMultiple_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.deletes is None: - raise TProtocol.TProtocolException(message='Required field deletes is unset!') + if self.tdeletes is None: + raise TProtocol.TProtocolException(message='Required field tdeletes is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tdeletes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2145,11 +3063,11 @@ class deleteMultiple_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype73, _size70) = iprot.readListBegin() - for _i74 in xrange(_size70): - _elem75 = TDelete() - _elem75.read(iprot) - self.success.append(_elem75) + (_etype171, _size168) = iprot.readListBegin() + for _i172 in xrange(_size168): + _elem173 = TDelete() + _elem173.read(iprot) + self.success.append(_elem173) iprot.readListEnd() else: iprot.skip(ftype) @@ -2172,8 +3090,8 @@ class deleteMultiple_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter76 in self.success: - iter76.write(oprot) + for iter174 in self.success: + iter174.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -2187,6 +3105,12 @@ class deleteMultiple_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2208,7 +3132,7 @@ class checkAndDelete_args: - value: the expected value, if not provided the check is for the non-existence of the column in question - - deleteSingle: the TDelete to execute if the check succeeds + - tdelete: the TDelete to execute if the check succeeds """ thrift_spec = ( @@ -2218,16 +3142,16 @@ class checkAndDelete_args: (3, TType.STRING, 'family', None, None, ), # 3 (4, TType.STRING, 'qualifier', None, None, ), # 4 (5, TType.STRING, 'value', None, None, ), # 5 - (6, TType.STRUCT, 'deleteSingle', (TDelete, TDelete.thrift_spec), None, ), # 6 + (6, TType.STRUCT, 'tdelete', (TDelete, TDelete.thrift_spec), None, ), # 6 ) - def __init__(self, table=None, row=None, family=None, qualifier=None, value=None, deleteSingle=None,): + def __init__(self, table=None, row=None, family=None, qualifier=None, value=None, tdelete=None,): self.table = table self.row = row self.family = family self.qualifier = qualifier self.value = value - self.deleteSingle = deleteSingle + self.tdelete = tdelete 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: @@ -2240,33 +3164,33 @@ class checkAndDelete_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.family = iprot.readString(); + self.family = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.qualifier = iprot.readString(); + self.qualifier = iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.value = iprot.readString(); + self.value = iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRUCT: - self.deleteSingle = TDelete() - self.deleteSingle.read(iprot) + self.tdelete = TDelete() + self.tdelete.read(iprot) else: iprot.skip(ftype) else: @@ -2299,9 +3223,9 @@ class checkAndDelete_args: oprot.writeFieldBegin('value', TType.STRING, 5) oprot.writeString(self.value) oprot.writeFieldEnd() - if self.deleteSingle is not None: - oprot.writeFieldBegin('deleteSingle', TType.STRUCT, 6) - self.deleteSingle.write(oprot) + if self.tdelete is not None: + oprot.writeFieldBegin('tdelete', TType.STRUCT, 6) + self.tdelete.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2315,11 +3239,21 @@ class checkAndDelete_args: raise TProtocol.TProtocolException(message='Required field family is unset!') if self.qualifier is None: raise TProtocol.TProtocolException(message='Required field qualifier is unset!') - if self.deleteSingle is None: - raise TProtocol.TProtocolException(message='Required field deleteSingle is unset!') + if self.tdelete is None: + raise TProtocol.TProtocolException(message='Required field tdelete is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.family) + value = (value * 31) ^ hash(self.qualifier) + value = (value * 31) ^ hash(self.value) + value = (value * 31) ^ hash(self.tdelete) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2358,7 +3292,7 @@ class checkAndDelete_result: break if fid == 0: if ftype == TType.BOOL: - self.success = iprot.readBool(); + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: @@ -2392,6 +3326,12 @@ class checkAndDelete_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2407,18 +3347,18 @@ class increment_args: """ Attributes: - table: the table to increment the value on - - increment: the TIncrement to increment + - tincrement: the TIncrement to increment """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.STRUCT, 'increment', (TIncrement, TIncrement.thrift_spec), None, ), # 2 + (2, TType.STRUCT, 'tincrement', (TIncrement, TIncrement.thrift_spec), None, ), # 2 ) - def __init__(self, table=None, increment=None,): + def __init__(self, table=None, tincrement=None,): self.table = table - self.increment = increment + self.tincrement = tincrement 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: @@ -2431,13 +3371,13 @@ class increment_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.increment = TIncrement() - self.increment.read(iprot) + self.tincrement = TIncrement() + self.tincrement.read(iprot) else: iprot.skip(ftype) else: @@ -2454,9 +3394,9 @@ class increment_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.increment is not None: - oprot.writeFieldBegin('increment', TType.STRUCT, 2) - self.increment.write(oprot) + if self.tincrement is not None: + oprot.writeFieldBegin('tincrement', TType.STRUCT, 2) + self.tincrement.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2464,11 +3404,17 @@ class increment_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.increment is None: - raise TProtocol.TProtocolException(message='Required field increment is unset!') + if self.tincrement is None: + raise TProtocol.TProtocolException(message='Required field tincrement is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tincrement) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2542,6 +3488,174 @@ class increment_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + 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 append_args: + """ + Attributes: + - table: the table to append the value on + - tappend: the TAppend to append + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + (2, TType.STRUCT, 'tappend', (TAppend, TAppend.thrift_spec), None, ), # 2 + ) + + def __init__(self, table=None, tappend=None,): + self.table = table + self.tappend = tappend + + 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.table = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.tappend = TAppend() + self.tappend.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('append_args') + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 1) + oprot.writeString(self.table) + oprot.writeFieldEnd() + if self.tappend is not None: + oprot.writeFieldBegin('tappend', TType.STRUCT, 2) + self.tappend.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.table is None: + raise TProtocol.TProtocolException(message='Required field table is unset!') + if self.tappend is None: + raise TProtocol.TProtocolException(message='Required field tappend is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tappend) + 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 append_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TResult, TResult.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = TResult() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = TIOError() + self.io.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('append_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2557,18 +3671,18 @@ class openScanner_args: """ Attributes: - table: the table to get the Scanner for - - scan: the scan object to get a Scanner for + - tscan: the scan object to get a Scanner for """ thrift_spec = ( None, # 0 (1, TType.STRING, 'table', None, None, ), # 1 - (2, TType.STRUCT, 'scan', (TScan, TScan.thrift_spec), None, ), # 2 + (2, TType.STRUCT, 'tscan', (TScan, TScan.thrift_spec), None, ), # 2 ) - def __init__(self, table=None, scan=None,): + def __init__(self, table=None, tscan=None,): self.table = table - self.scan = scan + self.tscan = tscan 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: @@ -2581,13 +3695,13 @@ class openScanner_args: break if fid == 1: if ftype == TType.STRING: - self.table = iprot.readString(); + self.table = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRUCT: - self.scan = TScan() - self.scan.read(iprot) + self.tscan = TScan() + self.tscan.read(iprot) else: iprot.skip(ftype) else: @@ -2604,9 +3718,9 @@ class openScanner_args: oprot.writeFieldBegin('table', TType.STRING, 1) oprot.writeString(self.table) oprot.writeFieldEnd() - if self.scan is not None: - oprot.writeFieldBegin('scan', TType.STRUCT, 2) - self.scan.write(oprot) + if self.tscan is not None: + oprot.writeFieldBegin('tscan', TType.STRUCT, 2) + self.tscan.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -2614,11 +3728,17 @@ class openScanner_args: def validate(self): if self.table is None: raise TProtocol.TProtocolException(message='Required field table is unset!') - if self.scan is None: - raise TProtocol.TProtocolException(message='Required field scan is unset!') + if self.tscan is None: + raise TProtocol.TProtocolException(message='Required field tscan is unset!') return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tscan) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2657,7 +3777,7 @@ class openScanner_result: break if fid == 0: if ftype == TType.I32: - self.success = iprot.readI32(); + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: @@ -2691,6 +3811,12 @@ class openScanner_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2730,12 +3856,12 @@ class getScannerRows_args: break if fid == 1: if ftype == TType.I32: - self.scannerId = iprot.readI32(); + self.scannerId = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: - self.numRows = iprot.readI32(); + self.numRows = iprot.readI32() else: iprot.skip(ftype) else: @@ -2765,6 +3891,12 @@ class getScannerRows_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.scannerId) + value = (value * 31) ^ hash(self.numRows) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2807,11 +3939,11 @@ class getScannerRows_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype80, _size77) = iprot.readListBegin() - for _i81 in xrange(_size77): - _elem82 = TResult() - _elem82.read(iprot) - self.success.append(_elem82) + (_etype178, _size175) = iprot.readListBegin() + for _i179 in xrange(_size175): + _elem180 = TResult() + _elem180.read(iprot) + self.success.append(_elem180) iprot.readListEnd() else: iprot.skip(ftype) @@ -2840,8 +3972,8 @@ class getScannerRows_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter83 in self.success: - iter83.write(oprot) + for iter181 in self.success: + iter181.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -2859,6 +3991,13 @@ class getScannerRows_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + value = (value * 31) ^ hash(self.ia) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2895,7 +4034,7 @@ class closeScanner_args: break if fid == 1: if ftype == TType.I32: - self.scannerId = iprot.readI32(); + self.scannerId = iprot.readI32() else: iprot.skip(ftype) else: @@ -2921,6 +4060,11 @@ class closeScanner_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.scannerId) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -2995,6 +4139,907 @@ class closeScanner_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.io) + value = (value * 31) ^ hash(self.ia) + 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 mutateRow_args: + """ + Attributes: + - table: table to apply the mutations + - trowMutations: mutations to apply + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + (2, TType.STRUCT, 'trowMutations', (TRowMutations, TRowMutations.thrift_spec), None, ), # 2 + ) + + def __init__(self, table=None, trowMutations=None,): + self.table = table + self.trowMutations = trowMutations + + 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.table = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.trowMutations = TRowMutations() + self.trowMutations.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('mutateRow_args') + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 1) + oprot.writeString(self.table) + oprot.writeFieldEnd() + if self.trowMutations is not None: + oprot.writeFieldBegin('trowMutations', TType.STRUCT, 2) + self.trowMutations.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.table is None: + raise TProtocol.TProtocolException(message='Required field table is unset!') + if self.trowMutations is None: + raise TProtocol.TProtocolException(message='Required field trowMutations is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.trowMutations) + 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 mutateRow_result: + """ + Attributes: + - io + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, io=None,): + self.io = io + + 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.io = TIOError() + self.io.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('mutateRow_result') + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.io) + 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 getScannerResults_args: + """ + Attributes: + - table: the table to get the Scanner for + - tscan: the scan object to get a Scanner for + - numRows: number of rows to return + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + (2, TType.STRUCT, 'tscan', (TScan, TScan.thrift_spec), None, ), # 2 + (3, TType.I32, 'numRows', None, 1, ), # 3 + ) + + def __init__(self, table=None, tscan=None, numRows=thrift_spec[3][4],): + self.table = table + self.tscan = tscan + self.numRows = numRows + + 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.table = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.tscan = TScan() + self.tscan.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.numRows = 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('getScannerResults_args') + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 1) + oprot.writeString(self.table) + oprot.writeFieldEnd() + if self.tscan is not None: + oprot.writeFieldBegin('tscan', TType.STRUCT, 2) + self.tscan.write(oprot) + oprot.writeFieldEnd() + if self.numRows is not None: + oprot.writeFieldBegin('numRows', TType.I32, 3) + oprot.writeI32(self.numRows) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.table is None: + raise TProtocol.TProtocolException(message='Required field table is unset!') + if self.tscan is None: + raise TProtocol.TProtocolException(message='Required field tscan is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.tscan) + value = (value * 31) ^ hash(self.numRows) + 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 getScannerResults_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(TResult, TResult.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype185, _size182) = iprot.readListBegin() + for _i186 in xrange(_size182): + _elem187 = TResult() + _elem187.read(iprot) + self.success.append(_elem187) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = TIOError() + self.io.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('getScannerResults_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter188 in self.success: + iter188.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + 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 getRegionLocation_args: + """ + Attributes: + - table + - row + - reload + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.BOOL, 'reload', None, None, ), # 3 + ) + + def __init__(self, table=None, row=None, reload=None,): + self.table = table + self.row = row + self.reload = reload + + 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.table = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.reload = iprot.readBool() + 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('getRegionLocation_args') + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 1) + oprot.writeString(self.table) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.reload is not None: + oprot.writeFieldBegin('reload', TType.BOOL, 3) + oprot.writeBool(self.reload) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.table is None: + raise TProtocol.TProtocolException(message='Required field table is unset!') + if self.row is None: + raise TProtocol.TProtocolException(message='Required field row is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.reload) + 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 getRegionLocation_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (THRegionLocation, THRegionLocation.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.STRUCT: + self.success = THRegionLocation() + self.success.read(iprot) + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = TIOError() + self.io.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('getRegionLocation_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + 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 getAllRegionLocations_args: + """ + Attributes: + - table + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + ) + + def __init__(self, table=None,): + self.table = table + + 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.table = 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('getAllRegionLocations_args') + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 1) + oprot.writeString(self.table) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.table is None: + raise TProtocol.TProtocolException(message='Required field table is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + 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 getAllRegionLocations_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.LIST, 'success', (TType.STRUCT,(THRegionLocation, THRegionLocation.thrift_spec)), None, ), # 0 + (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.LIST: + self.success = [] + (_etype192, _size189) = iprot.readListBegin() + for _i193 in xrange(_size189): + _elem194 = THRegionLocation() + _elem194.read(iprot) + self.success.append(_elem194) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = TIOError() + self.io.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('getAllRegionLocations_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.LIST, 0) + oprot.writeListBegin(TType.STRUCT, len(self.success)) + for iter195 in self.success: + iter195.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + 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 checkAndMutate_args: + """ + Attributes: + - table: to check in and delete from + - row: row to check + - family: column family to check + - qualifier: column qualifier to check + - compareOp: comparison to make on the value + - value: the expected value to be compared against, if not provided the + check is for the non-existence of the column in question + - rowMutations: row mutations to execute if the value matches + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'family', None, None, ), # 3 + (4, TType.STRING, 'qualifier', None, None, ), # 4 + (5, TType.I32, 'compareOp', None, None, ), # 5 + (6, TType.STRING, 'value', None, None, ), # 6 + (7, TType.STRUCT, 'rowMutations', (TRowMutations, TRowMutations.thrift_spec), None, ), # 7 + ) + + def __init__(self, table=None, row=None, family=None, qualifier=None, compareOp=None, value=None, rowMutations=None,): + self.table = table + self.row = row + self.family = family + self.qualifier = qualifier + self.compareOp = compareOp + self.value = value + self.rowMutations = rowMutations + + 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.table = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.row = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.family = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.qualifier = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.compareOp = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.value = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.rowMutations = TRowMutations() + self.rowMutations.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('checkAndMutate_args') + if self.table is not None: + oprot.writeFieldBegin('table', TType.STRING, 1) + oprot.writeString(self.table) + oprot.writeFieldEnd() + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 2) + oprot.writeString(self.row) + oprot.writeFieldEnd() + if self.family is not None: + oprot.writeFieldBegin('family', TType.STRING, 3) + oprot.writeString(self.family) + oprot.writeFieldEnd() + if self.qualifier is not None: + oprot.writeFieldBegin('qualifier', TType.STRING, 4) + oprot.writeString(self.qualifier) + oprot.writeFieldEnd() + if self.compareOp is not None: + oprot.writeFieldBegin('compareOp', TType.I32, 5) + oprot.writeI32(self.compareOp) + oprot.writeFieldEnd() + if self.value is not None: + oprot.writeFieldBegin('value', TType.STRING, 6) + oprot.writeString(self.value) + oprot.writeFieldEnd() + if self.rowMutations is not None: + oprot.writeFieldBegin('rowMutations', TType.STRUCT, 7) + self.rowMutations.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.table is None: + raise TProtocol.TProtocolException(message='Required field table is unset!') + if self.row is None: + raise TProtocol.TProtocolException(message='Required field row is unset!') + if self.family is None: + raise TProtocol.TProtocolException(message='Required field family is unset!') + if self.qualifier is None: + raise TProtocol.TProtocolException(message='Required field qualifier is unset!') + if self.compareOp is None: + raise TProtocol.TProtocolException(message='Required field compareOp is unset!') + if self.rowMutations is None: + raise TProtocol.TProtocolException(message='Required field rowMutations is unset!') + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.family) + value = (value * 31) ^ hash(self.qualifier) + value = (value * 31) ^ hash(self.compareOp) + value = (value * 31) ^ hash(self.value) + value = (value * 31) ^ hash(self.rowMutations) + 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 checkAndMutate_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.BOOL, 'success', None, None, ), # 0 + (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1 + ) + + def __init__(self, success=None, io=None,): + self.success = success + self.io = io + + 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.BOOL: + self.success = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 1: + if ftype == TType.STRUCT: + self.io = TIOError() + self.io.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('checkAndMutate_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.BOOL, 0) + oprot.writeBool(self.success) + oprot.writeFieldEnd() + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + value = (value * 31) ^ hash(self.io) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] 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 a236326cf38..4a6492b8692 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 # 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 f80a10df511..a5695d6e89e 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,156 @@ 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()] + 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 TAppend: + """ + Attributes: + - row + - columns + - attributes + - durability + - cellVisibility + """ + + thrift_spec = ( + None, # 0 + (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, row=None, columns=None, attributes=None, durability=None, cellVisibility=None,): + self.row = row + self.columns = columns + 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: + 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.columns = [] + (_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 == 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 == 4: + if ftype == TType.I32: + self.durability = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.cellVisibility = TCellVisibility() + self.cellVisibility.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('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()] @@ -989,7 +1568,7 @@ class TIncrement: class TScan: """ - Any timestamps in the columns are ignored, use timeRange to select by timestamp. + Any timestamps in the columns are ignored but the colFamTimeRangeMap included, use timeRange to select by timestamp. Max versions defaults to 1. Attributes: @@ -1001,6 +1580,13 @@ class TScan: - timeRange - filterString - batchSize + - attributes + - authorizations + - reversed + - cacheBlocks + - colFamTimeRangeMap + - readType + - limit """ thrift_spec = ( @@ -1013,9 +1599,16 @@ class TScan: (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,): + 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 @@ -1024,6 +1617,13 @@ class TScan: 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: @@ -1036,33 +1636,33 @@ class TScan: break if fid == 1: if ftype == TType.STRING: - self.startRow = iprot.readString(); + self.startRow = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.stopRow = iprot.readString(); + 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) + (_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(); + self.caching = iprot.readI32() else: 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: @@ -1073,12 +1673,61 @@ class TScan: iprot.skip(ftype) elif fid == 7: if ftype == TType.STRING: - self.filterString = iprot.readString(); + self.filterString = iprot.readString() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.I32: - self.batchSize = iprot.readI32(); + 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: @@ -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()]