Pārlūkot izejas kodu

HUE-8782 [hbase] Support Python 3 in Thrift bindings

Romain Rigaux 6 gadi atpakaļ
vecāks
revīzija
737535205e

+ 103 - 97
apps/hbase/gen-py/hbased/Hbase-remote

@@ -1,10 +1,10 @@
 #!/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
 #
-#  options string: py
+#  options string: py:new_style
 #
 
 import sys
@@ -12,61 +12,62 @@ 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 hbased import Hbase
+from hbased.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('   getRowOrBefore(Text tableName, Text row, Text family)')
+  print('  TRegionInfo getRegionInfo(Text row)')
+  print('')
   sys.exit(0)
 
 pp = pprint.PrettyPrinter(indent = 2)
@@ -74,6 +75,7 @@ host = 'localhost'
 port = 9090
 uri = ''
 framed = False
+ssl = False
 http = False
 argi = 1
 
@@ -102,13 +104,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 +125,264 @@ 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'
+    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]),))
 
 else:
-  print 'Unrecognized method %s' % cmd
+  print('Unrecognized method %s' % cmd)
   sys.exit(1)
 
 transport.close()

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 232 - 271
apps/hbase/gen-py/hbased/Hbase.py


+ 2 - 2
apps/hbase/gen-py/hbased/constants.py

@@ -1,9 +1,9 @@
 #
-# 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
 #
-#  options string: py
+#  options string: py:new_style
 #
 
 from thrift.Thrift import TType, TMessageType, TException, TApplicationException

+ 134 - 50
apps/hbase/gen-py/hbased/ttypes.py

@@ -1,9 +1,9 @@
 #
-# 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
 #
-#  options string: py
+#  options string: py:new_style
 #
 
 from thrift.Thrift import TType, TMessageType, TException, TApplicationException
@@ -17,7 +17,7 @@ except:
 
 
 
-class TCell:
+class TCell(object):
   """
   TCell - Used to transport a cell value (byte[]) and the timestamp it was
   stored with together as a result for get and getRow methods. This promotes
@@ -50,12 +50,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 +83,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()]
@@ -94,7 +100,7 @@ class TCell:
   def __ne__(self, other):
     return not (self == other)
 
-class ColumnDescriptor:
+class ColumnDescriptor(object):
   """
   An HColumnDescriptor contains information about a column family
   such as the number of versions, compression settings, etc. It is
@@ -147,47 +153,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 +249,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()]
@@ -254,7 +273,7 @@ class ColumnDescriptor:
   def __ne__(self, other):
     return not (self == other)
 
-class TRegionInfo:
+class TRegionInfo(object):
   """
   A TRegionInfo contains information about an HTable region.
 
@@ -299,37 +318,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 +396,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()]
@@ -388,7 +418,7 @@ class TRegionInfo:
   def __ne__(self, other):
     return not (self == other)
 
-class Mutation:
+class Mutation(object):
   """
   A Mutation object is used to either update or delete a column-value.
 
@@ -424,22 +454,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 +505,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()]
@@ -486,7 +524,7 @@ class Mutation:
   def __ne__(self, other):
     return not (self == other)
 
-class BatchMutation:
+class BatchMutation(object):
   """
   A BatchMutation object is used to apply a number of Mutations to a single row.
 
@@ -516,7 +554,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 +596,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()]
@@ -569,7 +613,7 @@ class BatchMutation:
   def __ne__(self, other):
     return not (self == other)
 
-class TIncrement:
+class TIncrement(object):
   """
   For increments that are not incrementColumnValue
   equivalents.
@@ -606,22 +650,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 +701,14 @@ 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()]
@@ -668,7 +720,7 @@ class TIncrement:
   def __ne__(self, other):
     return not (self == other)
 
-class TRowResult:
+class TRowResult(object):
   """
   Holds row name and then a map of columns to cells.
 
@@ -698,15 +750,15 @@ 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
@@ -742,6 +794,12 @@ class TRowResult:
     return
 
 
+  def __hash__(self):
+    value = 17
+    value = (value * 31) ^ hash(self.row)
+    value = (value * 31) ^ hash(self.columns)
+    return value
+
   def __repr__(self):
     L = ['%s=%r' % (key, value)
       for key, value in self.__dict__.iteritems()]
@@ -753,7 +811,7 @@ class TRowResult:
   def __ne__(self, other):
     return not (self == other)
 
-class TScan:
+class TScan(object):
   """
   A Scan object is used to specify scanner parameters when opening a scanner.
 
@@ -798,17 +856,17 @@ 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:
@@ -816,24 +874,24 @@ class TScan:
           self.columns = []
           (_etype19, _size16) = iprot.readListBegin()
           for _i20 in xrange(_size16):
-            _elem21 = iprot.readString();
+            _elem21 = iprot.readString()
             self.columns.append(_elem21)
           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();
+          self.batchSize = iprot.readI32()
         else:
           iprot.skip(ftype)
       else:
@@ -884,6 +942,17 @@ 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)
+    return value
+
   def __repr__(self):
     L = ['%s=%r' % (key, value)
       for key, value in self.__dict__.iteritems()]
@@ -924,7 +993,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:
@@ -951,6 +1020,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()]
@@ -990,7 +1064,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:
@@ -1017,6 +1091,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()]
@@ -1056,7 +1135,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:
@@ -1083,6 +1162,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()]

+ 0 - 0
apps/hbase/regenerate_thrift.sh


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels