From 0e510183acaec684f88bf7c076d792f69c77c4a8 Mon Sep 17 00:00:00 2001 From: Guangxu Cheng Date: Tue, 17 Apr 2018 16:35:59 +0800 Subject: [PATCH] HBASE-20395 Displaying thrift server type on the thrift page --- .../src/main/python/thrift1/DemoClient.py | 5 + .../main/python/thrift1/gen-py/hbase/Hbase-remote | 222 +- .../src/main/python/thrift1/gen-py/hbase/Hbase.py | 3304 ++++++++++++++------ .../main/python/thrift1/gen-py/hbase/constants.py | 2 +- .../src/main/python/thrift1/gen-py/hbase/ttypes.py | 479 ++- .../src/main/python/thrift2/DemoClient.py | 5 + .../thrift2/gen-py/hbase/THBaseService-remote | 7 + .../python/thrift2/gen-py/hbase/THBaseService.py | 169 + .../src/main/python/thrift2/gen-py/hbase/ttypes.py | 23 + .../apache/hadoop/hbase/thrift/ThriftServer.java | 2 + .../hadoop/hbase/thrift/ThriftServerRunner.java | 6 + .../hadoop/hbase/thrift/generated/Hbase.java | 760 ++++- .../hbase/thrift/generated/TThriftServerType.java | 48 + .../hbase/thrift2/ThriftHBaseServiceHandler.java | 6 + .../apache/hadoop/hbase/thrift2/ThriftServer.java | 27 +- .../hbase/thrift2/generated/THBaseService.java | 1469 +++++++-- .../hbase/thrift2/generated/TThriftServerType.java | 48 + .../main/resources/hbase-webapps/thrift/thrift.jsp | 6 + .../org/apache/hadoop/hbase/thrift/Hbase.thrift | 15 + .../org/apache/hadoop/hbase/thrift2/hbase.thrift | 15 + .../hbase/thrift/HBaseThriftTestingUtility.java | 79 + .../hadoop/hbase/thrift/TestThriftServer.java | 37 + .../hbase/thrift2/HBaseThrift2TestingUtility.java | 70 + .../thrift2/TestThriftHBaseServiceHandler.java | 33 + .../asciidoc/_chapters/thrift_filter_language.adoc | 4 + 25 files changed, 5423 insertions(+), 1418 deletions(-) create mode 100644 hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TThriftServerType.java create mode 100644 hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TThriftServerType.java create mode 100644 hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java create mode 100644 hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/HBaseThrift2TestingUtility.java diff --git a/hbase-examples/src/main/python/thrift1/DemoClient.py b/hbase-examples/src/main/python/thrift1/DemoClient.py index 0d41226c42..7281533c8b 100644 --- a/hbase-examples/src/main/python/thrift1/DemoClient.py +++ b/hbase-examples/src/main/python/thrift1/DemoClient.py @@ -66,6 +66,11 @@ def demo_client(host, port, is_framed_transport): # Connect! transport.open() + # Check Thrift Server Type + serverType = client.getThriftServerType() + if serverType != 1: + raise Exception("Mismatch between client and server, server type is %s" %serverType) + t = "demo_table" # diff --git a/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote b/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote index 884a87d6b1..d6817cfa6b 100644 --- a/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-remote +++ b/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase-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,61 +12,64 @@ 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 Hbase -from ttypes import * +from hbase import Hbase +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 ' void enableTable(Bytes tableName)' - print ' void disableTable(Bytes tableName)' - print ' bool isTableEnabled(Bytes tableName)' - print ' void compact(Bytes tableNameOrRegionName)' - print ' void majorCompact(Bytes tableNameOrRegionName)' - print ' getTableNames()' - print ' getColumnDescriptors(Text tableName)' - print ' getTableRegions(Text tableName)' - print ' void createTable(Text tableName, columnFamilies)' - print ' void deleteTable(Text tableName)' - print ' get(Text tableName, Text row, Text column, attributes)' - print ' getVer(Text tableName, Text row, Text column, i32 numVersions, attributes)' - print ' getVerTs(Text tableName, Text row, Text column, i64 timestamp, i32 numVersions, attributes)' - print ' getRow(Text tableName, Text row, attributes)' - print ' getRowWithColumns(Text tableName, Text row, columns, attributes)' - print ' getRowTs(Text tableName, Text row, i64 timestamp, attributes)' - print ' getRowWithColumnsTs(Text tableName, Text row, columns, i64 timestamp, attributes)' - print ' getRows(Text tableName, rows, attributes)' - print ' getRowsWithColumns(Text tableName, rows, columns, attributes)' - print ' getRowsTs(Text tableName, rows, i64 timestamp, attributes)' - print ' getRowsWithColumnsTs(Text tableName, rows, columns, i64 timestamp, attributes)' - print ' void mutateRow(Text tableName, Text row, mutations, attributes)' - print ' void mutateRowTs(Text tableName, Text row, mutations, i64 timestamp, attributes)' - print ' void mutateRows(Text tableName, rowBatches, attributes)' - print ' void mutateRowsTs(Text tableName, rowBatches, i64 timestamp, attributes)' - print ' i64 atomicIncrement(Text tableName, Text row, Text column, i64 value)' - print ' void deleteAll(Text tableName, Text row, Text column, attributes)' - print ' void deleteAllTs(Text tableName, Text row, Text column, i64 timestamp, attributes)' - print ' void deleteAllRow(Text tableName, Text row, attributes)' - print ' void increment(TIncrement increment)' - print ' void incrementRows( increments)' - print ' void deleteAllRowTs(Text tableName, Text row, i64 timestamp, attributes)' - print ' ScannerID scannerOpenWithScan(Text tableName, TScan scan, attributes)' - print ' ScannerID scannerOpen(Text tableName, Text startRow, columns, attributes)' - print ' ScannerID scannerOpenWithStop(Text tableName, Text startRow, Text stopRow, columns, attributes)' - print ' ScannerID scannerOpenWithPrefix(Text tableName, Text startAndPrefix, columns, attributes)' - print ' ScannerID scannerOpenTs(Text tableName, Text startRow, columns, i64 timestamp, attributes)' - print ' ScannerID scannerOpenWithStopTs(Text tableName, Text startRow, Text stopRow, columns, i64 timestamp, attributes)' - print ' scannerGet(ScannerID id)' - print ' scannerGetList(ScannerID id, i32 nbRows)' - print ' void scannerClose(ScannerID id)' - print ' getRowOrBefore(Text tableName, Text row, Text family)' - print ' TRegionInfo getRegionInfo(Text row)' - print '' + print('') + print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] function [arg1 [arg2...]]') + print('') + print('Functions:') + print(' void enableTable(Bytes tableName)') + print(' void disableTable(Bytes tableName)') + print(' bool isTableEnabled(Bytes tableName)') + print(' void compact(Bytes tableNameOrRegionName)') + print(' void majorCompact(Bytes tableNameOrRegionName)') + print(' getTableNames()') + print(' getColumnDescriptors(Text tableName)') + print(' getTableRegions(Text tableName)') + print(' void createTable(Text tableName, columnFamilies)') + print(' void deleteTable(Text tableName)') + print(' get(Text tableName, Text row, Text column, attributes)') + print(' getVer(Text tableName, Text row, Text column, i32 numVersions, attributes)') + print(' getVerTs(Text tableName, Text row, Text column, i64 timestamp, i32 numVersions, attributes)') + print(' getRow(Text tableName, Text row, attributes)') + print(' getRowWithColumns(Text tableName, Text row, columns, attributes)') + print(' getRowTs(Text tableName, Text row, i64 timestamp, attributes)') + print(' getRowWithColumnsTs(Text tableName, Text row, columns, i64 timestamp, attributes)') + print(' getRows(Text tableName, rows, attributes)') + print(' getRowsWithColumns(Text tableName, rows, columns, attributes)') + print(' getRowsTs(Text tableName, rows, i64 timestamp, attributes)') + print(' getRowsWithColumnsTs(Text tableName, rows, columns, i64 timestamp, attributes)') + print(' void mutateRow(Text tableName, Text row, mutations, attributes)') + print(' void mutateRowTs(Text tableName, Text row, mutations, i64 timestamp, attributes)') + print(' void mutateRows(Text tableName, rowBatches, attributes)') + print(' void mutateRowsTs(Text tableName, rowBatches, i64 timestamp, attributes)') + print(' i64 atomicIncrement(Text tableName, Text row, Text column, i64 value)') + print(' void deleteAll(Text tableName, Text row, Text column, attributes)') + print(' void deleteAllTs(Text tableName, Text row, Text column, i64 timestamp, attributes)') + print(' void deleteAllRow(Text tableName, Text row, attributes)') + print(' void increment(TIncrement increment)') + print(' void incrementRows( increments)') + print(' void deleteAllRowTs(Text tableName, Text row, i64 timestamp, attributes)') + print(' ScannerID scannerOpenWithScan(Text tableName, TScan scan, attributes)') + print(' ScannerID scannerOpen(Text tableName, Text startRow, columns, attributes)') + print(' ScannerID scannerOpenWithStop(Text tableName, Text startRow, Text stopRow, columns, attributes)') + print(' ScannerID scannerOpenWithPrefix(Text tableName, Text startAndPrefix, columns, attributes)') + print(' ScannerID scannerOpenTs(Text tableName, Text startRow, columns, i64 timestamp, attributes)') + print(' ScannerID scannerOpenWithStopTs(Text tableName, Text startRow, Text stopRow, columns, i64 timestamp, attributes)') + print(' scannerGet(ScannerID id)') + print(' scannerGetList(ScannerID id, i32 nbRows)') + print(' void scannerClose(ScannerID id)') + print(' TRegionInfo getRegionInfo(Text row)') + print(' append(TAppend append)') + print(' bool checkAndPut(Text tableName, Text row, Text column, Text value, Mutation mput, attributes)') + print(' TThriftServerType getThriftServerType()') + print('') sys.exit(0) pp = pprint.PrettyPrinter(indent = 2) @@ -74,6 +77,7 @@ host = 'localhost' port = 9090 uri = '' framed = False +ssl = False http = False argi = 1 @@ -102,13 +106,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: @@ -119,264 +127,276 @@ transport.open() if cmd == 'enableTable': if len(args) != 1: - print 'enableTable requires 1 args' + print('enableTable requires 1 args') sys.exit(1) pp.pprint(client.enableTable(eval(args[0]),)) elif cmd == 'disableTable': if len(args) != 1: - print 'disableTable requires 1 args' + print('disableTable requires 1 args') sys.exit(1) pp.pprint(client.disableTable(eval(args[0]),)) elif cmd == 'isTableEnabled': if len(args) != 1: - print 'isTableEnabled requires 1 args' + print('isTableEnabled requires 1 args') sys.exit(1) pp.pprint(client.isTableEnabled(eval(args[0]),)) elif cmd == 'compact': if len(args) != 1: - print 'compact requires 1 args' + print('compact requires 1 args') sys.exit(1) pp.pprint(client.compact(eval(args[0]),)) elif cmd == 'majorCompact': if len(args) != 1: - print 'majorCompact requires 1 args' + print('majorCompact requires 1 args') sys.exit(1) pp.pprint(client.majorCompact(eval(args[0]),)) elif cmd == 'getTableNames': if len(args) != 0: - print 'getTableNames requires 0 args' + print('getTableNames requires 0 args') sys.exit(1) pp.pprint(client.getTableNames()) elif cmd == 'getColumnDescriptors': if len(args) != 1: - print 'getColumnDescriptors requires 1 args' + print('getColumnDescriptors requires 1 args') sys.exit(1) pp.pprint(client.getColumnDescriptors(eval(args[0]),)) elif cmd == 'getTableRegions': if len(args) != 1: - print 'getTableRegions requires 1 args' + print('getTableRegions requires 1 args') sys.exit(1) pp.pprint(client.getTableRegions(eval(args[0]),)) elif cmd == 'createTable': if len(args) != 2: - print 'createTable requires 2 args' + print('createTable requires 2 args') sys.exit(1) pp.pprint(client.createTable(eval(args[0]),eval(args[1]),)) elif cmd == 'deleteTable': if len(args) != 1: - print 'deleteTable requires 1 args' + print('deleteTable requires 1 args') sys.exit(1) pp.pprint(client.deleteTable(eval(args[0]),)) elif cmd == 'get': if len(args) != 4: - print 'get requires 4 args' + print('get requires 4 args') sys.exit(1) pp.pprint(client.get(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'getVer': if len(args) != 5: - print 'getVer requires 5 args' + print('getVer requires 5 args') sys.exit(1) pp.pprint(client.getVer(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'getVerTs': if len(args) != 6: - print 'getVerTs requires 6 args' + print('getVerTs requires 6 args') sys.exit(1) pp.pprint(client.getVerTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),)) elif cmd == 'getRow': if len(args) != 3: - print 'getRow requires 3 args' + print('getRow requires 3 args') sys.exit(1) pp.pprint(client.getRow(eval(args[0]),eval(args[1]),eval(args[2]),)) elif cmd == 'getRowWithColumns': if len(args) != 4: - print 'getRowWithColumns requires 4 args' + print('getRowWithColumns requires 4 args') sys.exit(1) pp.pprint(client.getRowWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'getRowTs': if len(args) != 4: - print 'getRowTs requires 4 args' + print('getRowTs requires 4 args') sys.exit(1) pp.pprint(client.getRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'getRowWithColumnsTs': if len(args) != 5: - print 'getRowWithColumnsTs requires 5 args' + print('getRowWithColumnsTs requires 5 args') sys.exit(1) pp.pprint(client.getRowWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'getRows': if len(args) != 3: - print 'getRows requires 3 args' + print('getRows requires 3 args') sys.exit(1) pp.pprint(client.getRows(eval(args[0]),eval(args[1]),eval(args[2]),)) elif cmd == 'getRowsWithColumns': if len(args) != 4: - print 'getRowsWithColumns requires 4 args' + print('getRowsWithColumns requires 4 args') sys.exit(1) pp.pprint(client.getRowsWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'getRowsTs': if len(args) != 4: - print 'getRowsTs requires 4 args' + print('getRowsTs requires 4 args') sys.exit(1) pp.pprint(client.getRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'getRowsWithColumnsTs': if len(args) != 5: - print 'getRowsWithColumnsTs requires 5 args' + print('getRowsWithColumnsTs requires 5 args') sys.exit(1) pp.pprint(client.getRowsWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'mutateRow': if len(args) != 4: - print 'mutateRow requires 4 args' + print('mutateRow requires 4 args') sys.exit(1) pp.pprint(client.mutateRow(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'mutateRowTs': if len(args) != 5: - print 'mutateRowTs requires 5 args' + print('mutateRowTs requires 5 args') sys.exit(1) pp.pprint(client.mutateRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'mutateRows': if len(args) != 3: - print 'mutateRows requires 3 args' + print('mutateRows requires 3 args') sys.exit(1) pp.pprint(client.mutateRows(eval(args[0]),eval(args[1]),eval(args[2]),)) elif cmd == 'mutateRowsTs': if len(args) != 4: - print 'mutateRowsTs requires 4 args' + print('mutateRowsTs requires 4 args') sys.exit(1) pp.pprint(client.mutateRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'atomicIncrement': if len(args) != 4: - print 'atomicIncrement requires 4 args' + print('atomicIncrement requires 4 args') sys.exit(1) pp.pprint(client.atomicIncrement(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'deleteAll': if len(args) != 4: - print 'deleteAll requires 4 args' + print('deleteAll requires 4 args') sys.exit(1) pp.pprint(client.deleteAll(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'deleteAllTs': if len(args) != 5: - print 'deleteAllTs requires 5 args' + print('deleteAllTs requires 5 args') sys.exit(1) pp.pprint(client.deleteAllTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'deleteAllRow': if len(args) != 3: - print 'deleteAllRow requires 3 args' + print('deleteAllRow requires 3 args') sys.exit(1) pp.pprint(client.deleteAllRow(eval(args[0]),eval(args[1]),eval(args[2]),)) elif cmd == 'increment': if len(args) != 1: - print 'increment requires 1 args' + print('increment requires 1 args') sys.exit(1) pp.pprint(client.increment(eval(args[0]),)) elif cmd == 'incrementRows': if len(args) != 1: - print 'incrementRows requires 1 args' + print('incrementRows requires 1 args') sys.exit(1) pp.pprint(client.incrementRows(eval(args[0]),)) elif cmd == 'deleteAllRowTs': if len(args) != 4: - print 'deleteAllRowTs requires 4 args' + print('deleteAllRowTs requires 4 args') sys.exit(1) pp.pprint(client.deleteAllRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'scannerOpenWithScan': if len(args) != 3: - print 'scannerOpenWithScan requires 3 args' + print('scannerOpenWithScan requires 3 args') sys.exit(1) pp.pprint(client.scannerOpenWithScan(eval(args[0]),eval(args[1]),eval(args[2]),)) elif cmd == 'scannerOpen': if len(args) != 4: - print 'scannerOpen requires 4 args' + print('scannerOpen requires 4 args') sys.exit(1) pp.pprint(client.scannerOpen(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'scannerOpenWithStop': if len(args) != 5: - print 'scannerOpenWithStop requires 5 args' + print('scannerOpenWithStop requires 5 args') sys.exit(1) pp.pprint(client.scannerOpenWithStop(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'scannerOpenWithPrefix': if len(args) != 4: - print 'scannerOpenWithPrefix requires 4 args' + print('scannerOpenWithPrefix requires 4 args') sys.exit(1) pp.pprint(client.scannerOpenWithPrefix(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),)) elif cmd == 'scannerOpenTs': if len(args) != 5: - print 'scannerOpenTs requires 5 args' + print('scannerOpenTs requires 5 args') sys.exit(1) pp.pprint(client.scannerOpenTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),)) elif cmd == 'scannerOpenWithStopTs': if len(args) != 6: - print 'scannerOpenWithStopTs requires 6 args' + print('scannerOpenWithStopTs requires 6 args') sys.exit(1) pp.pprint(client.scannerOpenWithStopTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),)) elif cmd == 'scannerGet': if len(args) != 1: - print 'scannerGet requires 1 args' + print('scannerGet requires 1 args') sys.exit(1) pp.pprint(client.scannerGet(eval(args[0]),)) elif cmd == 'scannerGetList': if len(args) != 2: - print 'scannerGetList requires 2 args' + print('scannerGetList requires 2 args') sys.exit(1) pp.pprint(client.scannerGetList(eval(args[0]),eval(args[1]),)) elif cmd == 'scannerClose': if len(args) != 1: - print 'scannerClose requires 1 args' + print('scannerClose requires 1 args') sys.exit(1) pp.pprint(client.scannerClose(eval(args[0]),)) -elif cmd == 'getRowOrBefore': - if len(args) != 3: - print 'getRowOrBefore requires 3 args' - sys.exit(1) - pp.pprint(client.getRowOrBefore(eval(args[0]),eval(args[1]),eval(args[2]),)) - elif cmd == 'getRegionInfo': if len(args) != 1: - print 'getRegionInfo requires 1 args' + print('getRegionInfo requires 1 args') sys.exit(1) pp.pprint(client.getRegionInfo(eval(args[0]),)) +elif cmd == 'append': + if len(args) != 1: + print('append requires 1 args') + sys.exit(1) + pp.pprint(client.append(eval(args[0]),)) + +elif cmd == 'checkAndPut': + if len(args) != 6: + print('checkAndPut requires 6 args') + sys.exit(1) + pp.pprint(client.checkAndPut(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),eval(args[5]),)) + +elif cmd == 'getThriftServerType': + if len(args) != 0: + print('getThriftServerType requires 0 args') + sys.exit(1) + pp.pprint(client.getThriftServerType()) + else: - print 'Unrecognized method %s' % cmd + print('Unrecognized method %s' % cmd) sys.exit(1) transport.close() diff --git a/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase.py b/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase.py index 2f22523080..a47b38fed7 100644 --- a/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase.py +++ b/hbase-examples/src/main/python/thrift1/gen-py/hbase/Hbase.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 @@ -60,7 +61,7 @@ class Iface: """ pass - def getTableNames(self, ): + def getTableNames(self): """ List all the userspace tables. @@ -586,28 +587,53 @@ class Iface: """ pass - def getRowOrBefore(self, tableName, row, family): + def getRegionInfo(self, row): """ - Get the row just before the specified one. + Get the regininfo for the specified row. It scans + the metatable to find region's start and end keys. @return value for specified row/column Parameters: - - tableName: name of table - row: row key - - family: column name """ pass - def getRegionInfo(self, row): + def append(self, append): """ - Get the regininfo for the specified row. It scans - the metatable to find region's start and end keys. + Appends values to one or more columns within a single row. - @return value for specified row/column + @return values of columns after the append operation. Parameters: + - append: The single append operation to apply + """ + pass + + def checkAndPut(self, tableName, row, column, value, mput, attributes): + """ + Atomically checks if a row/family/qualifier value matches the expected + value. If it does, it adds the corresponding mutation operation for put. + + @return true if the new put was executed, false otherwise + + Parameters: + - tableName: name of table - row: row key + - column: column name + - value: the expected value for the column parameter, if not + provided the check is for the non-existence of the + column in question + - mput: mutation for the put + - attributes: Mutation attributes + """ + pass + + def getThriftServerType(self): + """ + Get the type of this thrift server. + + @return the type of this thrift server """ pass @@ -637,16 +663,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_enableTable(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_enableTable(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 = enableTable_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -670,16 +697,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_disableTable(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_disableTable(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 = disableTable_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -702,21 +730,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_isTableEnabled(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_isTableEnabled(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 = isTableEnabled_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, "isTableEnabled failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "isTableEnabled failed: unknown result") def compact(self, tableNameOrRegionName): """ @@ -734,16 +763,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_compact(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_compact(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 = compact_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -764,21 +794,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_majorCompact(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_majorCompact(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 = majorCompact_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return - def getTableNames(self, ): + def getTableNames(self): """ List all the userspace tables. @@ -787,28 +818,29 @@ class Client(Iface): self.send_getTableNames() return self.recv_getTableNames() - def send_getTableNames(self, ): + def send_getTableNames(self): self._oprot.writeMessageBegin('getTableNames', TMessageType.CALL, self._seqid) args = getTableNames_args() args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getTableNames(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getTableNames(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 = getTableNames_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, "getTableNames failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTableNames failed: unknown result") def getColumnDescriptors(self, tableName): """ @@ -830,21 +862,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getColumnDescriptors(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getColumnDescriptors(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 = getColumnDescriptors_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, "getColumnDescriptors failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getColumnDescriptors failed: unknown result") def getTableRegions(self, tableName): """ @@ -866,21 +899,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getTableRegions(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getTableRegions(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 = getTableRegions_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, "getTableRegions failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getTableRegions failed: unknown result") def createTable(self, tableName, columnFamilies): """ @@ -909,16 +943,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_createTable(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_createTable(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 = createTable_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: @@ -948,16 +983,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteTable(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_deleteTable(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 = deleteTable_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -989,21 +1025,22 @@ class Client(Iface): 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 getVer(self, tableName, row, column, numVersions, attributes): """ @@ -1034,21 +1071,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getVer(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getVer(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 = getVer_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, "getVer failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getVer failed: unknown result") def getVerTs(self, tableName, row, column, timestamp, numVersions, attributes): """ @@ -1082,21 +1120,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getVerTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getVerTs(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 = getVerTs_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, "getVerTs failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getVerTs failed: unknown result") def getRow(self, tableName, row, attributes): """ @@ -1123,21 +1162,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRow(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRow(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 = getRow_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, "getRow failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRow failed: unknown result") def getRowWithColumns(self, tableName, row, columns, attributes): """ @@ -1166,21 +1206,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRowWithColumns(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRowWithColumns(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 = getRowWithColumns_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, "getRowWithColumns failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowWithColumns failed: unknown result") def getRowTs(self, tableName, row, timestamp, attributes): """ @@ -1209,21 +1250,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRowTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRowTs(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 = getRowTs_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, "getRowTs failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowTs failed: unknown result") def getRowWithColumnsTs(self, tableName, row, columns, timestamp, attributes): """ @@ -1254,21 +1296,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRowWithColumnsTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRowWithColumnsTs(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 = getRowWithColumnsTs_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, "getRowWithColumnsTs failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowWithColumnsTs failed: unknown result") def getRows(self, tableName, rows, attributes): """ @@ -1295,21 +1338,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRows(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRows(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 = getRows_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, "getRows failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRows failed: unknown result") def getRowsWithColumns(self, tableName, rows, columns, attributes): """ @@ -1338,21 +1382,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRowsWithColumns(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRowsWithColumns(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 = getRowsWithColumns_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, "getRowsWithColumns failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowsWithColumns failed: unknown result") def getRowsTs(self, tableName, rows, timestamp, attributes): """ @@ -1381,21 +1426,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRowsTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRowsTs(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 = getRowsTs_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, "getRowsTs failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowsTs failed: unknown result") def getRowsWithColumnsTs(self, tableName, rows, columns, timestamp, attributes): """ @@ -1426,21 +1472,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRowsWithColumnsTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRowsWithColumnsTs(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 = getRowsWithColumnsTs_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, "getRowsWithColumnsTs failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRowsWithColumnsTs failed: unknown result") def mutateRow(self, tableName, row, mutations, attributes): """ @@ -1469,16 +1516,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_mutateRow(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_mutateRow(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 = mutateRow_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: @@ -1514,16 +1562,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_mutateRowTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_mutateRowTs(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 = mutateRowTs_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: @@ -1555,16 +1604,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_mutateRows(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_mutateRows(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 = mutateRows_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: @@ -1598,16 +1648,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_mutateRowsTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_mutateRowsTs(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 = mutateRowsTs_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: @@ -1638,23 +1689,24 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_atomicIncrement(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_atomicIncrement(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 = atomicIncrement_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, "atomicIncrement failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "atomicIncrement failed: unknown result") def deleteAll(self, tableName, row, column, attributes): """ @@ -1680,16 +1732,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteAll(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_deleteAll(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 = deleteAll_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -1721,16 +1774,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteAllTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_deleteAllTs(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 = deleteAllTs_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -1757,16 +1811,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteAllRow(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_deleteAllRow(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 = deleteAllRow_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -1792,16 +1847,17 @@ class Client(Iface): 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.io is not None: raise result.io return @@ -1822,16 +1878,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_incrementRows(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_incrementRows(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 = incrementRows_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -1861,16 +1918,17 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_deleteAllRowTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_deleteAllRowTs(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 = deleteAllRowTs_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result.read(iprot) + iprot.readMessageEnd() if result.io is not None: raise result.io return @@ -1898,21 +1956,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerOpenWithScan(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerOpenWithScan(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 = scannerOpenWithScan_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, "scannerOpenWithScan failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithScan failed: unknown result") def scannerOpen(self, tableName, startRow, columns, attributes): """ @@ -1944,21 +2003,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerOpen(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerOpen(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 = scannerOpen_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, "scannerOpen failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpen failed: unknown result") def scannerOpenWithStop(self, tableName, startRow, stopRow, columns, attributes): """ @@ -1994,21 +2054,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerOpenWithStop(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerOpenWithStop(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 = scannerOpenWithStop_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, "scannerOpenWithStop failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithStop failed: unknown result") def scannerOpenWithPrefix(self, tableName, startAndPrefix, columns, attributes): """ @@ -2037,21 +2098,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerOpenWithPrefix(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerOpenWithPrefix(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 = scannerOpenWithPrefix_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, "scannerOpenWithPrefix failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithPrefix failed: unknown result") def scannerOpenTs(self, tableName, startRow, columns, timestamp, attributes): """ @@ -2086,21 +2148,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerOpenTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerOpenTs(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 = scannerOpenTs_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, "scannerOpenTs failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenTs failed: unknown result") def scannerOpenWithStopTs(self, tableName, startRow, stopRow, columns, timestamp, attributes): """ @@ -2139,21 +2202,22 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerOpenWithStopTs(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerOpenWithStopTs(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 = scannerOpenWithStopTs_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, "scannerOpenWithStopTs failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerOpenWithStopTs failed: unknown result") def scannerGet(self, id): """ @@ -2182,23 +2246,24 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerGet(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerGet(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 = scannerGet_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, "scannerGet failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerGet failed: unknown result") def scannerGetList(self, id, nbRows): """ @@ -2229,23 +2294,24 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerGetList(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerGetList(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 = scannerGetList_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, "scannerGetList failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "scannerGetList failed: unknown result") def scannerClose(self, id): """ @@ -2267,98 +2333,180 @@ class Client(Iface): self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_scannerClose(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_scannerClose(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 = scannerClose_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 getRowOrBefore(self, tableName, row, family): + def getRegionInfo(self, row): """ - Get the row just before the specified one. + Get the regininfo for the specified row. It scans + the metatable to find region's start and end keys. @return value for specified row/column Parameters: - - tableName: name of table - row: row key - - family: column name """ - self.send_getRowOrBefore(tableName, row, family) - return self.recv_getRowOrBefore() + self.send_getRegionInfo(row) + return self.recv_getRegionInfo() - def send_getRowOrBefore(self, tableName, row, family): - self._oprot.writeMessageBegin('getRowOrBefore', TMessageType.CALL, self._seqid) - args = getRowOrBefore_args() - args.tableName = tableName + def send_getRegionInfo(self, row): + self._oprot.writeMessageBegin('getRegionInfo', TMessageType.CALL, self._seqid) + args = getRegionInfo_args() args.row = row - args.family = family args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRowOrBefore(self, ): - (fname, mtype, rseqid) = self._iprot.readMessageBegin() + def recv_getRegionInfo(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 = getRowOrBefore_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result = getRegionInfo_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, "getRowOrBefore failed: unknown result"); + raise TApplicationException(TApplicationException.MISSING_RESULT, "getRegionInfo failed: unknown result") - def getRegionInfo(self, row): + def append(self, append): """ - Get the regininfo for the specified row. It scans - the metatable to find region's start and end keys. + Appends values to one or more columns within a single row. - @return value for specified row/column + @return values of columns after the append operation. + + Parameters: + - append: The single append operation to apply + """ + self.send_append(append) + return self.recv_append() + + def send_append(self, append): + self._oprot.writeMessageBegin('append', TMessageType.CALL, self._seqid) + args = append_args() + args.append = append + 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 checkAndPut(self, tableName, row, column, value, mput, attributes): + """ + Atomically checks if a row/family/qualifier value matches the expected + value. If it does, it adds the corresponding mutation operation for put. + + @return true if the new put was executed, false otherwise Parameters: + - tableName: name of table - row: row key + - column: column name + - value: the expected value for the column parameter, if not + provided the check is for the non-existence of the + column in question + - mput: mutation for the put + - attributes: Mutation attributes """ - self.send_getRegionInfo(row) - return self.recv_getRegionInfo() + self.send_checkAndPut(tableName, row, column, value, mput, attributes) + return self.recv_checkAndPut() - def send_getRegionInfo(self, row): - self._oprot.writeMessageBegin('getRegionInfo', TMessageType.CALL, self._seqid) - args = getRegionInfo_args() + def send_checkAndPut(self, tableName, row, column, value, mput, attributes): + self._oprot.writeMessageBegin('checkAndPut', TMessageType.CALL, self._seqid) + args = checkAndPut_args() + args.tableName = tableName args.row = row + args.column = column + args.value = value + args.mput = mput + args.attributes = attributes args.write(self._oprot) self._oprot.writeMessageEnd() self._oprot.trans.flush() - def recv_getRegionInfo(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 = getRegionInfo_result() - result.read(self._iprot) - self._iprot.readMessageEnd() + result = checkAndPut_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, "getRegionInfo failed: unknown result"); + if result.ia is not None: + raise result.ia + raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result") + + def getThriftServerType(self): + """ + Get the type of this thrift server. + + @return the type of this thrift server + """ + self.send_getThriftServerType() + return self.recv_getThriftServerType() + + def send_getThriftServerType(self): + self._oprot.writeMessageBegin('getThriftServerType', TMessageType.CALL, self._seqid) + args = getThriftServerType_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getThriftServerType(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getThriftServerType_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getThriftServerType failed: unknown result") class Processor(Iface, TProcessor): @@ -2406,8 +2554,10 @@ class Processor(Iface, TProcessor): self._processMap["scannerGet"] = Processor.process_scannerGet self._processMap["scannerGetList"] = Processor.process_scannerGetList self._processMap["scannerClose"] = Processor.process_scannerClose - self._processMap["getRowOrBefore"] = Processor.process_getRowOrBefore self._processMap["getRegionInfo"] = Processor.process_getRegionInfo + self._processMap["append"] = Processor.process_append + self._processMap["checkAndPut"] = Processor.process_checkAndPut + self._processMap["getThriftServerType"] = Processor.process_getThriftServerType def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() @@ -2431,9 +2581,17 @@ class Processor(Iface, TProcessor): result = enableTable_result() try: self._handler.enableTable(args.tableName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("enableTable", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("enableTable", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2445,9 +2603,17 @@ class Processor(Iface, TProcessor): result = disableTable_result() try: self._handler.disableTable(args.tableName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("disableTable", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("disableTable", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2459,9 +2625,17 @@ class Processor(Iface, TProcessor): result = isTableEnabled_result() try: result.success = self._handler.isTableEnabled(args.tableName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("isTableEnabled", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("isTableEnabled", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2473,9 +2647,17 @@ class Processor(Iface, TProcessor): result = compact_result() try: self._handler.compact(args.tableNameOrRegionName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("compact", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("compact", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2487,9 +2669,17 @@ class Processor(Iface, TProcessor): result = majorCompact_result() try: self._handler.majorCompact(args.tableNameOrRegionName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("majorCompact", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("majorCompact", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2501,9 +2691,17 @@ class Processor(Iface, TProcessor): result = getTableNames_result() try: result.success = self._handler.getTableNames() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getTableNames", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getTableNames", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2515,9 +2713,17 @@ class Processor(Iface, TProcessor): result = getColumnDescriptors_result() try: result.success = self._handler.getColumnDescriptors(args.tableName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getColumnDescriptors", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getColumnDescriptors", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2529,9 +2735,17 @@ class Processor(Iface, TProcessor): result = getTableRegions_result() try: result.success = self._handler.getTableRegions(args.tableName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getTableRegions", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getTableRegions", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2543,13 +2757,23 @@ class Processor(Iface, TProcessor): result = createTable_result() try: self._handler.createTable(args.tableName, args.columnFamilies) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia except AlreadyExists as exist: + msg_type = TMessageType.REPLY result.exist = exist - oprot.writeMessageBegin("createTable", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("createTable", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2561,9 +2785,17 @@ class Processor(Iface, TProcessor): result = deleteTable_result() try: self._handler.deleteTable(args.tableName) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("deleteTable", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("deleteTable", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2575,9 +2807,17 @@ class Processor(Iface, TProcessor): result = get_result() try: result.success = self._handler.get(args.tableName, args.row, args.column, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError 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() @@ -2589,9 +2829,17 @@ class Processor(Iface, TProcessor): result = getVer_result() try: result.success = self._handler.getVer(args.tableName, args.row, args.column, args.numVersions, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getVer", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getVer", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2603,9 +2851,17 @@ class Processor(Iface, TProcessor): result = getVerTs_result() try: result.success = self._handler.getVerTs(args.tableName, args.row, args.column, args.timestamp, args.numVersions, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getVerTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getVerTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2617,9 +2873,17 @@ class Processor(Iface, TProcessor): result = getRow_result() try: result.success = self._handler.getRow(args.tableName, args.row, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRow", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRow", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2631,9 +2895,17 @@ class Processor(Iface, TProcessor): result = getRowWithColumns_result() try: result.success = self._handler.getRowWithColumns(args.tableName, args.row, args.columns, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRowWithColumns", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRowWithColumns", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2645,9 +2917,17 @@ class Processor(Iface, TProcessor): result = getRowTs_result() try: result.success = self._handler.getRowTs(args.tableName, args.row, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRowTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRowTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2659,9 +2939,17 @@ class Processor(Iface, TProcessor): result = getRowWithColumnsTs_result() try: result.success = self._handler.getRowWithColumnsTs(args.tableName, args.row, args.columns, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRowWithColumnsTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRowWithColumnsTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2673,9 +2961,17 @@ class Processor(Iface, TProcessor): result = getRows_result() try: result.success = self._handler.getRows(args.tableName, args.rows, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRows", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRows", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2687,9 +2983,17 @@ class Processor(Iface, TProcessor): result = getRowsWithColumns_result() try: result.success = self._handler.getRowsWithColumns(args.tableName, args.rows, args.columns, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRowsWithColumns", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRowsWithColumns", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2701,9 +3005,17 @@ class Processor(Iface, TProcessor): result = getRowsTs_result() try: result.success = self._handler.getRowsTs(args.tableName, args.rows, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRowsTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRowsTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2715,9 +3027,17 @@ class Processor(Iface, TProcessor): result = getRowsWithColumnsTs_result() try: result.success = self._handler.getRowsWithColumnsTs(args.tableName, args.rows, args.columns, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRowsWithColumnsTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getRowsWithColumnsTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2729,11 +3049,20 @@ class Processor(Iface, TProcessor): result = mutateRow_result() try: self._handler.mutateRow(args.tableName, args.row, args.mutations, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("mutateRow", TMessageType.REPLY, seqid) + 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() @@ -2745,11 +3074,20 @@ class Processor(Iface, TProcessor): result = mutateRowTs_result() try: self._handler.mutateRowTs(args.tableName, args.row, args.mutations, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("mutateRowTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("mutateRowTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2761,11 +3099,20 @@ class Processor(Iface, TProcessor): result = mutateRows_result() try: self._handler.mutateRows(args.tableName, args.rowBatches, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("mutateRows", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("mutateRows", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2777,11 +3124,20 @@ class Processor(Iface, TProcessor): result = mutateRowsTs_result() try: self._handler.mutateRowsTs(args.tableName, args.rowBatches, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("mutateRowsTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("mutateRowsTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2793,11 +3149,20 @@ class Processor(Iface, TProcessor): result = atomicIncrement_result() try: result.success = self._handler.atomicIncrement(args.tableName, args.row, args.column, args.value) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("atomicIncrement", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("atomicIncrement", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2809,9 +3174,17 @@ class Processor(Iface, TProcessor): result = deleteAll_result() try: self._handler.deleteAll(args.tableName, args.row, args.column, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("deleteAll", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("deleteAll", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2823,9 +3196,17 @@ class Processor(Iface, TProcessor): result = deleteAllTs_result() try: self._handler.deleteAllTs(args.tableName, args.row, args.column, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("deleteAllTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("deleteAllTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2837,9 +3218,17 @@ class Processor(Iface, TProcessor): result = deleteAllRow_result() try: self._handler.deleteAllRow(args.tableName, args.row, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("deleteAllRow", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("deleteAllRow", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2851,9 +3240,17 @@ class Processor(Iface, TProcessor): result = increment_result() try: self._handler.increment(args.increment) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError 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() @@ -2865,9 +3262,17 @@ class Processor(Iface, TProcessor): result = incrementRows_result() try: self._handler.incrementRows(args.increments) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("incrementRows", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("incrementRows", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2879,9 +3284,17 @@ class Processor(Iface, TProcessor): result = deleteAllRowTs_result() try: self._handler.deleteAllRowTs(args.tableName, args.row, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("deleteAllRowTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("deleteAllRowTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2893,9 +3306,17 @@ class Processor(Iface, TProcessor): result = scannerOpenWithScan_result() try: result.success = self._handler.scannerOpenWithScan(args.tableName, args.scan, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("scannerOpenWithScan", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerOpenWithScan", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2907,9 +3328,17 @@ class Processor(Iface, TProcessor): result = scannerOpen_result() try: result.success = self._handler.scannerOpen(args.tableName, args.startRow, args.columns, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("scannerOpen", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerOpen", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2921,9 +3350,17 @@ class Processor(Iface, TProcessor): result = scannerOpenWithStop_result() try: result.success = self._handler.scannerOpenWithStop(args.tableName, args.startRow, args.stopRow, args.columns, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("scannerOpenWithStop", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerOpenWithStop", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2935,9 +3372,17 @@ class Processor(Iface, TProcessor): result = scannerOpenWithPrefix_result() try: result.success = self._handler.scannerOpenWithPrefix(args.tableName, args.startAndPrefix, args.columns, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("scannerOpenWithPrefix", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerOpenWithPrefix", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2949,9 +3394,17 @@ class Processor(Iface, TProcessor): result = scannerOpenTs_result() try: result.success = self._handler.scannerOpenTs(args.tableName, args.startRow, args.columns, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("scannerOpenTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerOpenTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2963,9 +3416,17 @@ class Processor(Iface, TProcessor): result = scannerOpenWithStopTs_result() try: result.success = self._handler.scannerOpenWithStopTs(args.tableName, args.startRow, args.stopRow, args.columns, args.timestamp, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("scannerOpenWithStopTs", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerOpenWithStopTs", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2977,11 +3438,20 @@ class Processor(Iface, TProcessor): result = scannerGet_result() try: result.success = self._handler.scannerGet(args.id) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("scannerGet", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerGet", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -2993,11 +3463,20 @@ class Processor(Iface, TProcessor): result = scannerGetList_result() try: result.success = self._handler.scannerGetList(args.id, args.nbRows) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("scannerGetList", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerGetList", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -3009,39 +3488,108 @@ class Processor(Iface, TProcessor): result = scannerClose_result() try: self._handler.scannerClose(args.id) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io except IllegalArgument as ia: + msg_type = TMessageType.REPLY result.ia = ia - oprot.writeMessageBegin("scannerClose", TMessageType.REPLY, seqid) + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("scannerClose", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_getRegionInfo(self, seqid, iprot, oprot): + args = getRegionInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = getRegionInfo_result() + try: + result.success = self._handler.getRegionInfo(args.row) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except IOError 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("getRegionInfo", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() - def process_getRowOrBefore(self, seqid, iprot, oprot): - args = getRowOrBefore_args() + def process_append(self, seqid, iprot, oprot): + args = append_args() args.read(iprot) iprot.readMessageEnd() - result = getRowOrBefore_result() + result = append_result() try: - result.success = self._handler.getRowOrBefore(args.tableName, args.row, args.family) + result.success = self._handler.append(args.append) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRowOrBefore", TMessageType.REPLY, seqid) + 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() - def process_getRegionInfo(self, seqid, iprot, oprot): - args = getRegionInfo_args() + def process_checkAndPut(self, seqid, iprot, oprot): + args = checkAndPut_args() args.read(iprot) iprot.readMessageEnd() - result = getRegionInfo_result() + result = checkAndPut_result() try: - result.success = self._handler.getRegionInfo(args.row) + result.success = self._handler.checkAndPut(args.tableName, args.row, args.column, args.value, args.mput, args.attributes) + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise except IOError as io: + msg_type = TMessageType.REPLY result.io = io - oprot.writeMessageBegin("getRegionInfo", TMessageType.REPLY, seqid) + except IllegalArgument as ia: + msg_type = TMessageType.REPLY + result.ia = ia + 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() + + def process_getThriftServerType(self, seqid, iprot, oprot): + args = getThriftServerType_args() + args.read(iprot) + iprot.readMessageEnd() + result = getThriftServerType_result() + try: + result.success = self._handler.getThriftServerType() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getThriftServerType", msg_type, seqid) result.write(oprot) oprot.writeMessageEnd() oprot.trans.flush() @@ -3074,7 +3622,7 @@ class enableTable_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) else: @@ -3098,6 +3646,11 @@ class enableTable_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -3159,6 +3712,11 @@ class enableTable_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()] @@ -3195,7 +3753,7 @@ class disableTable_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) else: @@ -3219,6 +3777,11 @@ class disableTable_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -3280,6 +3843,11 @@ class disableTable_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()] @@ -3316,7 +3884,7 @@ class isTableEnabled_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) else: @@ -3340,6 +3908,11 @@ class isTableEnabled_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -3378,7 +3951,7 @@ class isTableEnabled_result: break if fid == 0: if ftype == TType.BOOL: - self.success = iprot.readBool(); + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: @@ -3412,6 +3985,12 @@ class isTableEnabled_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()] @@ -3448,7 +4027,7 @@ class compact_args: break if fid == 1: if ftype == TType.STRING: - self.tableNameOrRegionName = iprot.readString(); + self.tableNameOrRegionName = iprot.readString() else: iprot.skip(ftype) else: @@ -3472,6 +4051,11 @@ class compact_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableNameOrRegionName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -3533,6 +4117,11 @@ class compact_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()] @@ -3569,7 +4158,7 @@ class majorCompact_args: break if fid == 1: if ftype == TType.STRING: - self.tableNameOrRegionName = iprot.readString(); + self.tableNameOrRegionName = iprot.readString() else: iprot.skip(ftype) else: @@ -3593,6 +4182,11 @@ class majorCompact_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableNameOrRegionName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -3654,6 +4248,11 @@ class majorCompact_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()] @@ -3696,6 +4295,10 @@ class getTableNames_args: return + def __hash__(self): + value = 17 + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -3735,10 +4338,10 @@ class getTableNames_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype26, _size23) = iprot.readListBegin() - for _i27 in xrange(_size23): - _elem28 = iprot.readString(); - self.success.append(_elem28) + (_etype47, _size44) = iprot.readListBegin() + for _i48 in xrange(_size44): + _elem49 = iprot.readString() + self.success.append(_elem49) iprot.readListEnd() else: iprot.skip(ftype) @@ -3761,8 +4364,8 @@ class getTableNames_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRING, len(self.success)) - for iter29 in self.success: - oprot.writeString(iter29) + for iter50 in self.success: + oprot.writeString(iter50) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -3776,6 +4379,12 @@ class getTableNames_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()] @@ -3812,7 +4421,7 @@ class getColumnDescriptors_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) else: @@ -3836,6 +4445,11 @@ class getColumnDescriptors_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -3875,12 +4489,12 @@ class getColumnDescriptors_result: if fid == 0: if ftype == TType.MAP: self.success = {} - (_ktype31, _vtype32, _size30 ) = iprot.readMapBegin() - for _i34 in xrange(_size30): - _key35 = iprot.readString(); - _val36 = ColumnDescriptor() - _val36.read(iprot) - self.success[_key35] = _val36 + (_ktype52, _vtype53, _size51 ) = iprot.readMapBegin() + for _i55 in xrange(_size51): + _key56 = iprot.readString() + _val57 = ColumnDescriptor() + _val57.read(iprot) + self.success[_key56] = _val57 iprot.readMapEnd() else: iprot.skip(ftype) @@ -3903,9 +4517,9 @@ class getColumnDescriptors_result: if self.success is not None: oprot.writeFieldBegin('success', TType.MAP, 0) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.success)) - for kiter37,viter38 in self.success.items(): - oprot.writeString(kiter37) - viter38.write(oprot) + for kiter58,viter59 in self.success.items(): + oprot.writeString(kiter58) + viter59.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() if self.io is not None: @@ -3919,6 +4533,12 @@ class getColumnDescriptors_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()] @@ -3955,7 +4575,7 @@ class getTableRegions_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) else: @@ -3979,6 +4599,11 @@ class getTableRegions_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -4018,11 +4643,11 @@ class getTableRegions_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype42, _size39) = iprot.readListBegin() - for _i43 in xrange(_size39): - _elem44 = TRegionInfo() - _elem44.read(iprot) - self.success.append(_elem44) + (_etype63, _size60) = iprot.readListBegin() + for _i64 in xrange(_size60): + _elem65 = TRegionInfo() + _elem65.read(iprot) + self.success.append(_elem65) iprot.readListEnd() else: iprot.skip(ftype) @@ -4045,8 +4670,8 @@ class getTableRegions_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter45 in self.success: - iter45.write(oprot) + for iter66 in self.success: + iter66.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -4060,6 +4685,12 @@ class getTableRegions_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()] @@ -4099,17 +4730,17 @@ class createTable_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.columnFamilies = [] - (_etype49, _size46) = iprot.readListBegin() - for _i50 in xrange(_size46): - _elem51 = ColumnDescriptor() - _elem51.read(iprot) - self.columnFamilies.append(_elem51) + (_etype70, _size67) = iprot.readListBegin() + for _i71 in xrange(_size67): + _elem72 = ColumnDescriptor() + _elem72.read(iprot) + self.columnFamilies.append(_elem72) iprot.readListEnd() else: iprot.skip(ftype) @@ -4130,8 +4761,8 @@ class createTable_args: if self.columnFamilies is not None: oprot.writeFieldBegin('columnFamilies', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.columnFamilies)) - for iter52 in self.columnFamilies: - iter52.write(oprot) + for iter73 in self.columnFamilies: + iter73.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -4141,6 +4772,12 @@ class createTable_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.columnFamilies) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -4228,6 +4865,13 @@ class createTable_result: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.io) + value = (value * 31) ^ hash(self.ia) + value = (value * 31) ^ hash(self.exist) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -4264,7 +4908,7 @@ class deleteTable_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) else: @@ -4288,6 +4932,11 @@ class deleteTable_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -4349,6 +4998,11 @@ class deleteTable_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()] @@ -4394,27 +5048,27 @@ class get_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.column = iprot.readString(); + self.column = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype54, _vtype55, _size53 ) = iprot.readMapBegin() - for _i57 in xrange(_size53): - _key58 = iprot.readString(); - _val59 = iprot.readString(); - self.attributes[_key58] = _val59 + (_ktype75, _vtype76, _size74 ) = iprot.readMapBegin() + for _i78 in xrange(_size74): + _key79 = iprot.readString() + _val80 = iprot.readString() + self.attributes[_key79] = _val80 iprot.readMapEnd() else: iprot.skip(ftype) @@ -4443,9 +5097,9 @@ class get_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter60,viter61 in self.attributes.items(): - oprot.writeString(kiter60) - oprot.writeString(viter61) + for kiter81,viter82 in self.attributes.items(): + oprot.writeString(kiter81) + oprot.writeString(viter82) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -4455,6 +5109,14 @@ class get_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -4494,11 +5156,11 @@ class get_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype65, _size62) = iprot.readListBegin() - for _i66 in xrange(_size62): - _elem67 = TCell() - _elem67.read(iprot) - self.success.append(_elem67) + (_etype86, _size83) = iprot.readListBegin() + for _i87 in xrange(_size83): + _elem88 = TCell() + _elem88.read(iprot) + self.success.append(_elem88) iprot.readListEnd() else: iprot.skip(ftype) @@ -4521,8 +5183,8 @@ class get_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter68 in self.success: - iter68.write(oprot) + for iter89 in self.success: + iter89.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -4536,6 +5198,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()] @@ -4584,32 +5252,32 @@ class getVer_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.column = iprot.readString(); + self.column = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I32: - self.numVersions = iprot.readI32(); + self.numVersions = iprot.readI32() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.MAP: self.attributes = {} - (_ktype70, _vtype71, _size69 ) = iprot.readMapBegin() - for _i73 in xrange(_size69): - _key74 = iprot.readString(); - _val75 = iprot.readString(); - self.attributes[_key74] = _val75 + (_ktype91, _vtype92, _size90 ) = iprot.readMapBegin() + for _i94 in xrange(_size90): + _key95 = iprot.readString() + _val96 = iprot.readString() + self.attributes[_key95] = _val96 iprot.readMapEnd() else: iprot.skip(ftype) @@ -4642,9 +5310,9 @@ class getVer_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter76,viter77 in self.attributes.items(): - oprot.writeString(kiter76) - oprot.writeString(viter77) + for kiter97,viter98 in self.attributes.items(): + oprot.writeString(kiter97) + oprot.writeString(viter98) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -4654,6 +5322,15 @@ class getVer_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.numVersions) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -4693,11 +5370,11 @@ class getVer_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype81, _size78) = iprot.readListBegin() - for _i82 in xrange(_size78): - _elem83 = TCell() - _elem83.read(iprot) - self.success.append(_elem83) + (_etype102, _size99) = iprot.readListBegin() + for _i103 in xrange(_size99): + _elem104 = TCell() + _elem104.read(iprot) + self.success.append(_elem104) iprot.readListEnd() else: iprot.skip(ftype) @@ -4720,8 +5397,8 @@ class getVer_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter84 in self.success: - iter84.write(oprot) + for iter105 in self.success: + iter105.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -4735,6 +5412,12 @@ class getVer_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()] @@ -4786,37 +5469,37 @@ class getVerTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.column = iprot.readString(); + self.column = 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.I32: - self.numVersions = iprot.readI32(); + self.numVersions = iprot.readI32() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.MAP: self.attributes = {} - (_ktype86, _vtype87, _size85 ) = iprot.readMapBegin() - for _i89 in xrange(_size85): - _key90 = iprot.readString(); - _val91 = iprot.readString(); - self.attributes[_key90] = _val91 + (_ktype107, _vtype108, _size106 ) = iprot.readMapBegin() + for _i110 in xrange(_size106): + _key111 = iprot.readString() + _val112 = iprot.readString() + self.attributes[_key111] = _val112 iprot.readMapEnd() else: iprot.skip(ftype) @@ -4853,9 +5536,9 @@ class getVerTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 6) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter92,viter93 in self.attributes.items(): - oprot.writeString(kiter92) - oprot.writeString(viter93) + for kiter113,viter114 in self.attributes.items(): + oprot.writeString(kiter113) + oprot.writeString(viter114) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -4865,6 +5548,16 @@ class getVerTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.numVersions) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -4904,11 +5597,11 @@ class getVerTs_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype97, _size94) = iprot.readListBegin() - for _i98 in xrange(_size94): - _elem99 = TCell() - _elem99.read(iprot) - self.success.append(_elem99) + (_etype118, _size115) = iprot.readListBegin() + for _i119 in xrange(_size115): + _elem120 = TCell() + _elem120.read(iprot) + self.success.append(_elem120) iprot.readListEnd() else: iprot.skip(ftype) @@ -4931,8 +5624,8 @@ class getVerTs_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter100 in self.success: - iter100.write(oprot) + for iter121 in self.success: + iter121.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -4946,6 +5639,12 @@ class getVerTs_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()] @@ -4988,22 +5687,22 @@ class getRow_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.MAP: self.attributes = {} - (_ktype102, _vtype103, _size101 ) = iprot.readMapBegin() - for _i105 in xrange(_size101): - _key106 = iprot.readString(); - _val107 = iprot.readString(); - self.attributes[_key106] = _val107 + (_ktype123, _vtype124, _size122 ) = iprot.readMapBegin() + for _i126 in xrange(_size122): + _key127 = iprot.readString() + _val128 = iprot.readString() + self.attributes[_key127] = _val128 iprot.readMapEnd() else: iprot.skip(ftype) @@ -5028,9 +5727,9 @@ class getRow_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter108,viter109 in self.attributes.items(): - oprot.writeString(kiter108) - oprot.writeString(viter109) + for kiter129,viter130 in self.attributes.items(): + oprot.writeString(kiter129) + oprot.writeString(viter130) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5040,6 +5739,13 @@ class getRow_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -5079,11 +5785,11 @@ class getRow_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype113, _size110) = iprot.readListBegin() - for _i114 in xrange(_size110): - _elem115 = TRowResult() - _elem115.read(iprot) - self.success.append(_elem115) + (_etype134, _size131) = iprot.readListBegin() + for _i135 in xrange(_size131): + _elem136 = TRowResult() + _elem136.read(iprot) + self.success.append(_elem136) iprot.readListEnd() else: iprot.skip(ftype) @@ -5106,8 +5812,8 @@ class getRow_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter116 in self.success: - iter116.write(oprot) + for iter137 in self.success: + iter137.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -5121,6 +5827,12 @@ class getRow_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()] @@ -5166,32 +5878,32 @@ class getRowWithColumns_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.LIST: self.columns = [] - (_etype120, _size117) = iprot.readListBegin() - for _i121 in xrange(_size117): - _elem122 = iprot.readString(); - self.columns.append(_elem122) + (_etype141, _size138) = iprot.readListBegin() + for _i142 in xrange(_size138): + _elem143 = iprot.readString() + self.columns.append(_elem143) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype124, _vtype125, _size123 ) = iprot.readMapBegin() - for _i127 in xrange(_size123): - _key128 = iprot.readString(); - _val129 = iprot.readString(); - self.attributes[_key128] = _val129 + (_ktype145, _vtype146, _size144 ) = iprot.readMapBegin() + for _i148 in xrange(_size144): + _key149 = iprot.readString() + _val150 = iprot.readString() + self.attributes[_key149] = _val150 iprot.readMapEnd() else: iprot.skip(ftype) @@ -5216,16 +5928,16 @@ class getRowWithColumns_args: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter130 in self.columns: - oprot.writeString(iter130) + for iter151 in self.columns: + oprot.writeString(iter151) oprot.writeListEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter131,viter132 in self.attributes.items(): - oprot.writeString(kiter131) - oprot.writeString(viter132) + for kiter152,viter153 in self.attributes.items(): + oprot.writeString(kiter152) + oprot.writeString(viter153) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5235,6 +5947,14 @@ class getRowWithColumns_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -5274,11 +5994,11 @@ class getRowWithColumns_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype136, _size133) = iprot.readListBegin() - for _i137 in xrange(_size133): - _elem138 = TRowResult() - _elem138.read(iprot) - self.success.append(_elem138) + (_etype157, _size154) = iprot.readListBegin() + for _i158 in xrange(_size154): + _elem159 = TRowResult() + _elem159.read(iprot) + self.success.append(_elem159) iprot.readListEnd() else: iprot.skip(ftype) @@ -5301,8 +6021,8 @@ class getRowWithColumns_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter139 in self.success: - iter139.write(oprot) + for iter160 in self.success: + iter160.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -5316,6 +6036,12 @@ class getRowWithColumns_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()] @@ -5361,27 +6087,27 @@ class getRowTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype141, _vtype142, _size140 ) = iprot.readMapBegin() - for _i144 in xrange(_size140): - _key145 = iprot.readString(); - _val146 = iprot.readString(); - self.attributes[_key145] = _val146 + (_ktype162, _vtype163, _size161 ) = iprot.readMapBegin() + for _i165 in xrange(_size161): + _key166 = iprot.readString() + _val167 = iprot.readString() + self.attributes[_key166] = _val167 iprot.readMapEnd() else: iprot.skip(ftype) @@ -5410,9 +6136,9 @@ class getRowTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter147,viter148 in self.attributes.items(): - oprot.writeString(kiter147) - oprot.writeString(viter148) + for kiter168,viter169 in self.attributes.items(): + oprot.writeString(kiter168) + oprot.writeString(viter169) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5422,6 +6148,14 @@ class getRowTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -5461,11 +6195,11 @@ class getRowTs_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype152, _size149) = iprot.readListBegin() - for _i153 in xrange(_size149): - _elem154 = TRowResult() - _elem154.read(iprot) - self.success.append(_elem154) + (_etype173, _size170) = iprot.readListBegin() + for _i174 in xrange(_size170): + _elem175 = TRowResult() + _elem175.read(iprot) + self.success.append(_elem175) iprot.readListEnd() else: iprot.skip(ftype) @@ -5488,8 +6222,8 @@ class getRowTs_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter155 in self.success: - iter155.write(oprot) + for iter176 in self.success: + iter176.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -5503,6 +6237,12 @@ class getRowTs_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()] @@ -5551,37 +6291,37 @@ class getRowWithColumnsTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.LIST: self.columns = [] - (_etype159, _size156) = iprot.readListBegin() - for _i160 in xrange(_size156): - _elem161 = iprot.readString(); - self.columns.append(_elem161) + (_etype180, _size177) = iprot.readListBegin() + for _i181 in xrange(_size177): + _elem182 = iprot.readString() + self.columns.append(_elem182) iprot.readListEnd() 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.MAP: self.attributes = {} - (_ktype163, _vtype164, _size162 ) = iprot.readMapBegin() - for _i166 in xrange(_size162): - _key167 = iprot.readString(); - _val168 = iprot.readString(); - self.attributes[_key167] = _val168 + (_ktype184, _vtype185, _size183 ) = iprot.readMapBegin() + for _i187 in xrange(_size183): + _key188 = iprot.readString() + _val189 = iprot.readString() + self.attributes[_key188] = _val189 iprot.readMapEnd() else: iprot.skip(ftype) @@ -5606,8 +6346,8 @@ class getRowWithColumnsTs_args: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter169 in self.columns: - oprot.writeString(iter169) + for iter190 in self.columns: + oprot.writeString(iter190) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -5617,9 +6357,9 @@ class getRowWithColumnsTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter170,viter171 in self.attributes.items(): - oprot.writeString(kiter170) - oprot.writeString(viter171) + for kiter191,viter192 in self.attributes.items(): + oprot.writeString(kiter191) + oprot.writeString(viter192) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5629,6 +6369,15 @@ class getRowWithColumnsTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -5668,11 +6417,11 @@ class getRowWithColumnsTs_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype175, _size172) = iprot.readListBegin() - for _i176 in xrange(_size172): - _elem177 = TRowResult() - _elem177.read(iprot) - self.success.append(_elem177) + (_etype196, _size193) = iprot.readListBegin() + for _i197 in xrange(_size193): + _elem198 = TRowResult() + _elem198.read(iprot) + self.success.append(_elem198) iprot.readListEnd() else: iprot.skip(ftype) @@ -5695,8 +6444,8 @@ class getRowWithColumnsTs_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter178 in self.success: - iter178.write(oprot) + for iter199 in self.success: + iter199.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -5710,6 +6459,12 @@ class getRowWithColumnsTs_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()] @@ -5752,27 +6507,27 @@ class getRows_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.rows = [] - (_etype182, _size179) = iprot.readListBegin() - for _i183 in xrange(_size179): - _elem184 = iprot.readString(); - self.rows.append(_elem184) + (_etype203, _size200) = iprot.readListBegin() + for _i204 in xrange(_size200): + _elem205 = iprot.readString() + self.rows.append(_elem205) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.MAP: self.attributes = {} - (_ktype186, _vtype187, _size185 ) = iprot.readMapBegin() - for _i189 in xrange(_size185): - _key190 = iprot.readString(); - _val191 = iprot.readString(); - self.attributes[_key190] = _val191 + (_ktype207, _vtype208, _size206 ) = iprot.readMapBegin() + for _i210 in xrange(_size206): + _key211 = iprot.readString() + _val212 = iprot.readString() + self.attributes[_key211] = _val212 iprot.readMapEnd() else: iprot.skip(ftype) @@ -5793,16 +6548,16 @@ class getRows_args: if self.rows is not None: oprot.writeFieldBegin('rows', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.rows)) - for iter192 in self.rows: - oprot.writeString(iter192) + for iter213 in self.rows: + oprot.writeString(iter213) 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 kiter193,viter194 in self.attributes.items(): - oprot.writeString(kiter193) - oprot.writeString(viter194) + for kiter214,viter215 in self.attributes.items(): + oprot.writeString(kiter214) + oprot.writeString(viter215) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -5812,6 +6567,13 @@ class getRows_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.rows) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -5851,11 +6613,11 @@ class getRows_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype198, _size195) = iprot.readListBegin() - for _i199 in xrange(_size195): - _elem200 = TRowResult() - _elem200.read(iprot) - self.success.append(_elem200) + (_etype219, _size216) = iprot.readListBegin() + for _i220 in xrange(_size216): + _elem221 = TRowResult() + _elem221.read(iprot) + self.success.append(_elem221) iprot.readListEnd() else: iprot.skip(ftype) @@ -5878,8 +6640,8 @@ class getRows_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter201 in self.success: - iter201.write(oprot) + for iter222 in self.success: + iter222.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -5893,6 +6655,12 @@ class getRows_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()] @@ -5938,37 +6706,37 @@ class getRowsWithColumns_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.rows = [] - (_etype205, _size202) = iprot.readListBegin() - for _i206 in xrange(_size202): - _elem207 = iprot.readString(); - self.rows.append(_elem207) + (_etype226, _size223) = iprot.readListBegin() + for _i227 in xrange(_size223): + _elem228 = iprot.readString() + self.rows.append(_elem228) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.columns = [] - (_etype211, _size208) = iprot.readListBegin() - for _i212 in xrange(_size208): - _elem213 = iprot.readString(); - self.columns.append(_elem213) + (_etype232, _size229) = iprot.readListBegin() + for _i233 in xrange(_size229): + _elem234 = iprot.readString() + self.columns.append(_elem234) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype215, _vtype216, _size214 ) = iprot.readMapBegin() - for _i218 in xrange(_size214): - _key219 = iprot.readString(); - _val220 = iprot.readString(); - self.attributes[_key219] = _val220 + (_ktype236, _vtype237, _size235 ) = iprot.readMapBegin() + for _i239 in xrange(_size235): + _key240 = iprot.readString() + _val241 = iprot.readString() + self.attributes[_key240] = _val241 iprot.readMapEnd() else: iprot.skip(ftype) @@ -5989,23 +6757,23 @@ class getRowsWithColumns_args: if self.rows is not None: oprot.writeFieldBegin('rows', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.rows)) - for iter221 in self.rows: - oprot.writeString(iter221) + for iter242 in self.rows: + oprot.writeString(iter242) oprot.writeListEnd() oprot.writeFieldEnd() if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter222 in self.columns: - oprot.writeString(iter222) + for iter243 in self.columns: + oprot.writeString(iter243) oprot.writeListEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter223,viter224 in self.attributes.items(): - oprot.writeString(kiter223) - oprot.writeString(viter224) + for kiter244,viter245 in self.attributes.items(): + oprot.writeString(kiter244) + oprot.writeString(viter245) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6015,6 +6783,14 @@ class getRowsWithColumns_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.rows) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -6054,11 +6830,11 @@ class getRowsWithColumns_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype228, _size225) = iprot.readListBegin() - for _i229 in xrange(_size225): - _elem230 = TRowResult() - _elem230.read(iprot) - self.success.append(_elem230) + (_etype249, _size246) = iprot.readListBegin() + for _i250 in xrange(_size246): + _elem251 = TRowResult() + _elem251.read(iprot) + self.success.append(_elem251) iprot.readListEnd() else: iprot.skip(ftype) @@ -6081,8 +6857,8 @@ class getRowsWithColumns_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter231 in self.success: - iter231.write(oprot) + for iter252 in self.success: + iter252.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -6096,6 +6872,12 @@ class getRowsWithColumns_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()] @@ -6141,32 +6923,32 @@ class getRowsTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.rows = [] - (_etype235, _size232) = iprot.readListBegin() - for _i236 in xrange(_size232): - _elem237 = iprot.readString(); - self.rows.append(_elem237) + (_etype256, _size253) = iprot.readListBegin() + for _i257 in xrange(_size253): + _elem258 = iprot.readString() + self.rows.append(_elem258) 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.MAP: self.attributes = {} - (_ktype239, _vtype240, _size238 ) = iprot.readMapBegin() - for _i242 in xrange(_size238): - _key243 = iprot.readString(); - _val244 = iprot.readString(); - self.attributes[_key243] = _val244 + (_ktype260, _vtype261, _size259 ) = iprot.readMapBegin() + for _i263 in xrange(_size259): + _key264 = iprot.readString() + _val265 = iprot.readString() + self.attributes[_key264] = _val265 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6187,8 +6969,8 @@ class getRowsTs_args: if self.rows is not None: oprot.writeFieldBegin('rows', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.rows)) - for iter245 in self.rows: - oprot.writeString(iter245) + for iter266 in self.rows: + oprot.writeString(iter266) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -6198,9 +6980,9 @@ class getRowsTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter246,viter247 in self.attributes.items(): - oprot.writeString(kiter246) - oprot.writeString(viter247) + for kiter267,viter268 in self.attributes.items(): + oprot.writeString(kiter267) + oprot.writeString(viter268) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6210,6 +6992,14 @@ class getRowsTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.rows) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -6249,11 +7039,11 @@ class getRowsTs_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype251, _size248) = iprot.readListBegin() - for _i252 in xrange(_size248): - _elem253 = TRowResult() - _elem253.read(iprot) - self.success.append(_elem253) + (_etype272, _size269) = iprot.readListBegin() + for _i273 in xrange(_size269): + _elem274 = TRowResult() + _elem274.read(iprot) + self.success.append(_elem274) iprot.readListEnd() else: iprot.skip(ftype) @@ -6276,8 +7066,8 @@ class getRowsTs_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter254 in self.success: - iter254.write(oprot) + for iter275 in self.success: + iter275.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -6291,6 +7081,12 @@ class getRowsTs_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()] @@ -6339,42 +7135,42 @@ class getRowsWithColumnsTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.rows = [] - (_etype258, _size255) = iprot.readListBegin() - for _i259 in xrange(_size255): - _elem260 = iprot.readString(); - self.rows.append(_elem260) + (_etype279, _size276) = iprot.readListBegin() + for _i280 in xrange(_size276): + _elem281 = iprot.readString() + self.rows.append(_elem281) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.columns = [] - (_etype264, _size261) = iprot.readListBegin() - for _i265 in xrange(_size261): - _elem266 = iprot.readString(); - self.columns.append(_elem266) + (_etype285, _size282) = iprot.readListBegin() + for _i286 in xrange(_size282): + _elem287 = iprot.readString() + self.columns.append(_elem287) iprot.readListEnd() 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.MAP: self.attributes = {} - (_ktype268, _vtype269, _size267 ) = iprot.readMapBegin() - for _i271 in xrange(_size267): - _key272 = iprot.readString(); - _val273 = iprot.readString(); - self.attributes[_key272] = _val273 + (_ktype289, _vtype290, _size288 ) = iprot.readMapBegin() + for _i292 in xrange(_size288): + _key293 = iprot.readString() + _val294 = iprot.readString() + self.attributes[_key293] = _val294 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6395,15 +7191,15 @@ class getRowsWithColumnsTs_args: if self.rows is not None: oprot.writeFieldBegin('rows', TType.LIST, 2) oprot.writeListBegin(TType.STRING, len(self.rows)) - for iter274 in self.rows: - oprot.writeString(iter274) + for iter295 in self.rows: + oprot.writeString(iter295) oprot.writeListEnd() oprot.writeFieldEnd() if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter275 in self.columns: - oprot.writeString(iter275) + for iter296 in self.columns: + oprot.writeString(iter296) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -6413,9 +7209,9 @@ class getRowsWithColumnsTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter276,viter277 in self.attributes.items(): - oprot.writeString(kiter276) - oprot.writeString(viter277) + for kiter297,viter298 in self.attributes.items(): + oprot.writeString(kiter297) + oprot.writeString(viter298) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6425,6 +7221,15 @@ class getRowsWithColumnsTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.rows) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -6464,11 +7269,11 @@ class getRowsWithColumnsTs_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype281, _size278) = iprot.readListBegin() - for _i282 in xrange(_size278): - _elem283 = TRowResult() - _elem283.read(iprot) - self.success.append(_elem283) + (_etype302, _size299) = iprot.readListBegin() + for _i303 in xrange(_size299): + _elem304 = TRowResult() + _elem304.read(iprot) + self.success.append(_elem304) iprot.readListEnd() else: iprot.skip(ftype) @@ -6491,8 +7296,8 @@ class getRowsWithColumnsTs_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter284 in self.success: - iter284.write(oprot) + for iter305 in self.success: + iter305.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -6506,6 +7311,12 @@ class getRowsWithColumnsTs_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()] @@ -6551,33 +7362,33 @@ class mutateRow_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.LIST: self.mutations = [] - (_etype288, _size285) = iprot.readListBegin() - for _i289 in xrange(_size285): - _elem290 = Mutation() - _elem290.read(iprot) - self.mutations.append(_elem290) + (_etype309, _size306) = iprot.readListBegin() + for _i310 in xrange(_size306): + _elem311 = Mutation() + _elem311.read(iprot) + self.mutations.append(_elem311) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype292, _vtype293, _size291 ) = iprot.readMapBegin() - for _i295 in xrange(_size291): - _key296 = iprot.readString(); - _val297 = iprot.readString(); - self.attributes[_key296] = _val297 + (_ktype313, _vtype314, _size312 ) = iprot.readMapBegin() + for _i316 in xrange(_size312): + _key317 = iprot.readString() + _val318 = iprot.readString() + self.attributes[_key317] = _val318 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6602,16 +7413,16 @@ class mutateRow_args: if self.mutations is not None: oprot.writeFieldBegin('mutations', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.mutations)) - for iter298 in self.mutations: - iter298.write(oprot) + for iter319 in self.mutations: + iter319.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter299,viter300 in self.attributes.items(): - oprot.writeString(kiter299) - oprot.writeString(viter300) + for kiter320,viter321 in self.attributes.items(): + oprot.writeString(kiter320) + oprot.writeString(viter321) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6621,6 +7432,14 @@ class mutateRow_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.mutations) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -6695,6 +7514,12 @@ class mutateRow_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()] @@ -6743,38 +7568,38 @@ class mutateRowTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.LIST: self.mutations = [] - (_etype304, _size301) = iprot.readListBegin() - for _i305 in xrange(_size301): - _elem306 = Mutation() - _elem306.read(iprot) - self.mutations.append(_elem306) + (_etype325, _size322) = iprot.readListBegin() + for _i326 in xrange(_size322): + _elem327 = Mutation() + _elem327.read(iprot) + self.mutations.append(_elem327) iprot.readListEnd() 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.MAP: self.attributes = {} - (_ktype308, _vtype309, _size307 ) = iprot.readMapBegin() - for _i311 in xrange(_size307): - _key312 = iprot.readString(); - _val313 = iprot.readString(); - self.attributes[_key312] = _val313 + (_ktype329, _vtype330, _size328 ) = iprot.readMapBegin() + for _i332 in xrange(_size328): + _key333 = iprot.readString() + _val334 = iprot.readString() + self.attributes[_key333] = _val334 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6799,8 +7624,8 @@ class mutateRowTs_args: if self.mutations is not None: oprot.writeFieldBegin('mutations', TType.LIST, 3) oprot.writeListBegin(TType.STRUCT, len(self.mutations)) - for iter314 in self.mutations: - iter314.write(oprot) + for iter335 in self.mutations: + iter335.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -6810,9 +7635,9 @@ class mutateRowTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter315,viter316 in self.attributes.items(): - oprot.writeString(kiter315) - oprot.writeString(viter316) + for kiter336,viter337 in self.attributes.items(): + oprot.writeString(kiter336) + oprot.writeString(viter337) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6822,6 +7647,15 @@ class mutateRowTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.mutations) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -6896,6 +7730,12 @@ class mutateRowTs_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()] @@ -6938,28 +7778,28 @@ class mutateRows_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.rowBatches = [] - (_etype320, _size317) = iprot.readListBegin() - for _i321 in xrange(_size317): - _elem322 = BatchMutation() - _elem322.read(iprot) - self.rowBatches.append(_elem322) + (_etype341, _size338) = iprot.readListBegin() + for _i342 in xrange(_size338): + _elem343 = BatchMutation() + _elem343.read(iprot) + self.rowBatches.append(_elem343) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.MAP: self.attributes = {} - (_ktype324, _vtype325, _size323 ) = iprot.readMapBegin() - for _i327 in xrange(_size323): - _key328 = iprot.readString(); - _val329 = iprot.readString(); - self.attributes[_key328] = _val329 + (_ktype345, _vtype346, _size344 ) = iprot.readMapBegin() + for _i348 in xrange(_size344): + _key349 = iprot.readString() + _val350 = iprot.readString() + self.attributes[_key349] = _val350 iprot.readMapEnd() else: iprot.skip(ftype) @@ -6980,16 +7820,16 @@ class mutateRows_args: if self.rowBatches is not None: oprot.writeFieldBegin('rowBatches', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.rowBatches)) - for iter330 in self.rowBatches: - iter330.write(oprot) + for iter351 in self.rowBatches: + iter351.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 kiter331,viter332 in self.attributes.items(): - oprot.writeString(kiter331) - oprot.writeString(viter332) + for kiter352,viter353 in self.attributes.items(): + oprot.writeString(kiter352) + oprot.writeString(viter353) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -6999,6 +7839,13 @@ class mutateRows_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.rowBatches) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -7073,6 +7920,12 @@ class mutateRows_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()] @@ -7118,33 +7971,33 @@ class mutateRowsTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.LIST: self.rowBatches = [] - (_etype336, _size333) = iprot.readListBegin() - for _i337 in xrange(_size333): - _elem338 = BatchMutation() - _elem338.read(iprot) - self.rowBatches.append(_elem338) + (_etype357, _size354) = iprot.readListBegin() + for _i358 in xrange(_size354): + _elem359 = BatchMutation() + _elem359.read(iprot) + self.rowBatches.append(_elem359) 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.MAP: self.attributes = {} - (_ktype340, _vtype341, _size339 ) = iprot.readMapBegin() - for _i343 in xrange(_size339): - _key344 = iprot.readString(); - _val345 = iprot.readString(); - self.attributes[_key344] = _val345 + (_ktype361, _vtype362, _size360 ) = iprot.readMapBegin() + for _i364 in xrange(_size360): + _key365 = iprot.readString() + _val366 = iprot.readString() + self.attributes[_key365] = _val366 iprot.readMapEnd() else: iprot.skip(ftype) @@ -7165,8 +8018,8 @@ class mutateRowsTs_args: if self.rowBatches is not None: oprot.writeFieldBegin('rowBatches', TType.LIST, 2) oprot.writeListBegin(TType.STRUCT, len(self.rowBatches)) - for iter346 in self.rowBatches: - iter346.write(oprot) + for iter367 in self.rowBatches: + iter367.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -7176,9 +8029,9 @@ class mutateRowsTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter347,viter348 in self.attributes.items(): - oprot.writeString(kiter347) - oprot.writeString(viter348) + for kiter368,viter369 in self.attributes.items(): + oprot.writeString(kiter368) + oprot.writeString(viter369) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7188,6 +8041,14 @@ class mutateRowsTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.rowBatches) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -7262,6 +8123,12 @@ class mutateRowsTs_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()] @@ -7307,22 +8174,22 @@ class atomicIncrement_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.column = iprot.readString(); + self.column = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I64: - self.value = iprot.readI64(); + self.value = iprot.readI64() else: iprot.skip(ftype) else: @@ -7358,6 +8225,14 @@ class atomicIncrement_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.value) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -7399,7 +8274,7 @@ class atomicIncrement_result: break if fid == 0: if ftype == TType.I64: - self.success = iprot.readI64(); + self.success = iprot.readI64() else: iprot.skip(ftype) elif fid == 1: @@ -7443,6 +8318,13 @@ class atomicIncrement_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()] @@ -7488,27 +8370,27 @@ class deleteAll_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.column = iprot.readString(); + self.column = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype350, _vtype351, _size349 ) = iprot.readMapBegin() - for _i353 in xrange(_size349): - _key354 = iprot.readString(); - _val355 = iprot.readString(); - self.attributes[_key354] = _val355 + (_ktype371, _vtype372, _size370 ) = iprot.readMapBegin() + for _i374 in xrange(_size370): + _key375 = iprot.readString() + _val376 = iprot.readString() + self.attributes[_key375] = _val376 iprot.readMapEnd() else: iprot.skip(ftype) @@ -7537,9 +8419,9 @@ class deleteAll_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter356,viter357 in self.attributes.items(): - oprot.writeString(kiter356) - oprot.writeString(viter357) + for kiter377,viter378 in self.attributes.items(): + oprot.writeString(kiter377) + oprot.writeString(viter378) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7549,6 +8431,14 @@ class deleteAll_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -7610,6 +8500,11 @@ class deleteAll_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()] @@ -7658,32 +8553,32 @@ class deleteAllTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.column = iprot.readString(); + self.column = 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.MAP: self.attributes = {} - (_ktype359, _vtype360, _size358 ) = iprot.readMapBegin() - for _i362 in xrange(_size358): - _key363 = iprot.readString(); - _val364 = iprot.readString(); - self.attributes[_key363] = _val364 + (_ktype380, _vtype381, _size379 ) = iprot.readMapBegin() + for _i383 in xrange(_size379): + _key384 = iprot.readString() + _val385 = iprot.readString() + self.attributes[_key384] = _val385 iprot.readMapEnd() else: iprot.skip(ftype) @@ -7716,9 +8611,9 @@ class deleteAllTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter365,viter366 in self.attributes.items(): - oprot.writeString(kiter365) - oprot.writeString(viter366) + for kiter386,viter387 in self.attributes.items(): + oprot.writeString(kiter386) + oprot.writeString(viter387) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7728,6 +8623,15 @@ class deleteAllTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -7789,6 +8693,11 @@ class deleteAllTs_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()] @@ -7831,22 +8740,22 @@ class deleteAllRow_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.MAP: self.attributes = {} - (_ktype368, _vtype369, _size367 ) = iprot.readMapBegin() - for _i371 in xrange(_size367): - _key372 = iprot.readString(); - _val373 = iprot.readString(); - self.attributes[_key372] = _val373 + (_ktype389, _vtype390, _size388 ) = iprot.readMapBegin() + for _i392 in xrange(_size388): + _key393 = iprot.readString() + _val394 = iprot.readString() + self.attributes[_key393] = _val394 iprot.readMapEnd() else: iprot.skip(ftype) @@ -7871,9 +8780,9 @@ class deleteAllRow_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter374,viter375 in self.attributes.items(): - oprot.writeString(kiter374) - oprot.writeString(viter375) + for kiter395,viter396 in self.attributes.items(): + oprot.writeString(kiter395) + oprot.writeString(viter396) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -7883,6 +8792,13 @@ class deleteAllRow_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -7944,6 +8860,11 @@ class deleteAllRow_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()] @@ -8005,6 +8926,11 @@ class increment_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.increment) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -8066,6 +8992,11 @@ class increment_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()] @@ -8103,11 +9034,11 @@ class incrementRows_args: if fid == 1: if ftype == TType.LIST: self.increments = [] - (_etype379, _size376) = iprot.readListBegin() - for _i380 in xrange(_size376): - _elem381 = TIncrement() - _elem381.read(iprot) - self.increments.append(_elem381) + (_etype400, _size397) = iprot.readListBegin() + for _i401 in xrange(_size397): + _elem402 = TIncrement() + _elem402.read(iprot) + self.increments.append(_elem402) iprot.readListEnd() else: iprot.skip(ftype) @@ -8124,8 +9055,8 @@ class incrementRows_args: if self.increments is not None: oprot.writeFieldBegin('increments', TType.LIST, 1) oprot.writeListBegin(TType.STRUCT, len(self.increments)) - for iter382 in self.increments: - iter382.write(oprot) + for iter403 in self.increments: + iter403.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8135,6 +9066,11 @@ class incrementRows_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.increments) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -8196,6 +9132,11 @@ class incrementRows_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()] @@ -8241,27 +9182,27 @@ class deleteAllRowTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = 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.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype384, _vtype385, _size383 ) = iprot.readMapBegin() - for _i387 in xrange(_size383): - _key388 = iprot.readString(); - _val389 = iprot.readString(); - self.attributes[_key388] = _val389 + (_ktype405, _vtype406, _size404 ) = iprot.readMapBegin() + for _i408 in xrange(_size404): + _key409 = iprot.readString() + _val410 = iprot.readString() + self.attributes[_key409] = _val410 iprot.readMapEnd() else: iprot.skip(ftype) @@ -8290,9 +9231,9 @@ class deleteAllRowTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter390,viter391 in self.attributes.items(): - oprot.writeString(kiter390) - oprot.writeString(viter391) + for kiter411,viter412 in self.attributes.items(): + oprot.writeString(kiter411) + oprot.writeString(viter412) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8302,6 +9243,14 @@ class deleteAllRowTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -8363,6 +9312,11 @@ class deleteAllRowTs_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()] @@ -8405,7 +9359,7 @@ class scannerOpenWithScan_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: @@ -8417,11 +9371,11 @@ class scannerOpenWithScan_args: elif fid == 3: if ftype == TType.MAP: self.attributes = {} - (_ktype393, _vtype394, _size392 ) = iprot.readMapBegin() - for _i396 in xrange(_size392): - _key397 = iprot.readString(); - _val398 = iprot.readString(); - self.attributes[_key397] = _val398 + (_ktype414, _vtype415, _size413 ) = iprot.readMapBegin() + for _i417 in xrange(_size413): + _key418 = iprot.readString() + _val419 = iprot.readString() + self.attributes[_key418] = _val419 iprot.readMapEnd() else: iprot.skip(ftype) @@ -8446,9 +9400,9 @@ class scannerOpenWithScan_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 3) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter399,viter400 in self.attributes.items(): - oprot.writeString(kiter399) - oprot.writeString(viter400) + for kiter420,viter421 in self.attributes.items(): + oprot.writeString(kiter420) + oprot.writeString(viter421) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8458,6 +9412,13 @@ class scannerOpenWithScan_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.scan) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -8496,7 +9457,7 @@ class scannerOpenWithScan_result: break if fid == 0: if ftype == TType.I32: - self.success = iprot.readI32(); + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: @@ -8530,6 +9491,12 @@ class scannerOpenWithScan_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()] @@ -8578,32 +9545,32 @@ class scannerOpen_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.startRow = iprot.readString(); + self.startRow = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.columns = [] - (_etype404, _size401) = iprot.readListBegin() - for _i405 in xrange(_size401): - _elem406 = iprot.readString(); - self.columns.append(_elem406) + (_etype425, _size422) = iprot.readListBegin() + for _i426 in xrange(_size422): + _elem427 = iprot.readString() + self.columns.append(_elem427) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype408, _vtype409, _size407 ) = iprot.readMapBegin() - for _i411 in xrange(_size407): - _key412 = iprot.readString(); - _val413 = iprot.readString(); - self.attributes[_key412] = _val413 + (_ktype429, _vtype430, _size428 ) = iprot.readMapBegin() + for _i432 in xrange(_size428): + _key433 = iprot.readString() + _val434 = iprot.readString() + self.attributes[_key433] = _val434 iprot.readMapEnd() else: iprot.skip(ftype) @@ -8628,16 +9595,16 @@ class scannerOpen_args: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter414 in self.columns: - oprot.writeString(iter414) + for iter435 in self.columns: + oprot.writeString(iter435) oprot.writeListEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter415,viter416 in self.attributes.items(): - oprot.writeString(kiter415) - oprot.writeString(viter416) + for kiter436,viter437 in self.attributes.items(): + oprot.writeString(kiter436) + oprot.writeString(viter437) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8647,6 +9614,14 @@ class scannerOpen_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.startRow) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -8685,7 +9660,7 @@ class scannerOpen_result: break if fid == 0: if ftype == TType.I32: - self.success = iprot.readI32(); + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: @@ -8719,6 +9694,12 @@ class scannerOpen_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()] @@ -8771,37 +9752,37 @@ class scannerOpenWithStop_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.startRow = iprot.readString(); + self.startRow = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.stopRow = iprot.readString(); + self.stopRow = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.columns = [] - (_etype420, _size417) = iprot.readListBegin() - for _i421 in xrange(_size417): - _elem422 = iprot.readString(); - self.columns.append(_elem422) + (_etype441, _size438) = iprot.readListBegin() + for _i442 in xrange(_size438): + _elem443 = iprot.readString() + self.columns.append(_elem443) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.MAP: self.attributes = {} - (_ktype424, _vtype425, _size423 ) = iprot.readMapBegin() - for _i427 in xrange(_size423): - _key428 = iprot.readString(); - _val429 = iprot.readString(); - self.attributes[_key428] = _val429 + (_ktype445, _vtype446, _size444 ) = iprot.readMapBegin() + for _i448 in xrange(_size444): + _key449 = iprot.readString() + _val450 = iprot.readString() + self.attributes[_key449] = _val450 iprot.readMapEnd() else: iprot.skip(ftype) @@ -8830,16 +9811,16 @@ class scannerOpenWithStop_args: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter430 in self.columns: - oprot.writeString(iter430) + for iter451 in self.columns: + oprot.writeString(iter451) oprot.writeListEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter431,viter432 in self.attributes.items(): - oprot.writeString(kiter431) - oprot.writeString(viter432) + for kiter452,viter453 in self.attributes.items(): + oprot.writeString(kiter452) + oprot.writeString(viter453) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -8849,6 +9830,15 @@ class scannerOpenWithStop_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.startRow) + value = (value * 31) ^ hash(self.stopRow) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -8887,7 +9877,7 @@ class scannerOpenWithStop_result: break if fid == 0: if ftype == TType.I32: - self.success = iprot.readI32(); + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: @@ -8921,6 +9911,12 @@ class scannerOpenWithStop_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()] @@ -8966,32 +9962,32 @@ class scannerOpenWithPrefix_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.startAndPrefix = iprot.readString(); + self.startAndPrefix = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.columns = [] - (_etype436, _size433) = iprot.readListBegin() - for _i437 in xrange(_size433): - _elem438 = iprot.readString(); - self.columns.append(_elem438) + (_etype457, _size454) = iprot.readListBegin() + for _i458 in xrange(_size454): + _elem459 = iprot.readString() + self.columns.append(_elem459) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.MAP: self.attributes = {} - (_ktype440, _vtype441, _size439 ) = iprot.readMapBegin() - for _i443 in xrange(_size439): - _key444 = iprot.readString(); - _val445 = iprot.readString(); - self.attributes[_key444] = _val445 + (_ktype461, _vtype462, _size460 ) = iprot.readMapBegin() + for _i464 in xrange(_size460): + _key465 = iprot.readString() + _val466 = iprot.readString() + self.attributes[_key465] = _val466 iprot.readMapEnd() else: iprot.skip(ftype) @@ -9016,16 +10012,16 @@ class scannerOpenWithPrefix_args: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter446 in self.columns: - oprot.writeString(iter446) + for iter467 in self.columns: + oprot.writeString(iter467) oprot.writeListEnd() oprot.writeFieldEnd() if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 4) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter447,viter448 in self.attributes.items(): - oprot.writeString(kiter447) - oprot.writeString(viter448) + for kiter468,viter469 in self.attributes.items(): + oprot.writeString(kiter468) + oprot.writeString(viter469) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -9035,6 +10031,14 @@ class scannerOpenWithPrefix_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.startAndPrefix) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -9073,7 +10077,7 @@ class scannerOpenWithPrefix_result: break if fid == 0: if ftype == TType.I32: - self.success = iprot.readI32(); + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: @@ -9107,6 +10111,12 @@ class scannerOpenWithPrefix_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()] @@ -9158,37 +10168,37 @@ class scannerOpenTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.startRow = iprot.readString(); + self.startRow = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.LIST: self.columns = [] - (_etype452, _size449) = iprot.readListBegin() - for _i453 in xrange(_size449): - _elem454 = iprot.readString(); - self.columns.append(_elem454) + (_etype473, _size470) = iprot.readListBegin() + for _i474 in xrange(_size470): + _elem475 = iprot.readString() + self.columns.append(_elem475) iprot.readListEnd() 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.MAP: self.attributes = {} - (_ktype456, _vtype457, _size455 ) = iprot.readMapBegin() - for _i459 in xrange(_size455): - _key460 = iprot.readString(); - _val461 = iprot.readString(); - self.attributes[_key460] = _val461 + (_ktype477, _vtype478, _size476 ) = iprot.readMapBegin() + for _i480 in xrange(_size476): + _key481 = iprot.readString() + _val482 = iprot.readString() + self.attributes[_key481] = _val482 iprot.readMapEnd() else: iprot.skip(ftype) @@ -9213,8 +10223,8 @@ class scannerOpenTs_args: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 3) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter462 in self.columns: - oprot.writeString(iter462) + for iter483 in self.columns: + oprot.writeString(iter483) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -9224,9 +10234,9 @@ class scannerOpenTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 5) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter463,viter464 in self.attributes.items(): - oprot.writeString(kiter463) - oprot.writeString(viter464) + for kiter484,viter485 in self.attributes.items(): + oprot.writeString(kiter484) + oprot.writeString(viter485) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -9236,6 +10246,15 @@ class scannerOpenTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.startRow) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -9274,7 +10293,7 @@ class scannerOpenTs_result: break if fid == 0: if ftype == TType.I32: - self.success = iprot.readI32(); + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: @@ -9308,6 +10327,12 @@ class scannerOpenTs_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()] @@ -9363,42 +10388,42 @@ class scannerOpenWithStopTs_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.tableName = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.startRow = iprot.readString(); + self.startRow = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.stopRow = iprot.readString(); + self.stopRow = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.columns = [] - (_etype468, _size465) = iprot.readListBegin() - for _i469 in xrange(_size465): - _elem470 = iprot.readString(); - self.columns.append(_elem470) + (_etype489, _size486) = iprot.readListBegin() + for _i490 in xrange(_size486): + _elem491 = iprot.readString() + self.columns.append(_elem491) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.MAP: self.attributes = {} - (_ktype472, _vtype473, _size471 ) = iprot.readMapBegin() - for _i475 in xrange(_size471): - _key476 = iprot.readString(); - _val477 = iprot.readString(); - self.attributes[_key476] = _val477 + (_ktype493, _vtype494, _size492 ) = iprot.readMapBegin() + for _i496 in xrange(_size492): + _key497 = iprot.readString() + _val498 = iprot.readString() + self.attributes[_key497] = _val498 iprot.readMapEnd() else: iprot.skip(ftype) @@ -9427,8 +10452,8 @@ class scannerOpenWithStopTs_args: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter478 in self.columns: - oprot.writeString(iter478) + for iter499 in self.columns: + oprot.writeString(iter499) oprot.writeListEnd() oprot.writeFieldEnd() if self.timestamp is not None: @@ -9438,9 +10463,9 @@ class scannerOpenWithStopTs_args: if self.attributes is not None: oprot.writeFieldBegin('attributes', TType.MAP, 6) oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) - for kiter479,viter480 in self.attributes.items(): - oprot.writeString(kiter479) - oprot.writeString(viter480) + for kiter500,viter501 in self.attributes.items(): + oprot.writeString(kiter500) + oprot.writeString(viter501) oprot.writeMapEnd() oprot.writeFieldEnd() oprot.writeFieldStop() @@ -9450,6 +10475,16 @@ class scannerOpenWithStopTs_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.startRow) + value = (value * 31) ^ hash(self.stopRow) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.timestamp) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -9488,7 +10523,7 @@ class scannerOpenWithStopTs_result: break if fid == 0: if ftype == TType.I32: - self.success = iprot.readI32(); + self.success = iprot.readI32() else: iprot.skip(ftype) elif fid == 1: @@ -9522,6 +10557,12 @@ class scannerOpenWithStopTs_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()] @@ -9558,7 +10599,7 @@ class scannerGet_args: break if fid == 1: if ftype == TType.I32: - self.id = iprot.readI32(); + self.id = iprot.readI32() else: iprot.skip(ftype) else: @@ -9582,6 +10623,11 @@ class scannerGet_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.id) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -9624,11 +10670,11 @@ class scannerGet_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype484, _size481) = iprot.readListBegin() - for _i485 in xrange(_size481): - _elem486 = TRowResult() - _elem486.read(iprot) - self.success.append(_elem486) + (_etype505, _size502) = iprot.readListBegin() + for _i506 in xrange(_size502): + _elem507 = TRowResult() + _elem507.read(iprot) + self.success.append(_elem507) iprot.readListEnd() else: iprot.skip(ftype) @@ -9657,8 +10703,8 @@ class scannerGet_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter487 in self.success: - iter487.write(oprot) + for iter508 in self.success: + iter508.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -9676,6 +10722,13 @@ class scannerGet_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()] @@ -9715,12 +10768,12 @@ class scannerGetList_args: break if fid == 1: if ftype == TType.I32: - self.id = iprot.readI32(); + self.id = iprot.readI32() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: - self.nbRows = iprot.readI32(); + self.nbRows = iprot.readI32() else: iprot.skip(ftype) else: @@ -9748,6 +10801,12 @@ class scannerGetList_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.id) + value = (value * 31) ^ hash(self.nbRows) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -9790,11 +10849,11 @@ class scannerGetList_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype491, _size488) = iprot.readListBegin() - for _i492 in xrange(_size488): - _elem493 = TRowResult() - _elem493.read(iprot) - self.success.append(_elem493) + (_etype512, _size509) = iprot.readListBegin() + for _i513 in xrange(_size509): + _elem514 = TRowResult() + _elem514.read(iprot) + self.success.append(_elem514) iprot.readListEnd() else: iprot.skip(ftype) @@ -9823,8 +10882,8 @@ class scannerGetList_result: if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter494 in self.success: - iter494.write(oprot) + for iter515 in self.success: + iter515.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -9842,6 +10901,13 @@ class scannerGetList_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()] @@ -9878,7 +10944,7 @@ class scannerClose_args: break if fid == 1: if ftype == TType.I32: - self.id = iprot.readI32(); + self.id = iprot.readI32() else: iprot.skip(ftype) else: @@ -9902,6 +10968,11 @@ class scannerClose_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.id) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -9976,6 +11047,12 @@ class scannerClose_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()] @@ -9987,25 +11064,19 @@ class scannerClose_result: def __ne__(self, other): return not (self == other) -class getRowOrBefore_args: +class getRegionInfo_args: """ Attributes: - - tableName: name of table - row: row key - - family: column name """ thrift_spec = ( None, # 0 - (1, TType.STRING, 'tableName', None, None, ), # 1 - (2, TType.STRING, 'row', None, None, ), # 2 - (3, TType.STRING, 'family', None, None, ), # 3 + (1, TType.STRING, 'row', None, None, ), # 1 ) - def __init__(self, tableName=None, row=None, family=None,): - self.tableName = tableName + def __init__(self, row=None,): self.row = row - self.family = family def read(self, iprot): if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: @@ -10018,17 +11089,81 @@ class getRowOrBefore_args: break if fid == 1: if ftype == TType.STRING: - self.tableName = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.row = iprot.readString(); + 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('getRegionInfo_args') + if self.row is not None: + oprot.writeFieldBegin('row', TType.STRING, 1) + oprot.writeString(self.row) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + 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 getRegionInfo_result: + """ + Attributes: + - success + - io + """ + + thrift_spec = ( + (0, TType.STRUCT, 'success', (TRegionInfo, TRegionInfo.thrift_spec), None, ), # 0 + (1, TType.STRUCT, 'io', (IOError, IOError.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 = TRegionInfo() + self.success.read(iprot) else: iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.family = iprot.readString(); + elif fid == 1: + if ftype == TType.STRUCT: + self.io = IOError() + self.io.read(iprot) else: iprot.skip(ftype) else: @@ -10040,18 +11175,81 @@ class getRowOrBefore_args: 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('getRowOrBefore_args') - if self.tableName is not None: - oprot.writeFieldBegin('tableName', TType.STRING, 1) - oprot.writeString(self.tableName) + oprot.writeStructBegin('getRegionInfo_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.STRUCT, 0) + self.success.write(oprot) oprot.writeFieldEnd() - if self.row is not None: - oprot.writeFieldBegin('row', TType.STRING, 2) - oprot.writeString(self.row) + if self.io is not None: + oprot.writeFieldBegin('io', TType.STRUCT, 1) + self.io.write(oprot) oprot.writeFieldEnd() - if self.family is not None: - oprot.writeFieldBegin('family', TType.STRING, 3) - oprot.writeString(self.family) + 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 append_args: + """ + Attributes: + - append: The single append operation to apply + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'append', (TAppend, TAppend.thrift_spec), None, ), # 1 + ) + + def __init__(self, append=None,): + self.append = append + + 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.append = TAppend() + self.append.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.append is not None: + oprot.writeFieldBegin('append', TType.STRUCT, 1) + self.append.write(oprot) oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -10060,6 +11258,11 @@ class getRowOrBefore_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.append) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -10071,7 +11274,7 @@ class getRowOrBefore_args: def __ne__(self, other): return not (self == other) -class getRowOrBefore_result: +class append_result: """ Attributes: - success @@ -10099,11 +11302,11 @@ class getRowOrBefore_result: if fid == 0: if ftype == TType.LIST: self.success = [] - (_etype498, _size495) = iprot.readListBegin() - for _i499 in xrange(_size495): - _elem500 = TCell() - _elem500.read(iprot) - self.success.append(_elem500) + (_etype519, _size516) = iprot.readListBegin() + for _i520 in xrange(_size516): + _elem521 = TCell() + _elem521.read(iprot) + self.success.append(_elem521) iprot.readListEnd() else: iprot.skip(ftype) @@ -10122,12 +11325,12 @@ class getRowOrBefore_result: 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('getRowOrBefore_result') + oprot.writeStructBegin('append_result') if self.success is not None: oprot.writeFieldBegin('success', TType.LIST, 0) oprot.writeListBegin(TType.STRUCT, len(self.success)) - for iter501 in self.success: - iter501.write(oprot) + for iter522 in self.success: + iter522.write(oprot) oprot.writeListEnd() oprot.writeFieldEnd() if self.io is not None: @@ -10141,6 +11344,12 @@ class getRowOrBefore_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()] @@ -10152,19 +11361,37 @@ class getRowOrBefore_result: def __ne__(self, other): return not (self == other) -class getRegionInfo_args: +class checkAndPut_args: """ Attributes: + - tableName: name of table - row: row key + - column: column name + - value: the expected value for the column parameter, if not + provided the check is for the non-existence of the + column in question + - mput: mutation for the put + - attributes: Mutation attributes """ thrift_spec = ( None, # 0 - (1, TType.STRING, 'row', None, None, ), # 1 + (1, TType.STRING, 'tableName', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.STRING, 'column', None, None, ), # 3 + None, # 4 + (5, TType.STRING, 'value', None, None, ), # 5 + (6, TType.STRUCT, 'mput', (Mutation, Mutation.thrift_spec), None, ), # 6 + (7, TType.MAP, 'attributes', (TType.STRING,None,TType.STRING,None), None, ), # 7 ) - def __init__(self, row=None,): + def __init__(self, tableName=None, row=None, column=None, value=None, mput=None, attributes=None,): + self.tableName = tableName self.row = row + self.column = column + self.value = value + self.mput = mput + self.attributes = attributes 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: @@ -10177,7 +11404,39 @@ class getRegionInfo_args: break if fid == 1: if ftype == TType.STRING: - self.row = iprot.readString(); + self.tableName = 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.column = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.value = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.mput = Mutation() + self.mput.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.MAP: + self.attributes = {} + (_ktype524, _vtype525, _size523 ) = iprot.readMapBegin() + for _i527 in xrange(_size523): + _key528 = iprot.readString() + _val529 = iprot.readString() + self.attributes[_key528] = _val529 + iprot.readMapEnd() else: iprot.skip(ftype) else: @@ -10189,11 +11448,35 @@ class getRegionInfo_args: 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('getRegionInfo_args') + oprot.writeStructBegin('checkAndPut_args') + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 1) + oprot.writeString(self.tableName) + oprot.writeFieldEnd() if self.row is not None: - oprot.writeFieldBegin('row', TType.STRING, 1) + oprot.writeFieldBegin('row', TType.STRING, 2) oprot.writeString(self.row) oprot.writeFieldEnd() + if self.column is not None: + oprot.writeFieldBegin('column', TType.STRING, 3) + oprot.writeString(self.column) + oprot.writeFieldEnd() + if self.value is not None: + oprot.writeFieldBegin('value', TType.STRING, 5) + oprot.writeString(self.value) + oprot.writeFieldEnd() + if self.mput is not None: + oprot.writeFieldBegin('mput', TType.STRUCT, 6) + self.mput.write(oprot) + oprot.writeFieldEnd() + if self.attributes is not None: + oprot.writeFieldBegin('attributes', TType.MAP, 7) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.attributes)) + for kiter530,viter531 in self.attributes.items(): + oprot.writeString(kiter530) + oprot.writeString(viter531) + oprot.writeMapEnd() + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -10201,6 +11484,16 @@ class getRegionInfo_args: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.tableName) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.value) + value = (value * 31) ^ hash(self.mput) + value = (value * 31) ^ hash(self.attributes) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -10212,21 +11505,24 @@ class getRegionInfo_args: def __ne__(self, other): return not (self == other) -class getRegionInfo_result: +class checkAndPut_result: """ Attributes: - success - io + - ia """ thrift_spec = ( - (0, TType.STRUCT, 'success', (TRegionInfo, TRegionInfo.thrift_spec), None, ), # 0 + (0, TType.BOOL, 'success', None, None, ), # 0 (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), # 1 + (2, TType.STRUCT, 'ia', (IllegalArgument, IllegalArgument.thrift_spec), None, ), # 2 ) - def __init__(self, success=None, io=None,): + def __init__(self, success=None, io=None, ia=None,): self.success = success self.io = io + self.ia = ia 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: @@ -10238,9 +11534,8 @@ class getRegionInfo_result: if ftype == TType.STOP: break if fid == 0: - if ftype == TType.STRUCT: - self.success = TRegionInfo() - self.success.read(iprot) + if ftype == TType.BOOL: + self.success = iprot.readBool() else: iprot.skip(ftype) elif fid == 1: @@ -10249,6 +11544,12 @@ class getRegionInfo_result: self.io.read(iprot) else: iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.ia = IllegalArgument() + self.ia.read(iprot) + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -10258,15 +11559,19 @@ class getRegionInfo_result: 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('getRegionInfo_result') + oprot.writeStructBegin('checkAndPut_result') if self.success is not None: - oprot.writeFieldBegin('success', TType.STRUCT, 0) - self.success.write(oprot) + 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() + if self.ia is not None: + oprot.writeFieldBegin('ia', TType.STRUCT, 2) + self.ia.write(oprot) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -10274,6 +11579,123 @@ class getRegionInfo_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()] + 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 getThriftServerType_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getThriftServerType_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + 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 getThriftServerType_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = 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('getThriftServerType_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + 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/thrift1/gen-py/hbase/constants.py b/hbase-examples/src/main/python/thrift1/gen-py/hbase/constants.py index a236326cf3..4a6492b869 100644 --- a/hbase-examples/src/main/python/thrift1/gen-py/hbase/constants.py +++ b/hbase-examples/src/main/python/thrift1/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/thrift1/gen-py/hbase/ttypes.py b/hbase-examples/src/main/python/thrift1/gen-py/hbase/ttypes.py index e3efe3a731..e4508a5299 100644 --- a/hbase-examples/src/main/python/thrift1/gen-py/hbase/ttypes.py +++ b/hbase-examples/src/main/python/thrift1/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 # @@ -16,6 +16,23 @@ except: fastbinary = None +class TThriftServerType: + """ + Specify type of thrift server: thrift and thrift2 + """ + ONE = 1 + TWO = 2 + + _VALUES_TO_NAMES = { + 1: "ONE", + 2: "TWO", + } + + _NAMES_TO_VALUES = { + "ONE": 1, + "TWO": 2, + } + class TCell: """ @@ -50,12 +67,12 @@ class TCell: break if fid == 1: if ftype == TType.STRING: - self.value = iprot.readString(); + self.value = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) else: @@ -83,6 +100,12 @@ class TCell: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.value) + value = (value * 31) ^ hash(self.timestamp) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -122,7 +145,7 @@ class ColumnDescriptor: (6, TType.I32, 'bloomFilterVectorSize', None, 0, ), # 6 (7, TType.I32, 'bloomFilterNbHashes', None, 0, ), # 7 (8, TType.BOOL, 'blockCacheEnabled', None, False, ), # 8 - (9, TType.I32, 'timeToLive', None, -1, ), # 9 + (9, TType.I32, 'timeToLive', None, 2147483647, ), # 9 ) def __init__(self, name=None, maxVersions=thrift_spec[2][4], compression=thrift_spec[3][4], inMemory=thrift_spec[4][4], bloomFilterType=thrift_spec[5][4], bloomFilterVectorSize=thrift_spec[6][4], bloomFilterNbHashes=thrift_spec[7][4], blockCacheEnabled=thrift_spec[8][4], timeToLive=thrift_spec[9][4],): @@ -147,47 +170,47 @@ class ColumnDescriptor: break if fid == 1: if ftype == TType.STRING: - self.name = iprot.readString(); + self.name = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.I32: - self.maxVersions = iprot.readI32(); + self.maxVersions = iprot.readI32() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.STRING: - self.compression = iprot.readString(); + self.compression = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.BOOL: - self.inMemory = iprot.readBool(); + self.inMemory = iprot.readBool() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.STRING: - self.bloomFilterType = iprot.readString(); + self.bloomFilterType = iprot.readString() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.I32: - self.bloomFilterVectorSize = iprot.readI32(); + self.bloomFilterVectorSize = iprot.readI32() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.I32: - self.bloomFilterNbHashes = iprot.readI32(); + self.bloomFilterNbHashes = iprot.readI32() else: iprot.skip(ftype) elif fid == 8: if ftype == TType.BOOL: - self.blockCacheEnabled = iprot.readBool(); + self.blockCacheEnabled = iprot.readBool() else: iprot.skip(ftype) elif fid == 9: if ftype == TType.I32: - self.timeToLive = iprot.readI32(); + self.timeToLive = iprot.readI32() else: iprot.skip(ftype) else: @@ -243,6 +266,19 @@ class ColumnDescriptor: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.name) + value = (value * 31) ^ hash(self.maxVersions) + value = (value * 31) ^ hash(self.compression) + value = (value * 31) ^ hash(self.inMemory) + value = (value * 31) ^ hash(self.bloomFilterType) + value = (value * 31) ^ hash(self.bloomFilterVectorSize) + value = (value * 31) ^ hash(self.bloomFilterNbHashes) + value = (value * 31) ^ hash(self.blockCacheEnabled) + value = (value * 31) ^ hash(self.timeToLive) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -299,37 +335,37 @@ class TRegionInfo: break if fid == 1: if ftype == TType.STRING: - self.startKey = iprot.readString(); + self.startKey = iprot.readString() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.endKey = iprot.readString(); + self.endKey = iprot.readString() else: iprot.skip(ftype) elif fid == 3: if ftype == TType.I64: - self.id = iprot.readI64(); + self.id = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.STRING: - self.name = iprot.readString(); + self.name = iprot.readString() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.BYTE: - self.version = iprot.readByte(); + self.version = iprot.readByte() else: iprot.skip(ftype) elif fid == 6: if ftype == TType.STRING: - self.serverName = iprot.readString(); + self.serverName = iprot.readString() else: iprot.skip(ftype) elif fid == 7: if ftype == TType.I32: - self.port = iprot.readI32(); + self.port = iprot.readI32() else: iprot.skip(ftype) else: @@ -377,6 +413,17 @@ class TRegionInfo: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.startKey) + value = (value * 31) ^ hash(self.endKey) + value = (value * 31) ^ hash(self.id) + value = (value * 31) ^ hash(self.name) + value = (value * 31) ^ hash(self.version) + value = (value * 31) ^ hash(self.serverName) + value = (value * 31) ^ hash(self.port) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -424,22 +471,22 @@ class Mutation: break if fid == 1: if ftype == TType.BOOL: - self.isDelete = iprot.readBool(); + self.isDelete = iprot.readBool() else: iprot.skip(ftype) elif fid == 2: if ftype == TType.STRING: - self.column = iprot.readString(); + self.column = 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.BOOL: - self.writeToWAL = iprot.readBool(); + self.writeToWAL = iprot.readBool() else: iprot.skip(ftype) else: @@ -475,6 +522,14 @@ class Mutation: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.isDelete) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.value) + value = (value * 31) ^ hash(self.writeToWAL) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -516,7 +571,7 @@ class BatchMutation: break if fid == 1: if ftype == TType.STRING: - self.row = iprot.readString(); + self.row = iprot.readString() else: iprot.skip(ftype) elif fid == 2: @@ -558,6 +613,12 @@ class BatchMutation: 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()] @@ -606,22 +667,22 @@ class TIncrement: 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.column = iprot.readString(); + self.column = iprot.readString() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.I64: - self.ammount = iprot.readI64(); + self.ammount = iprot.readI64() else: iprot.skip(ftype) else: @@ -657,6 +718,95 @@ class TIncrement: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.column) + value = (value * 31) ^ hash(self.ammount) + 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 TColumn: + """ + Holds column name and the cell. + + Attributes: + - columnName + - cell + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'columnName', None, None, ), # 1 + (2, TType.STRUCT, 'cell', (TCell, TCell.thrift_spec), None, ), # 2 + ) + + def __init__(self, columnName=None, cell=None,): + self.columnName = columnName + self.cell = cell + + 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.columnName = iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.cell = TCell() + self.cell.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('TColumn') + if self.columnName is not None: + oprot.writeFieldBegin('columnName', TType.STRING, 1) + oprot.writeString(self.columnName) + oprot.writeFieldEnd() + if self.cell is not None: + oprot.writeFieldBegin('cell', TType.STRUCT, 2) + self.cell.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.columnName) + value = (value * 31) ^ hash(self.cell) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -675,17 +825,20 @@ class TRowResult: Attributes: - row - columns + - sortedColumns """ thrift_spec = ( None, # 0 (1, TType.STRING, 'row', None, None, ), # 1 (2, TType.MAP, 'columns', (TType.STRING,None,TType.STRUCT,(TCell, TCell.thrift_spec)), None, ), # 2 + (3, TType.LIST, 'sortedColumns', (TType.STRUCT,(TColumn, TColumn.thrift_spec)), None, ), # 3 ) - def __init__(self, row=None, columns=None,): + def __init__(self, row=None, columns=None, sortedColumns=None,): self.row = row self.columns = columns + self.sortedColumns = sortedColumns 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: @@ -698,21 +851,32 @@ class TRowResult: 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.MAP: self.columns = {} - (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin() + (_ktype8, _vtype9, _size7 ) = iprot.readMapBegin() for _i11 in xrange(_size7): - _key12 = iprot.readString(); + _key12 = iprot.readString() _val13 = TCell() _val13.read(iprot) self.columns[_key12] = _val13 iprot.readMapEnd() else: iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.sortedColumns = [] + (_etype17, _size14) = iprot.readListBegin() + for _i18 in xrange(_size14): + _elem19 = TColumn() + _elem19.read(iprot) + self.sortedColumns.append(_elem19) + iprot.readListEnd() + else: + iprot.skip(ftype) else: iprot.skip(ftype) iprot.readFieldEnd() @@ -730,11 +894,18 @@ class TRowResult: if self.columns is not None: oprot.writeFieldBegin('columns', TType.MAP, 2) oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.columns)) - for kiter14,viter15 in self.columns.items(): - oprot.writeString(kiter14) - viter15.write(oprot) + for kiter20,viter21 in self.columns.items(): + oprot.writeString(kiter20) + viter21.write(oprot) oprot.writeMapEnd() oprot.writeFieldEnd() + if self.sortedColumns is not None: + oprot.writeFieldBegin('sortedColumns', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.sortedColumns)) + for iter22 in self.sortedColumns: + iter22.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -742,6 +913,13 @@ class TRowResult: return + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.sortedColumns) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -764,6 +942,10 @@ class TScan: - columns - caching - filterString + - batchSize + - sortColumns + - reversed + - cacheBlocks """ thrift_spec = ( @@ -774,15 +956,23 @@ class TScan: (4, TType.LIST, 'columns', (TType.STRING,None), None, ), # 4 (5, TType.I32, 'caching', None, None, ), # 5 (6, TType.STRING, 'filterString', None, None, ), # 6 + (7, TType.I32, 'batchSize', None, None, ), # 7 + (8, TType.BOOL, 'sortColumns', None, None, ), # 8 + (9, TType.BOOL, 'reversed', None, None, ), # 9 + (10, TType.BOOL, 'cacheBlocks', None, None, ), # 10 ) - def __init__(self, startRow=None, stopRow=None, timestamp=None, columns=None, caching=None, filterString=None,): + def __init__(self, startRow=None, stopRow=None, timestamp=None, columns=None, caching=None, filterString=None, batchSize=None, sortColumns=None, reversed=None, cacheBlocks=None,): self.startRow = startRow self.stopRow = stopRow self.timestamp = timestamp self.columns = columns self.caching = caching self.filterString = filterString + self.batchSize = batchSize + self.sortColumns = sortColumns + self.reversed = reversed + self.cacheBlocks = cacheBlocks 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: @@ -795,37 +985,57 @@ 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.I64: - self.timestamp = iprot.readI64(); + self.timestamp = iprot.readI64() else: iprot.skip(ftype) elif fid == 4: if ftype == TType.LIST: self.columns = [] - (_etype19, _size16) = iprot.readListBegin() - for _i20 in xrange(_size16): - _elem21 = iprot.readString(); - self.columns.append(_elem21) + (_etype26, _size23) = iprot.readListBegin() + for _i27 in xrange(_size23): + _elem28 = iprot.readString() + self.columns.append(_elem28) iprot.readListEnd() else: iprot.skip(ftype) elif fid == 5: if ftype == TType.I32: - self.caching = iprot.readI32(); + self.caching = 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.I32: + self.batchSize = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.BOOL: + self.sortColumns = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.BOOL: + self.reversed = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 10: + if ftype == TType.BOOL: + self.cacheBlocks = iprot.readBool() else: iprot.skip(ftype) else: @@ -853,8 +1063,8 @@ class TScan: if self.columns is not None: oprot.writeFieldBegin('columns', TType.LIST, 4) oprot.writeListBegin(TType.STRING, len(self.columns)) - for iter22 in self.columns: - oprot.writeString(iter22) + for iter29 in self.columns: + oprot.writeString(iter29) oprot.writeListEnd() oprot.writeFieldEnd() if self.caching is not None: @@ -865,6 +1075,22 @@ class TScan: oprot.writeFieldBegin('filterString', TType.STRING, 6) oprot.writeString(self.filterString) oprot.writeFieldEnd() + if self.batchSize is not None: + oprot.writeFieldBegin('batchSize', TType.I32, 7) + oprot.writeI32(self.batchSize) + oprot.writeFieldEnd() + if self.sortColumns is not None: + oprot.writeFieldBegin('sortColumns', TType.BOOL, 8) + oprot.writeBool(self.sortColumns) + oprot.writeFieldEnd() + if self.reversed is not None: + oprot.writeFieldBegin('reversed', TType.BOOL, 9) + oprot.writeBool(self.reversed) + oprot.writeFieldEnd() + if self.cacheBlocks is not None: + oprot.writeFieldBegin('cacheBlocks', TType.BOOL, 10) + oprot.writeBool(self.cacheBlocks) + oprot.writeFieldEnd() oprot.writeFieldStop() oprot.writeStructEnd() @@ -872,6 +1098,142 @@ 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.timestamp) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.caching) + value = (value * 31) ^ hash(self.filterString) + value = (value * 31) ^ hash(self.batchSize) + value = (value * 31) ^ hash(self.sortColumns) + value = (value * 31) ^ hash(self.reversed) + value = (value * 31) ^ hash(self.cacheBlocks) + 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: + """ + An Append object is used to specify the parameters for performing the append operation. + + Attributes: + - table + - row + - columns + - values + """ + + thrift_spec = ( + None, # 0 + (1, TType.STRING, 'table', None, None, ), # 1 + (2, TType.STRING, 'row', None, None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRING,None), None, ), # 3 + (4, TType.LIST, 'values', (TType.STRING,None), None, ), # 4 + ) + + def __init__(self, table=None, row=None, columns=None, values=None,): + self.table = table + self.row = row + self.columns = columns + self.values = values + + 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.LIST: + self.columns = [] + (_etype33, _size30) = iprot.readListBegin() + for _i34 in xrange(_size30): + _elem35 = iprot.readString() + self.columns.append(_elem35) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.LIST: + self.values = [] + (_etype39, _size36) = iprot.readListBegin() + for _i40 in xrange(_size36): + _elem41 = iprot.readString() + self.values.append(_elem41) + 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('TAppend') + 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.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRING, len(self.columns)) + for iter42 in self.columns: + oprot.writeString(iter42) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 4) + oprot.writeListBegin(TType.STRING, len(self.values)) + for iter43 in self.values: + oprot.writeString(iter43) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.table) + value = (value * 31) ^ hash(self.row) + value = (value * 31) ^ hash(self.columns) + value = (value * 31) ^ hash(self.values) + return value + def __repr__(self): L = ['%s=%r' % (key, value) for key, value in self.__dict__.iteritems()] @@ -912,7 +1274,7 @@ class IOError(TException): break if fid == 1: if ftype == TType.STRING: - self.message = iprot.readString(); + self.message = iprot.readString() else: iprot.skip(ftype) else: @@ -939,6 +1301,11 @@ class IOError(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()] @@ -978,7 +1345,7 @@ class IllegalArgument(TException): break if fid == 1: if ftype == TType.STRING: - self.message = iprot.readString(); + self.message = iprot.readString() else: iprot.skip(ftype) else: @@ -1005,6 +1372,11 @@ class IllegalArgument(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()] @@ -1044,7 +1416,7 @@ class AlreadyExists(TException): break if fid == 1: if ftype == TType.STRING: - self.message = iprot.readString(); + self.message = iprot.readString() else: iprot.skip(ftype) else: @@ -1071,6 +1443,11 @@ class AlreadyExists(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()] diff --git a/hbase-examples/src/main/python/thrift2/DemoClient.py b/hbase-examples/src/main/python/thrift2/DemoClient.py index 63719f0e0b..83ac6ecf10 100644 --- a/hbase-examples/src/main/python/thrift2/DemoClient.py +++ b/hbase-examples/src/main/python/thrift2/DemoClient.py @@ -61,6 +61,11 @@ client = THBaseService.Client(protocol) transport.open() +# Check Thrift Server Type +serverType = client.getThriftServerType() +if serverType != 1: + raise Exception("Mismatch between client and server, server type is %s" %serverType) + table = "example" put = TPut(row="row1", columnValues=[TColumnValue(family="family1",qualifier="qualifier1",value="value1")]) 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 2b80916556..4a691ed201 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 @@ -44,6 +44,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help': 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(' TThriftServerType getThriftServerType()') print('') sys.exit(0) @@ -220,6 +221,12 @@ elif cmd == 'checkAndMutate': sys.exit(1) pp.pprint(client.checkAndMutate(args[0],args[1],args[2],args[3],eval(args[4]),args[5],eval(args[6]),)) +elif cmd == 'getThriftServerType': + if len(args) != 0: + print('getThriftServerType requires 0 args') + sys.exit(1) + pp.pprint(client.getThriftServerType()) + else: print('Unrecognized method %s' % cmd) sys.exit(1) 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 da8f4a392a..456fb1b403 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 @@ -281,6 +281,14 @@ class Iface: """ pass + def getThriftServerType(self): + """ + Get the type of this thrift server. + + @return the type of this thrift server + """ + pass + class Client(Iface): def __init__(self, iprot, oprot=None): @@ -1098,6 +1106,37 @@ class Client(Iface): raise result.io raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndMutate failed: unknown result") + def getThriftServerType(self): + """ + Get the type of this thrift server. + + @return the type of this thrift server + """ + self.send_getThriftServerType() + return self.recv_getThriftServerType() + + def send_getThriftServerType(self): + self._oprot.writeMessageBegin('getThriftServerType', TMessageType.CALL, self._seqid) + args = getThriftServerType_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_getThriftServerType(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = getThriftServerType_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "getThriftServerType failed: unknown result") + class Processor(Iface, TProcessor): def __init__(self, handler): @@ -1123,6 +1162,7 @@ class Processor(Iface, TProcessor): self._processMap["getRegionLocation"] = Processor.process_getRegionLocation self._processMap["getAllRegionLocations"] = Processor.process_getAllRegionLocations self._processMap["checkAndMutate"] = Processor.process_checkAndMutate + self._processMap["getThriftServerType"] = Processor.process_getThriftServerType def process(self, iprot, oprot): (name, type, seqid) = iprot.readMessageBegin() @@ -1585,6 +1625,25 @@ class Processor(Iface, TProcessor): oprot.writeMessageEnd() oprot.trans.flush() + def process_getThriftServerType(self, seqid, iprot, oprot): + args = getThriftServerType_args() + args.read(iprot) + iprot.readMessageEnd() + result = getThriftServerType_result() + try: + result.success = self._handler.getThriftServerType() + msg_type = TMessageType.REPLY + except (TTransport.TTransportException, KeyboardInterrupt, SystemExit): + raise + except Exception as ex: + msg_type = TMessageType.EXCEPTION + logging.exception(ex) + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("getThriftServerType", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + # HELPER FUNCTIONS AND STRUCTURES @@ -5050,3 +5109,113 @@ class checkAndMutate_result: def __ne__(self, other): return not (self == other) + +class getThriftServerType_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('getThriftServerType_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + 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 getThriftServerType_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I32, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I32: + self.success = 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('getThriftServerType_result') + if self.success is not None: + oprot.writeFieldBegin('success', TType.I32, 0) + oprot.writeI32(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + + def __hash__(self): + value = 17 + value = (value * 31) ^ hash(self.success) + 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) 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 a5695d6e89..c4c9a8b7eb 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 @@ -24,15 +24,21 @@ class TDeleteType: """ DELETE_COLUMN = 0 DELETE_COLUMNS = 1 + DELETE_FAMILY = 2 + DELETE_FAMILY_VERSION = 3 _VALUES_TO_NAMES = { 0: "DELETE_COLUMN", 1: "DELETE_COLUMNS", + 2: "DELETE_FAMILY", + 3: "DELETE_FAMILY_VERSION", } _NAMES_TO_VALUES = { "DELETE_COLUMN": 0, "DELETE_COLUMNS": 1, + "DELETE_FAMILY": 2, + "DELETE_FAMILY_VERSION": 3, } class TDurability: @@ -112,6 +118,23 @@ class TCompareOp: "NO_OP": 6, } +class TThriftServerType: + """ + Specify type of thrift server: thrift and thrift2 + """ + ONE = 1 + TWO = 2 + + _VALUES_TO_NAMES = { + 1: "ONE", + 2: "TWO", + } + + _NAMES_TO_VALUES = { + "ONE": 1, + "TWO": 2, + } + class TTimeRange: """ diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java index d8b814e5a7..d8db473dfa 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java @@ -99,6 +99,8 @@ public class ThriftServer { String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0"); infoServer = new InfoServer("thrift", a, port, false, conf); infoServer.setAttribute("hbase.conf", conf); + infoServer.setAttribute("hbase.thrift.type", + ThriftMetrics.ThriftServerType.ONE.name()); infoServer.start(); } diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java index 39ea259426..7ff60287fc 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServerRunner.java @@ -97,6 +97,7 @@ import org.apache.hadoop.hbase.thrift.generated.TIncrement; import org.apache.hadoop.hbase.thrift.generated.TRegionInfo; import org.apache.hadoop.hbase.thrift.generated.TRowResult; import org.apache.hadoop.hbase.thrift.generated.TScan; +import org.apache.hadoop.hbase.thrift.generated.TThriftServerType; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ConnectionCache; import org.apache.hadoop.hbase.util.DNS; @@ -1951,6 +1952,11 @@ public class ThriftServerRunner implements Runnable { closeTable(table); } } + + @Override + public TThriftServerType getThriftServerType() { + return TThriftServerType.ONE; + } } diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java index f77ce143f2..e77e6f08ef 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/Hbase.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-04-13") public class Hbase { public interface Iface { @@ -642,6 +642,13 @@ public class Hbase { */ public boolean checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes) throws IOError, IllegalArgument, org.apache.thrift.TException; + /** + * Get the type of this thrift server. + * + * @return the type of this thrift server + */ + public TThriftServerType getThriftServerType() throws org.apache.thrift.TException; + } public interface AsyncIface { @@ -734,6 +741,8 @@ public class Hbase { public void checkAndPut(ByteBuffer tableName, ByteBuffer row, ByteBuffer column, ByteBuffer value, Mutation mput, Map attributes, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -1972,6 +1981,28 @@ public class Hbase { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result"); } + public TThriftServerType getThriftServerType() throws org.apache.thrift.TException + { + send_getThriftServerType(); + return recv_getThriftServerType(); + } + + public void send_getThriftServerType() throws org.apache.thrift.TException + { + getThriftServerType_args args = new getThriftServerType_args(); + sendBase("getThriftServerType", args); + } + + public TThriftServerType recv_getThriftServerType() throws org.apache.thrift.TException + { + getThriftServerType_result result = new getThriftServerType_result(); + receiveBase(result, "getThriftServerType"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getThriftServerType failed: unknown result"); + } + } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { @@ -3668,6 +3699,35 @@ public class Hbase { } } + public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getThriftServerType_call method_call = new getThriftServerType_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getThriftServerType_call extends org.apache.thrift.async.TAsyncMethodCall { + public getThriftServerType_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getThriftServerType", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getThriftServerType_args args = new getThriftServerType_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public TThriftServerType getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getThriftServerType(); + } + } + } public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { @@ -3725,6 +3785,7 @@ public class Hbase { processMap.put("getRegionInfo", new getRegionInfo()); processMap.put("append", new append()); processMap.put("checkAndPut", new checkAndPut()); + processMap.put("getThriftServerType", new getThriftServerType()); return processMap; } @@ -4815,6 +4876,26 @@ public class Hbase { } } + public static class getThriftServerType extends org.apache.thrift.ProcessFunction { + public getThriftServerType() { + super("getThriftServerType"); + } + + public getThriftServerType_args getEmptyArgsInstance() { + return new getThriftServerType_args(); + } + + protected boolean isOneway() { + return false; + } + + public getThriftServerType_result getResult(I iface, getThriftServerType_args args) throws org.apache.thrift.TException { + getThriftServerType_result result = new getThriftServerType_result(); + result.success = iface.getThriftServerType(); + return result; + } + } + } public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { @@ -4872,6 +4953,7 @@ public class Hbase { processMap.put("getRegionInfo", new getRegionInfo()); processMap.put("append", new append()); processMap.put("checkAndPut", new checkAndPut()); + processMap.put("getThriftServerType", new getThriftServerType()); return processMap; } @@ -7430,6 +7512,57 @@ public class Hbase { } } + public static class getThriftServerType extends org.apache.thrift.AsyncProcessFunction { + public getThriftServerType() { + super("getThriftServerType"); + } + + public getThriftServerType_args getEmptyArgsInstance() { + return new getThriftServerType_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TThriftServerType o) { + getThriftServerType_result result = new getThriftServerType_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getThriftServerType_result result = new getThriftServerType_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getThriftServerType_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getThriftServerType(resultHandler); + } + } + } public static class enableTable_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -58582,4 +58715,629 @@ public class Hbase { } + public static class getThriftServerType_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getThriftServerType_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getThriftServerType_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_args.class, metaDataMap); + } + + public getThriftServerType_args() { + } + + /** + * Performs a deep copy on other. + */ + public getThriftServerType_args(getThriftServerType_args other) { + } + + public getThriftServerType_args deepCopy() { + return new getThriftServerType_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getThriftServerType_args) + return this.equals((getThriftServerType_args)that); + return false; + } + + public boolean equals(getThriftServerType_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getThriftServerType_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getThriftServerType_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getThriftServerType_argsStandardSchemeFactory implements SchemeFactory { + public getThriftServerType_argsStandardScheme getScheme() { + return new getThriftServerType_argsStandardScheme(); + } + } + + private static class getThriftServerType_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getThriftServerType_argsTupleSchemeFactory implements SchemeFactory { + public getThriftServerType_argsTupleScheme getScheme() { + return new getThriftServerType_argsTupleScheme(); + } + } + + private static class getThriftServerType_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getThriftServerType_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getThriftServerType_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getThriftServerType_resultTupleSchemeFactory()); + } + + /** + * + * @see TThriftServerType + */ + public TThriftServerType success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see TThriftServerType + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TThriftServerType.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_result.class, metaDataMap); + } + + public getThriftServerType_result() { + } + + public getThriftServerType_result( + TThriftServerType success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getThriftServerType_result(getThriftServerType_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public getThriftServerType_result deepCopy() { + return new getThriftServerType_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see TThriftServerType + */ + public TThriftServerType getSuccess() { + return this.success; + } + + /** + * + * @see TThriftServerType + */ + public getThriftServerType_result setSuccess(TThriftServerType success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TThriftServerType)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getThriftServerType_result) + return this.equals((getThriftServerType_result)that); + return false; + } + + public boolean equals(getThriftServerType_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(getThriftServerType_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getThriftServerType_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getThriftServerType_resultStandardSchemeFactory implements SchemeFactory { + public getThriftServerType_resultStandardScheme getScheme() { + return new getThriftServerType_resultStandardScheme(); + } + } + + private static class getThriftServerType_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = org.apache.hadoop.hbase.thrift.generated.TThriftServerType.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getThriftServerType_resultTupleSchemeFactory implements SchemeFactory { + public getThriftServerType_resultTupleScheme getScheme() { + return new getThriftServerType_resultTupleScheme(); + } + } + + private static class getThriftServerType_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = org.apache.hadoop.hbase.thrift.generated.TThriftServerType.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + } diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TThriftServerType.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TThriftServerType.java new file mode 100644 index 0000000000..49cbf64ba8 --- /dev/null +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/generated/TThriftServerType.java @@ -0,0 +1,48 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hbase.thrift.generated; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +/** + * Specify type of thrift server: thrift and thrift2 + */ +public enum TThriftServerType implements org.apache.thrift.TEnum { + ONE(1), + TWO(2); + + private final int value; + + private TThriftServerType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TThriftServerType findByValue(int value) { + switch (value) { + case 1: + return ONE; + case 2: + return TWO; + default: + return null; + } + } +} diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java index 8e3ee964db..1c10a074c1 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftHBaseServiceHandler.java @@ -67,6 +67,7 @@ import org.apache.hadoop.hbase.thrift2.generated.TPut; import org.apache.hadoop.hbase.thrift2.generated.TResult; import org.apache.hadoop.hbase.thrift2.generated.TRowMutations; import org.apache.hadoop.hbase.thrift2.generated.TScan; +import org.apache.hadoop.hbase.thrift2.generated.TThriftServerType; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ConnectionCache; import org.apache.thrift.TException; @@ -561,6 +562,11 @@ public class ThriftHBaseServiceHandler implements THBaseService.Iface { } } + @Override + public TThriftServerType getThriftServerType() { + return TThriftServerType.TWO; + } + private void checkReadOnlyMode() throws TIOError { if (isReadOnly()) { throw getTIOError(ioe); diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java index 5681569cc5..81950a0523 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/ThriftServer.java @@ -122,9 +122,16 @@ public class ThriftServer extends Configured implements Tool { "hbase.thrift.server.socket.read.timeout"; public static final int THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT = 60000; + TServer tServer; + private InfoServer infoServer; + public ThriftServer() { } + public ThriftServer(Configuration conf) { + super(conf); + } + private static void printUsage() { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp("Thrift", null, getOptions(), @@ -511,7 +518,7 @@ public class ThriftServer extends Configured implements Tool { // Put up info server. startInfoServer(conf); - final TServer tserver = getServer(workerThreads, selectorThreads, maxCallQueueSize, readTimeout, + tServer = getServer(workerThreads, selectorThreads, maxCallQueueSize, readTimeout, backlog, nonblocking, hsha, selector, metrics, protocolFactory, processor, transportFactory, inetSocketAddress); @@ -521,7 +528,7 @@ public class ThriftServer extends Configured implements Tool { public Object run() { pauseMonitor.start(); try { - tserver.serve(); + tServer.serve(); return null; } finally { pauseMonitor.stop(); @@ -532,6 +539,18 @@ public class ThriftServer extends Configured implements Tool { return 0; } + public void stop() { + if (this.infoServer != null) { + log.info("Stopping infoServer ..."); + try { + this.infoServer.stop(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + tServer.stop(); + } + private String getImplType(boolean nonblocking, boolean hsha, boolean selector) { String implType = "threadpool"; @@ -592,8 +611,10 @@ public class ThriftServer extends Configured implements Tool { if (port >= 0) { conf.setLong("startcode", System.currentTimeMillis()); String a = conf.get("hbase.thrift.info.bindAddress", "0.0.0.0"); - InfoServer infoServer = new InfoServer("thrift", a, port, false, conf); + infoServer = new InfoServer("thrift", a, port, false, conf); infoServer.setAttribute("hbase.conf", conf); + infoServer.setAttribute("hbase.thrift.type", + ThriftMetrics.ThriftServerType.TWO.name()); infoServer.start(); } } diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java index ae7c9d67e5..a5fd570555 100644 --- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-05-25") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-04-13") public class THBaseService { public interface Iface { @@ -52,12 +52,12 @@ public class THBaseService { /** * 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. - * + * * @param table the table to check on - * + * * @param tgets a list of TGets to check for */ public List existsAll(ByteBuffer table, List tgets) throws TIOError, org.apache.thrift.TException; @@ -282,13 +282,20 @@ public class THBaseService { */ public boolean checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations) throws TIOError, org.apache.thrift.TException; + /** + * Get the type of this thrift server. + * + * @return the type of this thrift server + */ + public TThriftServerType getThriftServerType() throws org.apache.thrift.TException; + } public interface AsyncIface { public void exists(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void existsAll(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void existsAll(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void get(ByteBuffer table, TGet tget, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -326,6 +333,8 @@ public class THBaseService { public void checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -892,6 +901,28 @@ public class THBaseService { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkAndMutate failed: unknown result"); } + public TThriftServerType getThriftServerType() throws org.apache.thrift.TException + { + send_getThriftServerType(); + return recv_getThriftServerType(); + } + + public void send_getThriftServerType() throws org.apache.thrift.TException + { + getThriftServerType_args args = new getThriftServerType_args(); + sendBase("getThriftServerType", args); + } + + public TThriftServerType recv_getThriftServerType() throws org.apache.thrift.TException + { + getThriftServerType_result result = new getThriftServerType_result(); + receiveBase(result, "getThriftServerType"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getThriftServerType failed: unknown result"); + } + } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { @@ -945,7 +976,7 @@ public class THBaseService { } } - public void existsAll(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void existsAll(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); existsAll_call method_call = new existsAll_call(table, tgets, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; @@ -955,7 +986,7 @@ public class THBaseService { public static class existsAll_call extends org.apache.thrift.async.TAsyncMethodCall { private ByteBuffer table; private List tgets; - public existsAll_call(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + public existsAll_call(ByteBuffer table, List tgets, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.table = table; this.tgets = tgets; @@ -1649,6 +1680,35 @@ public class THBaseService { } } + public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getThriftServerType_call method_call = new getThriftServerType_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getThriftServerType_call extends org.apache.thrift.async.TAsyncMethodCall { + public getThriftServerType_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getThriftServerType", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getThriftServerType_args args = new getThriftServerType_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public TThriftServerType getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getThriftServerType(); + } + } + } public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { @@ -1682,6 +1742,7 @@ public class THBaseService { processMap.put("getRegionLocation", new getRegionLocation()); processMap.put("getAllRegionLocations", new getAllRegionLocations()); processMap.put("checkAndMutate", new checkAndMutate()); + processMap.put("getThriftServerType", new getThriftServerType()); return processMap; } @@ -1733,6 +1794,7 @@ public class THBaseService { return result; } } + public static class get extends org.apache.thrift.ProcessFunction { public get() { super("get"); @@ -2173,6 +2235,26 @@ public class THBaseService { } } + public static class getThriftServerType extends org.apache.thrift.ProcessFunction { + public getThriftServerType() { + super("getThriftServerType"); + } + + public getThriftServerType_args getEmptyArgsInstance() { + return new getThriftServerType_args(); + } + + protected boolean isOneway() { + return false; + } + + public getThriftServerType_result getResult(I iface, getThriftServerType_args args) throws org.apache.thrift.TException { + getThriftServerType_result result = new getThriftServerType_result(); + result.success = iface.getThriftServerType(); + return result; + } + } + } public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { @@ -2187,6 +2269,7 @@ public class THBaseService { private static Map> getProcessMap(Map> processMap) { processMap.put("exists", new exists()); + processMap.put("existsAll", new existsAll()); processMap.put("get", new get()); processMap.put("getMultiple", new getMultiple()); processMap.put("put", new put()); @@ -2205,6 +2288,7 @@ public class THBaseService { processMap.put("getRegionLocation", new getRegionLocation()); processMap.put("getAllRegionLocations", new getAllRegionLocations()); processMap.put("checkAndMutate", new checkAndMutate()); + processMap.put("getThriftServerType", new getThriftServerType()); return processMap; } @@ -2266,6 +2350,63 @@ public class THBaseService { } } + public static class existsAll extends org.apache.thrift.AsyncProcessFunction> { + public existsAll() { + super("existsAll"); + } + + public existsAll_args getEmptyArgsInstance() { + return new existsAll_args(); + } + + public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback>() { + public void onComplete(List o) { + existsAll_result result = new existsAll_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + existsAll_result result = new existsAll_result(); + if (e instanceof TIOError) { + result.io = (TIOError) e; + result.setIoIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, existsAll_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException { + iface.existsAll(args.table, args.tgets,resultHandler); + } + } + public static class get extends org.apache.thrift.AsyncProcessFunction { public get() { super("get"); @@ -3301,6 +3442,57 @@ public class THBaseService { } } + public static class getThriftServerType extends org.apache.thrift.AsyncProcessFunction { + public getThriftServerType() { + super("getThriftServerType"); + } + + public getThriftServerType_args getEmptyArgsInstance() { + return new getThriftServerType_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TThriftServerType o) { + getThriftServerType_result result = new getThriftServerType_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + getThriftServerType_result result = new getThriftServerType_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, getThriftServerType_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.getThriftServerType(resultHandler); + } + } + } public static class exists_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -4265,14 +4457,13 @@ public class THBaseService { } - public static class existsAll_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + public static class existsAll_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("existsAll_args"); - private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short) 1); - private static final org.apache.thrift.protocol.TField TGETS_FIELD_DESC = new org.apache.thrift.protocol.TField("tgets", org.apache.thrift.protocol.TType.LIST, (short) 2); + private static final org.apache.thrift.protocol.TField TABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("table", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TGETS_FIELD_DESC = new org.apache.thrift.protocol.TField("tgets", org.apache.thrift.protocol.TType.LIST, (short)2); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { schemes.put(StandardScheme.class, new existsAll_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new existsAll_argsTupleSchemeFactory()); @@ -4287,18 +4478,16 @@ public class THBaseService { */ public List tgets; // required - /** - * The set of fields this struct contains, along with convenience methods for finding and manipulating them. - */ + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * the table to check on */ - TABLE((short) 1, "table"), + TABLE((short)1, "table"), /** * a list of TGets to check for */ - TGETS((short) 2, "tgets"); + TGETS((short)2, "tgets"); private static final Map byName = new HashMap(); @@ -4312,7 +4501,7 @@ public class THBaseService { * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { - switch (fieldId) { + switch(fieldId) { case 1: // TABLE return TABLE; case 2: // TGETS @@ -4358,14 +4547,13 @@ public class THBaseService { // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING, true))); - tmpMap.put(_Fields.TGETS, new org.apache.thrift.meta_data.FieldMetaData("tgets", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGet.class)))); + tmpMap.put(_Fields.TABLE, new org.apache.thrift.meta_data.FieldMetaData("table", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.TGETS, new org.apache.thrift.meta_data.FieldMetaData("tgets", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGet.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(existsAll_args.class, metaDataMap); } @@ -4374,10 +4562,11 @@ public class THBaseService { } public existsAll_args( - ByteBuffer table, - List tgets) { + ByteBuffer table, + List tgets) + { this(); - this.table = table; + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); this.tgets = tgets; } @@ -4387,10 +4576,9 @@ public class THBaseService { public existsAll_args(existsAll_args other) { if (other.isSetTable()) { this.table = org.apache.thrift.TBaseHelper.copyBinary(other.table); - ; } if (other.isSetTgets()) { - List __this__tgets = new ArrayList(); + List __this__tgets = new ArrayList(other.tgets.size()); for (TGet other_element : other.tgets) { __this__tgets.add(new TGet(other_element)); } @@ -4417,19 +4605,19 @@ public class THBaseService { } public ByteBuffer bufferForTable() { - return table; + return org.apache.thrift.TBaseHelper.copyBinary(table); } /** * the table to check on */ public existsAll_args setTable(byte[] table) { - setTable(table == null ? (ByteBuffer) null : ByteBuffer.wrap(table)); + this.table = table == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(table, table.length)); return this; } public existsAll_args setTable(ByteBuffer table) { - this.table = table; + this.table = org.apache.thrift.TBaseHelper.copyBinary(table); return this; } @@ -4437,9 +4625,7 @@ public class THBaseService { this.table = null; } - /** - * Returns true if field table is set (has been assigned a value) and false otherwise - */ + /** Returns true if field table is set (has been assigned a value) and false otherwise */ public boolean isSetTable() { return this.table != null; } @@ -4484,9 +4670,7 @@ public class THBaseService { this.tgets = null; } - /** - * Returns true if field tgets is set (has been assigned a value) and false otherwise - */ + /** Returns true if field tgets is set (has been assigned a value) and false otherwise */ public boolean isSetTgets() { return this.tgets != null; } @@ -4499,50 +4683,48 @@ public class THBaseService { public void setFieldValue(_Fields field, Object value) { switch (field) { - case TABLE: - if (value == null) { - unsetTable(); - } else { - setTable((ByteBuffer) value); - } - break; + case TABLE: + if (value == null) { + unsetTable(); + } else { + setTable((ByteBuffer)value); + } + break; - case TGETS: - if (value == null) { - unsetTgets(); - } else { - setTgets((List) value); - } - break; + case TGETS: + if (value == null) { + unsetTgets(); + } else { + setTgets((List)value); + } + break; } } public Object getFieldValue(_Fields field) { switch (field) { - case TABLE: - return getTable(); + case TABLE: + return getTable(); - case TGETS: - return getTgets(); + case TGETS: + return getTgets(); } throw new IllegalStateException(); } - /** - * Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise - */ + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { - case TABLE: - return isSetTable(); - case TGETS: - return isSetTgets(); + case TABLE: + return isSetTable(); + case TGETS: + return isSetTgets(); } throw new IllegalStateException(); } @@ -4552,7 +4734,7 @@ public class THBaseService { if (that == null) return false; if (that instanceof existsAll_args) - return this.equals((existsAll_args) that); + return this.equals((existsAll_args)that); return false; } @@ -4583,33 +4765,45 @@ public class THBaseService { @Override public int hashCode() { - return 0; + List list = new ArrayList(); + + boolean present_table = true && (isSetTable()); + list.add(present_table); + if (present_table) + list.add(table); + + boolean present_tgets = true && (isSetTgets()); + list.add(present_tgets); + if (present_tgets) + list.add(tgets); + + return list.hashCode(); } + @Override public int compareTo(existsAll_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - existsAll_args typedOther = (existsAll_args) other; - lastComparison = Boolean.valueOf(isSetTable()).compareTo(typedOther.isSetTable()); + lastComparison = Boolean.valueOf(isSetTable()).compareTo(other.isSetTable()); if (lastComparison != 0) { return lastComparison; } if (isSetTable()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, typedOther.table); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.table, other.table); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTgets()).compareTo(typedOther.isSetTgets()); + lastComparison = Boolean.valueOf(isSetTgets()).compareTo(other.isSetTgets()); if (lastComparison != 0) { return lastComparison; } if (isSetTgets()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tgets, typedOther.tgets); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tgets, other.tgets); if (lastComparison != 0) { return lastComparison; } @@ -4691,9 +4885,10 @@ public class THBaseService { public void read(org.apache.thrift.protocol.TProtocol iprot, existsAll_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); - while (true) { + while (true) + { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { @@ -4701,25 +4896,26 @@ public class THBaseService { if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.table = iprot.readBinary(); struct.setTableIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TGETS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list132 = iprot.readListBegin(); - struct.tgets = new ArrayList(_list132.size); - for (int _i133 = 0; _i133 < _list132.size; ++_i133) { - TGet _elem134; // required - _elem134 = new TGet(); - _elem134.read(iprot); - struct.tgets.add(_elem134); + org.apache.thrift.protocol.TList _list142 = iprot.readListBegin(); + struct.tgets = new ArrayList(_list142.size); + TGet _elem143; + for (int _i144 = 0; _i144 < _list142.size; ++_i144) + { + _elem143 = new TGet(); + _elem143.read(iprot); + struct.tgets.add(_elem143); } iprot.readListEnd(); } struct.setTgetsIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -4747,8 +4943,9 @@ public class THBaseService { oprot.writeFieldBegin(TGETS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tgets.size())); - for (TGet _iter135 : struct.tgets) { - _iter135.write(oprot); + for (TGet _iter145 : struct.tgets) + { + _iter145.write(oprot); } oprot.writeListEnd(); } @@ -4774,8 +4971,9 @@ public class THBaseService { oprot.writeBinary(struct.table); { oprot.writeI32(struct.tgets.size()); - for (TGet _iter136 : struct.tgets) { - _iter136.write(oprot); + for (TGet _iter146 : struct.tgets) + { + _iter146.write(oprot); } } } @@ -4786,13 +4984,14 @@ public class THBaseService { struct.table = iprot.readBinary(); struct.setTableIsSet(true); { - org.apache.thrift.protocol.TList _list137 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.tgets = new ArrayList(_list137.size); - for (int _i138 = 0; _i138 < _list137.size; ++_i138) { - TGet _elem139; // required - _elem139 = new TGet(); - _elem139.read(iprot); - struct.tgets.add(_elem139); + org.apache.thrift.protocol.TList _list147 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tgets = new ArrayList(_list147.size); + TGet _elem148; + for (int _i149 = 0; _i149 < _list147.size; ++_i149) + { + _elem148 = new TGet(); + _elem148.read(iprot); + struct.tgets.add(_elem148); } } struct.setTgetsIsSet(true); @@ -4801,14 +5000,13 @@ public class THBaseService { } - public static class existsAll_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + public static class existsAll_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("existsAll_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short) 0); - private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short) 1); + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + private static final org.apache.thrift.protocol.TField IO_FIELD_DESC = new org.apache.thrift.protocol.TField("io", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { schemes.put(StandardScheme.class, new existsAll_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new existsAll_resultTupleSchemeFactory()); @@ -4817,12 +5015,10 @@ public class THBaseService { public List success; // required public TIOError io; // required - /** - * The set of fields this struct contains, along with convenience methods for finding and manipulating them. - */ + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short) 0, "success"), - IO((short) 1, "io"); + SUCCESS((short)0, "success"), + IO((short)1, "io"); private static final Map byName = new HashMap(); @@ -4836,7 +5032,7 @@ public class THBaseService { * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { - switch (fieldId) { + switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // IO @@ -4882,14 +5078,13 @@ public class THBaseService { // isset id assignments public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); - tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); + tmpMap.put(_Fields.IO, new org.apache.thrift.meta_data.FieldMetaData("io", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(existsAll_result.class, metaDataMap); } @@ -4898,8 +5093,9 @@ public class THBaseService { } public existsAll_result( - List success, - TIOError io) { + List success, + TIOError io) + { this(); this.success = success; this.io = io; @@ -4910,10 +5106,7 @@ public class THBaseService { */ public existsAll_result(existsAll_result other) { if (other.isSetSuccess()) { - List __this__success = new ArrayList(); - for (Boolean other_element : other.success) { - __this__success.add(other_element); - } + List __this__success = new ArrayList(other.success); this.success = __this__success; } if (other.isSetIo()) { @@ -4959,9 +5152,7 @@ public class THBaseService { this.success = null; } - /** - * Returns true if field success is set (has been assigned a value) and false otherwise - */ + /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } @@ -4985,9 +5176,7 @@ public class THBaseService { this.io = null; } - /** - * Returns true if field io is set (has been assigned a value) and false otherwise - */ + /** Returns true if field io is set (has been assigned a value) and false otherwise */ public boolean isSetIo() { return this.io != null; } @@ -5000,50 +5189,48 @@ public class THBaseService { public void setFieldValue(_Fields field, Object value) { switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((List) value); - } - break; - - case IO: - if (value == null) { - unsetIo(); - } else { - setIo((TIOError) value); - } - break; - - } - } + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + case IO: + if (value == null) { + unsetIo(); + } else { + setIo((TIOError)value); + } + break; + + } + } public Object getFieldValue(_Fields field) { switch (field) { - case SUCCESS: - return getSuccess(); + case SUCCESS: + return getSuccess(); - case IO: - return getIo(); + case IO: + return getIo(); } throw new IllegalStateException(); } - /** - * Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise - */ + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { - case SUCCESS: - return isSetSuccess(); - case IO: - return isSetIo(); + case SUCCESS: + return isSetSuccess(); + case IO: + return isSetIo(); } throw new IllegalStateException(); } @@ -5053,7 +5240,7 @@ public class THBaseService { if (that == null) return false; if (that instanceof existsAll_result) - return this.equals((existsAll_result) that); + return this.equals((existsAll_result)that); return false; } @@ -5084,33 +5271,45 @@ public class THBaseService { @Override public int hashCode() { - return 0; + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_io = true && (isSetIo()); + list.add(present_io); + if (present_io) + list.add(io); + + return list.hashCode(); } + @Override public int compareTo(existsAll_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - existsAll_result typedOther = (existsAll_result) other; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetIo()).compareTo(typedOther.isSetIo()); + lastComparison = Boolean.valueOf(isSetIo()).compareTo(other.isSetIo()); if (lastComparison != 0) { return lastComparison; } if (isSetIo()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, typedOther.io); + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.io, other.io); if (lastComparison != 0) { return lastComparison; } @@ -5128,7 +5327,7 @@ public class THBaseService { public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } + } @Override public String toString() { @@ -5186,26 +5385,28 @@ public class THBaseService { public void read(org.apache.thrift.protocol.TProtocol iprot, existsAll_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); - while (true) { + while (true) + { schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list140 = iprot.readListBegin(); - struct.success = new ArrayList(_list140.size); - for (int _i141 = 0; _i141 < _list140.size; ++_i141) { - boolean _elem142; // required - _elem142 = iprot.readBool(); - struct.success.add(_elem142); + org.apache.thrift.protocol.TList _list150 = iprot.readListBegin(); + struct.success = new ArrayList(_list150.size); + boolean _elem151; + for (int _i152 = 0; _i152 < _list150.size; ++_i152) + { + _elem151 = iprot.readBool(); + struct.success.add(_elem151); } iprot.readListEnd(); } struct.setSuccessIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -5214,7 +5415,7 @@ public class THBaseService { struct.io = new TIOError(); struct.io.read(iprot); struct.setIoIsSet(true); - } else { + } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; @@ -5237,8 +5438,9 @@ public class THBaseService { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.success.size())); - for (boolean _iter143 : struct.success) { - oprot.writeBool(_iter143); + for (boolean _iter153 : struct.success) + { + oprot.writeBool(_iter153); } oprot.writeListEnd(); } @@ -5277,8 +5479,9 @@ public class THBaseService { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (boolean _iter144 : struct.success) { - oprot.writeBool(_iter144); + for (boolean _iter154 : struct.success) + { + oprot.writeBool(_iter154); } } } @@ -5293,12 +5496,13 @@ public class THBaseService { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list145 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); - struct.success = new ArrayList(_list145.size); - for (int _i146 = 0; _i146 < _list145.size; ++_i146) { - boolean _elem147; // required - _elem147 = iprot.readBool(); - struct.success.add(_elem147); + org.apache.thrift.protocol.TList _list155 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); + struct.success = new ArrayList(_list155.size); + boolean _elem156; + for (int _i157 = 0; _i157 < _list155.size; ++_i157) + { + _elem156 = iprot.readBool(); + struct.success.add(_elem156); } } struct.setSuccessIsSet(true); @@ -6734,14 +6938,14 @@ public class THBaseService { case 2: // TGETS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list132 = iprot.readListBegin(); - struct.tgets = new ArrayList(_list132.size); - TGet _elem133; - for (int _i134 = 0; _i134 < _list132.size; ++_i134) + org.apache.thrift.protocol.TList _list158 = iprot.readListBegin(); + struct.tgets = new ArrayList(_list158.size); + TGet _elem159; + for (int _i160 = 0; _i160 < _list158.size; ++_i160) { - _elem133 = new TGet(); - _elem133.read(iprot); - struct.tgets.add(_elem133); + _elem159 = new TGet(); + _elem159.read(iprot); + struct.tgets.add(_elem159); } iprot.readListEnd(); } @@ -6774,9 +6978,9 @@ public class THBaseService { oprot.writeFieldBegin(TGETS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tgets.size())); - for (TGet _iter135 : struct.tgets) + for (TGet _iter161 : struct.tgets) { - _iter135.write(oprot); + _iter161.write(oprot); } oprot.writeListEnd(); } @@ -6802,9 +7006,9 @@ public class THBaseService { oprot.writeBinary(struct.table); { oprot.writeI32(struct.tgets.size()); - for (TGet _iter136 : struct.tgets) + for (TGet _iter162 : struct.tgets) { - _iter136.write(oprot); + _iter162.write(oprot); } } } @@ -6815,14 +7019,14 @@ public class THBaseService { struct.table = iprot.readBinary(); struct.setTableIsSet(true); { - org.apache.thrift.protocol.TList _list137 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.tgets = new ArrayList(_list137.size); - TGet _elem138; - for (int _i139 = 0; _i139 < _list137.size; ++_i139) + org.apache.thrift.protocol.TList _list163 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tgets = new ArrayList(_list163.size); + TGet _elem164; + for (int _i165 = 0; _i165 < _list163.size; ++_i165) { - _elem138 = new TGet(); - _elem138.read(iprot); - struct.tgets.add(_elem138); + _elem164 = new TGet(); + _elem164.read(iprot); + struct.tgets.add(_elem164); } } struct.setTgetsIsSet(true); @@ -7229,14 +7433,14 @@ public class THBaseService { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list140 = iprot.readListBegin(); - struct.success = new ArrayList(_list140.size); - TResult _elem141; - for (int _i142 = 0; _i142 < _list140.size; ++_i142) + org.apache.thrift.protocol.TList _list166 = iprot.readListBegin(); + struct.success = new ArrayList(_list166.size); + TResult _elem167; + for (int _i168 = 0; _i168 < _list166.size; ++_i168) { - _elem141 = new TResult(); - _elem141.read(iprot); - struct.success.add(_elem141); + _elem167 = new TResult(); + _elem167.read(iprot); + struct.success.add(_elem167); } iprot.readListEnd(); } @@ -7273,9 +7477,9 @@ public class THBaseService { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (TResult _iter143 : struct.success) + for (TResult _iter169 : struct.success) { - _iter143.write(oprot); + _iter169.write(oprot); } oprot.writeListEnd(); } @@ -7314,9 +7518,9 @@ public class THBaseService { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (TResult _iter144 : struct.success) + for (TResult _iter170 : struct.success) { - _iter144.write(oprot); + _iter170.write(oprot); } } } @@ -7331,14 +7535,14 @@ public class THBaseService { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list145 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list145.size); - TResult _elem146; - for (int _i147 = 0; _i147 < _list145.size; ++_i147) + org.apache.thrift.protocol.TList _list171 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list171.size); + TResult _elem172; + for (int _i173 = 0; _i173 < _list171.size; ++_i173) { - _elem146 = new TResult(); - _elem146.read(iprot); - struct.success.add(_elem146); + _elem172 = new TResult(); + _elem172.read(iprot); + struct.success.add(_elem172); } } struct.setSuccessIsSet(true); @@ -10125,14 +10329,14 @@ public class THBaseService { case 2: // TPUTS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list148 = iprot.readListBegin(); - struct.tputs = new ArrayList(_list148.size); - TPut _elem149; - for (int _i150 = 0; _i150 < _list148.size; ++_i150) + org.apache.thrift.protocol.TList _list174 = iprot.readListBegin(); + struct.tputs = new ArrayList(_list174.size); + TPut _elem175; + for (int _i176 = 0; _i176 < _list174.size; ++_i176) { - _elem149 = new TPut(); - _elem149.read(iprot); - struct.tputs.add(_elem149); + _elem175 = new TPut(); + _elem175.read(iprot); + struct.tputs.add(_elem175); } iprot.readListEnd(); } @@ -10165,9 +10369,9 @@ public class THBaseService { oprot.writeFieldBegin(TPUTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tputs.size())); - for (TPut _iter151 : struct.tputs) + for (TPut _iter177 : struct.tputs) { - _iter151.write(oprot); + _iter177.write(oprot); } oprot.writeListEnd(); } @@ -10193,9 +10397,9 @@ public class THBaseService { oprot.writeBinary(struct.table); { oprot.writeI32(struct.tputs.size()); - for (TPut _iter152 : struct.tputs) + for (TPut _iter178 : struct.tputs) { - _iter152.write(oprot); + _iter178.write(oprot); } } } @@ -10206,14 +10410,14 @@ public class THBaseService { struct.table = iprot.readBinary(); struct.setTableIsSet(true); { - org.apache.thrift.protocol.TList _list153 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.tputs = new ArrayList(_list153.size); - TPut _elem154; - for (int _i155 = 0; _i155 < _list153.size; ++_i155) + org.apache.thrift.protocol.TList _list179 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tputs = new ArrayList(_list179.size); + TPut _elem180; + for (int _i181 = 0; _i181 < _list179.size; ++_i181) { - _elem154 = new TPut(); - _elem154.read(iprot); - struct.tputs.add(_elem154); + _elem180 = new TPut(); + _elem180.read(iprot); + struct.tputs.add(_elem180); } } struct.setTputsIsSet(true); @@ -11888,14 +12092,14 @@ public class THBaseService { case 2: // TDELETES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list156 = iprot.readListBegin(); - struct.tdeletes = new ArrayList(_list156.size); - TDelete _elem157; - for (int _i158 = 0; _i158 < _list156.size; ++_i158) + org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(); + struct.tdeletes = new ArrayList(_list182.size); + TDelete _elem183; + for (int _i184 = 0; _i184 < _list182.size; ++_i184) { - _elem157 = new TDelete(); - _elem157.read(iprot); - struct.tdeletes.add(_elem157); + _elem183 = new TDelete(); + _elem183.read(iprot); + struct.tdeletes.add(_elem183); } iprot.readListEnd(); } @@ -11928,9 +12132,9 @@ public class THBaseService { oprot.writeFieldBegin(TDELETES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tdeletes.size())); - for (TDelete _iter159 : struct.tdeletes) + for (TDelete _iter185 : struct.tdeletes) { - _iter159.write(oprot); + _iter185.write(oprot); } oprot.writeListEnd(); } @@ -11956,9 +12160,9 @@ public class THBaseService { oprot.writeBinary(struct.table); { oprot.writeI32(struct.tdeletes.size()); - for (TDelete _iter160 : struct.tdeletes) + for (TDelete _iter186 : struct.tdeletes) { - _iter160.write(oprot); + _iter186.write(oprot); } } } @@ -11969,14 +12173,14 @@ public class THBaseService { struct.table = iprot.readBinary(); struct.setTableIsSet(true); { - org.apache.thrift.protocol.TList _list161 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.tdeletes = new ArrayList(_list161.size); - TDelete _elem162; - for (int _i163 = 0; _i163 < _list161.size; ++_i163) + org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tdeletes = new ArrayList(_list187.size); + TDelete _elem188; + for (int _i189 = 0; _i189 < _list187.size; ++_i189) { - _elem162 = new TDelete(); - _elem162.read(iprot); - struct.tdeletes.add(_elem162); + _elem188 = new TDelete(); + _elem188.read(iprot); + struct.tdeletes.add(_elem188); } } struct.setTdeletesIsSet(true); @@ -12383,14 +12587,14 @@ public class THBaseService { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list164 = iprot.readListBegin(); - struct.success = new ArrayList(_list164.size); - TDelete _elem165; - for (int _i166 = 0; _i166 < _list164.size; ++_i166) + org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(); + struct.success = new ArrayList(_list190.size); + TDelete _elem191; + for (int _i192 = 0; _i192 < _list190.size; ++_i192) { - _elem165 = new TDelete(); - _elem165.read(iprot); - struct.success.add(_elem165); + _elem191 = new TDelete(); + _elem191.read(iprot); + struct.success.add(_elem191); } iprot.readListEnd(); } @@ -12427,9 +12631,9 @@ public class THBaseService { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (TDelete _iter167 : struct.success) + for (TDelete _iter193 : struct.success) { - _iter167.write(oprot); + _iter193.write(oprot); } oprot.writeListEnd(); } @@ -12468,9 +12672,9 @@ public class THBaseService { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (TDelete _iter168 : struct.success) + for (TDelete _iter194 : struct.success) { - _iter168.write(oprot); + _iter194.write(oprot); } } } @@ -12485,14 +12689,14 @@ public class THBaseService { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list169 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list169.size); - TDelete _elem170; - for (int _i171 = 0; _i171 < _list169.size; ++_i171) + org.apache.thrift.protocol.TList _list195 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list195.size); + TDelete _elem196; + for (int _i197 = 0; _i197 < _list195.size; ++_i197) { - _elem170 = new TDelete(); - _elem170.read(iprot); - struct.success.add(_elem170); + _elem196 = new TDelete(); + _elem196.read(iprot); + struct.success.add(_elem196); } } struct.setSuccessIsSet(true); @@ -17845,14 +18049,14 @@ public class THBaseService { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list172 = iprot.readListBegin(); - struct.success = new ArrayList(_list172.size); - TResult _elem173; - for (int _i174 = 0; _i174 < _list172.size; ++_i174) + org.apache.thrift.protocol.TList _list198 = iprot.readListBegin(); + struct.success = new ArrayList(_list198.size); + TResult _elem199; + for (int _i200 = 0; _i200 < _list198.size; ++_i200) { - _elem173 = new TResult(); - _elem173.read(iprot); - struct.success.add(_elem173); + _elem199 = new TResult(); + _elem199.read(iprot); + struct.success.add(_elem199); } iprot.readListEnd(); } @@ -17898,9 +18102,9 @@ public class THBaseService { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (TResult _iter175 : struct.success) + for (TResult _iter201 : struct.success) { - _iter175.write(oprot); + _iter201.write(oprot); } oprot.writeListEnd(); } @@ -17947,9 +18151,9 @@ public class THBaseService { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (TResult _iter176 : struct.success) + for (TResult _iter202 : struct.success) { - _iter176.write(oprot); + _iter202.write(oprot); } } } @@ -17967,14 +18171,14 @@ public class THBaseService { BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list177.size); - TResult _elem178; - for (int _i179 = 0; _i179 < _list177.size; ++_i179) + org.apache.thrift.protocol.TList _list203 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list203.size); + TResult _elem204; + for (int _i205 = 0; _i205 < _list203.size; ++_i205) { - _elem178 = new TResult(); - _elem178.read(iprot); - struct.success.add(_elem178); + _elem204 = new TResult(); + _elem204.read(iprot); + struct.success.add(_elem204); } } struct.setSuccessIsSet(true); @@ -20710,14 +20914,14 @@ public class THBaseService { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list180 = iprot.readListBegin(); - struct.success = new ArrayList(_list180.size); - TResult _elem181; - for (int _i182 = 0; _i182 < _list180.size; ++_i182) + org.apache.thrift.protocol.TList _list206 = iprot.readListBegin(); + struct.success = new ArrayList(_list206.size); + TResult _elem207; + for (int _i208 = 0; _i208 < _list206.size; ++_i208) { - _elem181 = new TResult(); - _elem181.read(iprot); - struct.success.add(_elem181); + _elem207 = new TResult(); + _elem207.read(iprot); + struct.success.add(_elem207); } iprot.readListEnd(); } @@ -20754,9 +20958,9 @@ public class THBaseService { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (TResult _iter183 : struct.success) + for (TResult _iter209 : struct.success) { - _iter183.write(oprot); + _iter209.write(oprot); } oprot.writeListEnd(); } @@ -20795,9 +20999,9 @@ public class THBaseService { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (TResult _iter184 : struct.success) + for (TResult _iter210 : struct.success) { - _iter184.write(oprot); + _iter210.write(oprot); } } } @@ -20812,14 +21016,14 @@ public class THBaseService { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list185 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list185.size); - TResult _elem186; - for (int _i187 = 0; _i187 < _list185.size; ++_i187) + org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list211.size); + TResult _elem212; + for (int _i213 = 0; _i213 < _list211.size; ++_i213) { - _elem186 = new TResult(); - _elem186.read(iprot); - struct.success.add(_elem186); + _elem212 = new TResult(); + _elem212.read(iprot); + struct.success.add(_elem212); } } struct.setSuccessIsSet(true); @@ -22650,14 +22854,14 @@ public class THBaseService { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list188 = iprot.readListBegin(); - struct.success = new ArrayList(_list188.size); - THRegionLocation _elem189; - for (int _i190 = 0; _i190 < _list188.size; ++_i190) + org.apache.thrift.protocol.TList _list214 = iprot.readListBegin(); + struct.success = new ArrayList(_list214.size); + THRegionLocation _elem215; + for (int _i216 = 0; _i216 < _list214.size; ++_i216) { - _elem189 = new THRegionLocation(); - _elem189.read(iprot); - struct.success.add(_elem189); + _elem215 = new THRegionLocation(); + _elem215.read(iprot); + struct.success.add(_elem215); } iprot.readListEnd(); } @@ -22694,9 +22898,9 @@ public class THBaseService { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (THRegionLocation _iter191 : struct.success) + for (THRegionLocation _iter217 : struct.success) { - _iter191.write(oprot); + _iter217.write(oprot); } oprot.writeListEnd(); } @@ -22735,9 +22939,9 @@ public class THBaseService { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (THRegionLocation _iter192 : struct.success) + for (THRegionLocation _iter218 : struct.success) { - _iter192.write(oprot); + _iter218.write(oprot); } } } @@ -22752,14 +22956,14 @@ public class THBaseService { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list193 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList(_list193.size); - THRegionLocation _elem194; - for (int _i195 = 0; _i195 < _list193.size; ++_i195) + org.apache.thrift.protocol.TList _list219 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list219.size); + THRegionLocation _elem220; + for (int _i221 = 0; _i221 < _list219.size; ++_i221) { - _elem194 = new THRegionLocation(); - _elem194.read(iprot); - struct.success.add(_elem194); + _elem220 = new THRegionLocation(); + _elem220.read(iprot); + struct.success.add(_elem220); } } struct.setSuccessIsSet(true); @@ -24360,4 +24564,629 @@ public class THBaseService { } + public static class getThriftServerType_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getThriftServerType_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getThriftServerType_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_args.class, metaDataMap); + } + + public getThriftServerType_args() { + } + + /** + * Performs a deep copy on other. + */ + public getThriftServerType_args(getThriftServerType_args other) { + } + + public getThriftServerType_args deepCopy() { + return new getThriftServerType_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getThriftServerType_args) + return this.equals((getThriftServerType_args)that); + return false; + } + + public boolean equals(getThriftServerType_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + return list.hashCode(); + } + + @Override + public int compareTo(getThriftServerType_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getThriftServerType_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getThriftServerType_argsStandardSchemeFactory implements SchemeFactory { + public getThriftServerType_argsStandardScheme getScheme() { + return new getThriftServerType_argsStandardScheme(); + } + } + + private static class getThriftServerType_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getThriftServerType_argsTupleSchemeFactory implements SchemeFactory { + public getThriftServerType_argsTupleScheme getScheme() { + return new getThriftServerType_argsTupleScheme(); + } + } + + private static class getThriftServerType_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getThriftServerType_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getThriftServerType_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getThriftServerType_resultTupleSchemeFactory()); + } + + /** + * + * @see TThriftServerType + */ + public TThriftServerType success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + /** + * + * @see TThriftServerType + */ + SUCCESS((short)0, "success"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TThriftServerType.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_result.class, metaDataMap); + } + + public getThriftServerType_result() { + } + + public getThriftServerType_result( + TThriftServerType success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public getThriftServerType_result(getThriftServerType_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public getThriftServerType_result deepCopy() { + return new getThriftServerType_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + /** + * + * @see TThriftServerType + */ + public TThriftServerType getSuccess() { + return this.success; + } + + /** + * + * @see TThriftServerType + */ + public getThriftServerType_result setSuccess(TThriftServerType success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TThriftServerType)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getThriftServerType_result) + return this.equals((getThriftServerType_result)that); + return false; + } + + public boolean equals(getThriftServerType_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(getThriftServerType_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("getThriftServerType_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class getThriftServerType_resultStandardSchemeFactory implements SchemeFactory { + public getThriftServerType_resultStandardScheme getScheme() { + return new getThriftServerType_resultStandardScheme(); + } + } + + private static class getThriftServerType_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = org.apache.hadoop.hbase.thrift2.generated.TThriftServerType.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getThriftServerType_resultTupleSchemeFactory implements SchemeFactory { + public getThriftServerType_resultTupleScheme getScheme() { + return new getThriftServerType_resultTupleScheme(); + } + } + + private static class getThriftServerType_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success.getValue()); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = org.apache.hadoop.hbase.thrift2.generated.TThriftServerType.findByValue(iprot.readI32()); + struct.setSuccessIsSet(true); + } + } + } + + } + } diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TThriftServerType.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TThriftServerType.java new file mode 100644 index 0000000000..6073204546 --- /dev/null +++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/TThriftServerType.java @@ -0,0 +1,48 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hbase.thrift2.generated; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +/** + * Specify type of thrift server: thrift and thrift2 + */ +public enum TThriftServerType implements org.apache.thrift.TEnum { + ONE(1), + TWO(2); + + private final int value; + + private TThriftServerType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TThriftServerType findByValue(int value) { + switch (value) { + case 1: + return ONE; + case 2: + return TWO; + default: + return null; + } + } +} diff --git a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp index 579d0f7d38..0b44722971 100644 --- a/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp +++ b/hbase-thrift/src/main/resources/hbase-webapps/thrift/thrift.jsp @@ -26,6 +26,7 @@ <% Configuration conf = (Configuration)getServletContext().getAttribute("hbase.conf"); +String serverType = (String)getServletContext().getAttribute("hbase.thrift.type"); long startcode = conf.getLong("startcode", System.currentTimeMillis()); String listenPort = conf.get("hbase.regionserver.thrift.port", "9090"); String serverInfo = listenPort + "," + String.valueOf(startcode); @@ -119,6 +120,11 @@ String framed = conf.get("hbase.regionserver.thrift.framed", "false"); <%= framed %> Thrift RPC engine uses framed transport + + Thrift Server Type + <%= serverType %> + The type of this Thrift server + diff --git a/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift b/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift index 13faa8e7c4..91ed9dae0e 100644 --- a/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift +++ b/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift @@ -192,6 +192,14 @@ exception AlreadyExists { 1:string message } +/** + * Specify type of thrift server: thrift and thrift2 + */ +enum TThriftServerType { + ONE = 1, + TWO = 2 +} + // // Service // @@ -957,4 +965,11 @@ service Hbase { /** Mutation attributes */ 7:map attributes ) throws (1:IOError io, 2:IllegalArgument ia) + + /** + * Get the type of this thrift server. + * + * @return the type of this thrift server + */ + TThriftServerType getThriftServerType() } diff --git a/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift b/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift index 8c5ef59917..14afcb1f60 100644 --- a/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift +++ b/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift2/hbase.thrift @@ -311,6 +311,14 @@ exception TIllegalArgument { 1: optional string message } +/** + * Specify type of thrift server: thrift and thrift2 + */ +enum TThriftServerType { + ONE = 1, + TWO = 2 +} + service THBaseService { /** @@ -628,4 +636,11 @@ service THBaseService { /** row mutations to execute if the value matches */ 7: required TRowMutations rowMutations ) throws (1: TIOError io) + + /** + * Get the type of this thrift server. + * + * @return the type of this thrift server + */ + TThriftServerType getThriftServerType() } diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java new file mode 100644 index 0000000000..026eebfa47 --- /dev/null +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/HBaseThriftTestingUtility.java @@ -0,0 +1,79 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.thrift; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class HBaseThriftTestingUtility { + + private static final Logger LOG = LoggerFactory.getLogger(HBaseThriftTestingUtility.class); + private Thread thriftServerOneThread; + private volatile Exception thriftServerOneException; + private ThriftServer thriftServer; + private int testServerPort; + + public int getServerPort() { + return testServerPort; + } + + public void startThriftServer(Configuration conf) throws Exception { + List args = new ArrayList<>(); + testServerPort = HBaseTestingUtility.randomFreePort(); + args.add("-" + ThriftServer.PORT_OPTION); + args.add(String.valueOf(testServerPort)); + thriftServer = new ThriftServer(conf); + LOG.info("Starting Thrift Server One on port: " + testServerPort); + + thriftServerOneException = null; + thriftServerOneThread = new Thread(() -> { + try { + thriftServer.doMain(args.toArray(new String[args.size()])); + } catch (Exception e) { + thriftServerOneException = e; + } + }); + thriftServerOneThread.setName(ThriftServer.class.getSimpleName() + "-one"); + thriftServerOneThread.start(); + + if (thriftServerOneException != null) { + LOG.error("HBase Thrift server threw an exception ", thriftServerOneException); + throw new Exception(thriftServerOneException); + } + + // wait up to 10s for the server to start + for (int i = 0; i < 100 + && (thriftServer.serverRunner == null || thriftServer.serverRunner.tserver == null); i++) { + Thread.sleep(100); + } + + LOG.info("Started Thrift Server One on port " + testServerPort); + } + + public void stopThriftServer() throws Exception{ + LOG.debug("Stopping Thrift Server One"); + thriftServer.stop(); + thriftServerOneThread.join(); + } +} diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java index 05dc2aeaeb..305335fcc1 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftServer.java @@ -24,12 +24,14 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.IOException; +import java.net.InetAddress; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; + import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.CompatibilityFactory; import org.apache.hadoop.hbase.HBaseClassTestRule; @@ -58,8 +60,15 @@ import org.apache.hadoop.hbase.thrift.generated.TIncrement; import org.apache.hadoop.hbase.thrift.generated.TRegionInfo; import org.apache.hadoop.hbase.thrift.generated.TRowResult; import org.apache.hadoop.hbase.thrift.generated.TScan; +import org.apache.hadoop.hbase.thrift.generated.TThriftServerType; +import org.apache.hadoop.hbase.thrift2.HBaseThrift2TestingUtility; +import org.apache.hadoop.hbase.thrift2.generated.THBaseService; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.Threads; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; @@ -870,4 +879,32 @@ public class TestThriftServer { handler.scannerGet(scannerId); handler.scannerClose(scannerId); } + + @Test + public void testGetThriftServerType() throws Exception { + ThriftServerRunner.HBaseHandler handler = + new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(), + UserProvider.instantiate(UTIL.getConfiguration())); + assertEquals(TThriftServerType.ONE, handler.getThriftServerType()); + } + + @Test + public void testGetThriftServerOneType() throws Exception { + + HBaseThrift2TestingUtility THRIFT2_TEST_UTIL = + new HBaseThrift2TestingUtility(); + + LOG.info("Starting HBase Thrift Server Two"); + THRIFT2_TEST_UTIL.startThriftServer(UTIL.getConfiguration()); + try (TTransport transport = new TSocket(InetAddress.getLocalHost().getHostName(), + THRIFT2_TEST_UTIL.getServerPort())){ + TProtocol protocol = new TBinaryProtocol(transport); + // This is our thrift client. + Hbase.Client client = new Hbase.Client(protocol); + // open the transport + transport.open(); + assertEquals(TThriftServerType.TWO.name(), client.getThriftServerType().name()); + } + THRIFT2_TEST_UTIL.stopThriftServer(); + } } diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/HBaseThrift2TestingUtility.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/HBaseThrift2TestingUtility.java new file mode 100644 index 0000000000..3547daff87 --- /dev/null +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/HBaseThrift2TestingUtility.java @@ -0,0 +1,70 @@ +/** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.thrift2; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class HBaseThrift2TestingUtility { + + private static final Logger LOG = LoggerFactory.getLogger(HBaseThrift2TestingUtility.class); + private Thread thriftServerTwoThread; + private volatile Exception thriftServerTwoException; + private int testServerPort; + private ThriftServer thriftServer; + public int getServerPort() { + return testServerPort; + } + + public void startThriftServer(Configuration conf) throws Exception { + testServerPort = HBaseTestingUtility.randomFreePort(); + LOG.info("Starting Thrift Server Two on port: " + testServerPort); + thriftServer = new ThriftServer(conf); + thriftServerTwoException = null; + thriftServerTwoThread = new Thread(() -> { + try { + thriftServer.run(new String[]{"-p", String.valueOf(testServerPort)}); + } catch (Exception e) { + thriftServerTwoException = e; + } + }); + thriftServerTwoThread.setName(ThriftServer.class.getSimpleName() + "-two"); + thriftServerTwoThread.start(); + + if (thriftServerTwoException != null) { + LOG.error("HBase Thrift server Two threw an exception ", thriftServerTwoException); + throw new Exception(thriftServerTwoException); + } + + // wait up to 10s for the server to start + for (int i = 0; i < 100 && (thriftServer.tServer == null); i++) { + Thread.sleep(100); + } + + LOG.info("Started Thrift Server Two on port " + testServerPort); + } + + public void stopThriftServer() throws Exception{ + LOG.debug("Stopping Thrift Server Two"); + thriftServer.stop(); + thriftServerTwoThread.join(); + } +} diff --git a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java index 3653ce5ffe..777438cc23 100644 --- a/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java +++ b/hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift2/TestThriftHBaseServiceHandler.java @@ -32,6 +32,7 @@ import static org.junit.Assert.fail; import java.io.IOException; import java.io.InterruptedIOException; +import java.net.InetAddress; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; @@ -69,6 +70,7 @@ import org.apache.hadoop.hbase.test.MetricsAssertHelper; import org.apache.hadoop.hbase.testclassification.ClientTests; import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.thrift.ErrorThrowingGetObserver; +import org.apache.hadoop.hbase.thrift.HBaseThriftTestingUtility; import org.apache.hadoop.hbase.thrift.ThriftMetrics; import org.apache.hadoop.hbase.thrift2.generated.TAppend; import org.apache.hadoop.hbase.thrift2.generated.TColumn; @@ -89,9 +91,14 @@ import org.apache.hadoop.hbase.thrift2.generated.TReadType; import org.apache.hadoop.hbase.thrift2.generated.TResult; import org.apache.hadoop.hbase.thrift2.generated.TRowMutations; import org.apache.hadoop.hbase.thrift2.generated.TScan; +import org.apache.hadoop.hbase.thrift2.generated.TThriftServerType; import org.apache.hadoop.hbase.thrift2.generated.TTimeRange; import org.apache.hadoop.hbase.util.Bytes; import org.apache.thrift.TException; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; @@ -1559,6 +1566,32 @@ public class TestThriftHBaseServiceHandler { assertTColumnValueEqual(columnValueB, result.getColumnValues().get(1)); } + @Test + public void testGetThriftServerType() throws Exception { + ThriftHBaseServiceHandler handler = createHandler(); + assertEquals(TThriftServerType.TWO, handler.getThriftServerType()); + } + + @Test + public void testGetThriftServerOneType() throws Exception { + + HBaseThriftTestingUtility THRIFT_TEST_UTIL = + new HBaseThriftTestingUtility(); + + LOG.info("Starting HBase Thrift server One"); + THRIFT_TEST_UTIL.startThriftServer(UTIL.getConfiguration()); + try (TTransport transport = new TSocket(InetAddress.getLocalHost().getHostName(), + THRIFT_TEST_UTIL.getServerPort())){ + TProtocol protocol = new TBinaryProtocol(transport); + // This is our thrift2 client. + THBaseService.Iface client = new THBaseService.Client(protocol); + // open the transport + transport.open(); + assertEquals(TThriftServerType.ONE.name(), client.getThriftServerType().name()); + } + THRIFT_TEST_UTIL.stopThriftServer(); + } + public static class DelayingRegionObserver implements RegionCoprocessor, RegionObserver { private static final Logger LOG = LoggerFactory.getLogger(DelayingRegionObserver.class); // sleep time in msec diff --git a/src/main/asciidoc/_chapters/thrift_filter_language.adoc b/src/main/asciidoc/_chapters/thrift_filter_language.adoc index 1c1279de88..890c7d3644 100644 --- a/src/main/asciidoc/_chapters/thrift_filter_language.adoc +++ b/src/main/asciidoc/_chapters/thrift_filter_language.adoc @@ -34,6 +34,10 @@ The Thrift API relies on client and server processes. You can configure Thrift for secure authentication at the server and client side, by following the procedures in <> and <>. +Go to http://localhost:9095/thrift.jsp to view the Thrift Server Web UI. +The homepage of this Thrift Server shows some important information, +such as Thrift Server Type/Thrift Impl Type/Thrift Server Start Time etc. + The rest of this chapter discusses the filter language provided by the Thrift API. [[thrift.filter_language]] -- 2.13.0