You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2017/07/03 16:25:28 UTC
[2/3] hbase git commit: HBASE-18291 Regenerate thrift2 python examples
http://git-wip-us.apache.org/repos/asf/hbase/blob/61534931/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.py
----------------------------------------------------------------------
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 405a8de..da8f4a3 100644
--- a/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.py
+++ b/hbase-examples/src/main/python/thrift2/gen-py/hbase/THBaseService.py
@@ -1,5 +1,5 @@
#
-# Autogenerated by Thrift Compiler (0.9.0)
+# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
@@ -7,6 +7,7 @@
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
+import logging
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
@@ -18,7 +19,7 @@ except:
class Iface:
- def exists(self, table, get):
+ def exists(self, table, tget):
"""
Test for the existence of columns in the table, as specified in the TGet.
@@ -26,11 +27,24 @@ class Iface:
Parameters:
- table: the table to check on
- - get: the TGet to check for
+ - tget: the TGet to check for
"""
pass
- def get(self, table, get):
+ def existsAll(self, table, tgets):
+ """
+ Test for the existence of columns in the table, as specified by the TGets.
+
+ This will return an array of booleans. Each value will be true if the related Get matches
+ one or more keys, false if not.
+
+ Parameters:
+ - table: the table to check on
+ - tgets: a list of TGets to check for
+ """
+ pass
+
+ def get(self, table, tget):
"""
Method for getting data from a row.
@@ -41,11 +55,11 @@ class Iface:
Parameters:
- table: the table to get from
- - get: the TGet to fetch
+ - tget: the TGet to fetch
"""
pass
- def getMultiple(self, table, gets):
+ def getMultiple(self, table, tgets):
"""
Method for getting multiple rows.
@@ -57,23 +71,23 @@ class Iface:
Parameters:
- table: the table to get from
- - gets: a list of TGets to fetch, the Result list
+ - tgets: a list of TGets to fetch, the Result list
will have the Results at corresponding positions
or null if there was an error
"""
pass
- def put(self, table, put):
+ def put(self, table, tput):
"""
Commit a TPut to a table.
Parameters:
- table: the table to put data in
- - put: the TPut to put
+ - tput: the TPut to put
"""
pass
- def checkAndPut(self, table, row, family, qualifier, value, put):
+ def checkAndPut(self, table, row, family, qualifier, value, tput):
"""
Atomically checks if a row/family/qualifier value matches the expected
value. If it does, it adds the TPut.
@@ -88,21 +102,21 @@ class Iface:
- value: the expected value, if not provided the
check is for the non-existence of the
column in question
- - put: the TPut to put if the check succeeds
+ - tput: the TPut to put if the check succeeds
"""
pass
- def putMultiple(self, table, puts):
+ def putMultiple(self, table, tputs):
"""
Commit a List of Puts to the table.
Parameters:
- table: the table to put data in
- - puts: a list of TPuts to commit
+ - tputs: a list of TPuts to commit
"""
pass
- def deleteSingle(self, table, deleteSingle):
+ def deleteSingle(self, table, tdelete):
"""
Deletes as specified by the TDelete.
@@ -111,11 +125,11 @@ class Iface:
Parameters:
- table: the table to delete from
- - deleteSingle: the TDelete to delete
+ - tdelete: the TDelete to delete
"""
pass
- def deleteMultiple(self, table, deletes):
+ def deleteMultiple(self, table, tdeletes):
"""
Bulk commit a List of TDeletes to the table.
@@ -125,11 +139,11 @@ class Iface:
Parameters:
- table: the table to delete from
- - deletes: list of TDeletes to delete
+ - tdeletes: list of TDeletes to delete
"""
pass
- def checkAndDelete(self, table, row, family, qualifier, value, deleteSingle):
+ def checkAndDelete(self, table, row, family, qualifier, value, tdelete):
"""
Atomically checks if a row/family/qualifier value matches the expected
value. If it does, it adds the delete.
@@ -144,19 +158,27 @@ class Iface:
- value: the expected value, if not provided the
check is for the non-existence of the
column in question
- - deleteSingle: the TDelete to execute if the check succeeds
+ - tdelete: the TDelete to execute if the check succeeds
"""
pass
- def increment(self, table, increment):
+ def increment(self, table, tincrement):
"""
Parameters:
- table: the table to increment the value on
- - increment: the TIncrement to increment
+ - tincrement: the TIncrement to increment
"""
pass
- def openScanner(self, table, scan):
+ def append(self, table, tappend):
+ """
+ Parameters:
+ - table: the table to append the value on
+ - tappend: the TAppend to append
+ """
+ pass
+
+ def openScanner(self, table, tscan):
"""
Get a Scanner for the provided TScan object.
@@ -164,7 +186,7 @@ class Iface:
Parameters:
- table: the table to get the Scanner for
- - scan: the scan object to get a Scanner for
+ - tscan: the scan object to get a Scanner for
"""
pass
@@ -182,16 +204,83 @@ class Iface:
def closeScanner(self, scannerId):
"""
- Closes the scanner. Should be called if you need to close
- the Scanner before all results are read.
-
- Exhausted scanners are closed automatically.
+ Closes the scanner. Should be called to free server side resources timely.
+ Typically close once the scanner is not needed anymore, i.e. after looping
+ over it to get all the required rows.
Parameters:
- scannerId: the Id of the Scanner to close *
"""
pass
+ def mutateRow(self, table, trowMutations):
+ """
+ mutateRow performs multiple mutations atomically on a single row.
+
+ Parameters:
+ - table: table to apply the mutations
+ - trowMutations: mutations to apply
+ """
+ pass
+
+ def getScannerResults(self, table, tscan, numRows):
+ """
+ Get results for the provided TScan object.
+ This helper function opens a scanner, get the results and close the scanner.
+
+ @return between zero and numRows TResults
+
+ Parameters:
+ - table: the table to get the Scanner for
+ - tscan: the scan object to get a Scanner for
+ - numRows: number of rows to return
+ """
+ pass
+
+ def getRegionLocation(self, table, row, reload):
+ """
+ Given a table and a row get the location of the region that
+ would contain the given row key.
+
+ reload = true means the cache will be cleared and the location
+ will be fetched from meta.
+
+ Parameters:
+ - table
+ - row
+ - reload
+ """
+ pass
+
+ def getAllRegionLocations(self, table):
+ """
+ Get all of the region locations for a given table.
+
+
+ Parameters:
+ - table
+ """
+ pass
+
+ def checkAndMutate(self, table, row, family, qualifier, compareOp, value, rowMutations):
+ """
+ Atomically checks if a row/family/qualifier value matches the expected
+ value. If it does, it mutates the row.
+
+ @return true if the row was mutated, false otherwise
+
+ Parameters:
+ - table: to check in and delete from
+ - row: row to check
+ - family: column family to check
+ - qualifier: column qualifier to check
+ - compareOp: comparison to make on the value
+ - value: the expected value to be compared against, if not provided the
+ check is for the non-existence of the column in question
+ - rowMutations: row mutations to execute if the value matches
+ """
+ pass
+
class Client(Iface):
def __init__(self, iprot, oprot=None):
@@ -200,7 +289,7 @@ class Client(Iface):
self._oprot = oprot
self._seqid = 0
- def exists(self, table, get):
+ def exists(self, table, tget):
"""
Test for the existence of columns in the table, as specified in the TGet.
@@ -208,37 +297,78 @@ class Client(Iface):
Parameters:
- table: the table to check on
- - get: the TGet to check for
+ - tget: the TGet to check for
"""
- self.send_exists(table, get)
+ self.send_exists(table, tget)
return self.recv_exists()
- def send_exists(self, table, get):
+ def send_exists(self, table, tget):
self._oprot.writeMessageBegin('exists', TMessageType.CALL, self._seqid)
args = exists_args()
args.table = table
- args.get = get
+ args.tget = tget
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_exists(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_exists(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = exists_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.io is not None:
+ raise result.io
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "exists failed: unknown result")
+
+ def existsAll(self, table, tgets):
+ """
+ Test for the existence of columns in the table, as specified by the TGets.
+
+ This will return an array of booleans. Each value will be true if the related Get matches
+ one or more keys, false if not.
+
+ Parameters:
+ - table: the table to check on
+ - tgets: a list of TGets to check for
+ """
+ self.send_existsAll(table, tgets)
+ return self.recv_existsAll()
+
+ def send_existsAll(self, table, tgets):
+ self._oprot.writeMessageBegin('existsAll', TMessageType.CALL, self._seqid)
+ args = existsAll_args()
+ args.table = table
+ args.tgets = tgets
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_existsAll(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = existsAll_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "exists failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "existsAll failed: unknown result")
- def get(self, table, get):
+ def get(self, table, tget):
"""
Method for getting data from a row.
@@ -249,37 +379,38 @@ class Client(Iface):
Parameters:
- table: the table to get from
- - get: the TGet to fetch
+ - tget: the TGet to fetch
"""
- self.send_get(table, get)
+ self.send_get(table, tget)
return self.recv_get()
- def send_get(self, table, get):
+ def send_get(self, table, tget):
self._oprot.writeMessageBegin('get', TMessageType.CALL, self._seqid)
args = get_args()
args.table = table
- args.get = get
+ args.tget = tget
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_get(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_get(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = get_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "get failed: unknown result")
- def getMultiple(self, table, gets):
+ def getMultiple(self, table, tgets):
"""
Method for getting multiple rows.
@@ -291,73 +422,75 @@ class Client(Iface):
Parameters:
- table: the table to get from
- - gets: a list of TGets to fetch, the Result list
+ - tgets: a list of TGets to fetch, the Result list
will have the Results at corresponding positions
or null if there was an error
"""
- self.send_getMultiple(table, gets)
+ self.send_getMultiple(table, tgets)
return self.recv_getMultiple()
- def send_getMultiple(self, table, gets):
+ def send_getMultiple(self, table, tgets):
self._oprot.writeMessageBegin('getMultiple', TMessageType.CALL, self._seqid)
args = getMultiple_args()
args.table = table
- args.gets = gets
+ args.tgets = tgets
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_getMultiple(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_getMultiple(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = getMultiple_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getMultiple failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getMultiple failed: unknown result")
- def put(self, table, put):
+ def put(self, table, tput):
"""
Commit a TPut to a table.
Parameters:
- table: the table to put data in
- - put: the TPut to put
+ - tput: the TPut to put
"""
- self.send_put(table, put)
+ self.send_put(table, tput)
self.recv_put()
- def send_put(self, table, put):
+ def send_put(self, table, tput):
self._oprot.writeMessageBegin('put', TMessageType.CALL, self._seqid)
args = put_args()
args.table = table
- args.put = put
+ args.tput = tput
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_put(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_put(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = put_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.io is not None:
raise result.io
return
- def checkAndPut(self, table, row, family, qualifier, value, put):
+ def checkAndPut(self, table, row, family, qualifier, value, tput):
"""
Atomically checks if a row/family/qualifier value matches the expected
value. If it does, it adds the TPut.
@@ -372,12 +505,12 @@ class Client(Iface):
- value: the expected value, if not provided the
check is for the non-existence of the
column in question
- - put: the TPut to put if the check succeeds
+ - tput: the TPut to put if the check succeeds
"""
- self.send_checkAndPut(table, row, family, qualifier, value, put)
+ self.send_checkAndPut(table, row, family, qualifier, value, tput)
return self.recv_checkAndPut()
- def send_checkAndPut(self, table, row, family, qualifier, value, put):
+ def send_checkAndPut(self, table, row, family, qualifier, value, tput):
self._oprot.writeMessageBegin('checkAndPut', TMessageType.CALL, self._seqid)
args = checkAndPut_args()
args.table = table
@@ -385,62 +518,64 @@ class Client(Iface):
args.family = family
args.qualifier = qualifier
args.value = value
- args.put = put
+ args.tput = tput
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_checkAndPut(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_checkAndPut(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = checkAndPut_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result")
- def putMultiple(self, table, puts):
+ def putMultiple(self, table, tputs):
"""
Commit a List of Puts to the table.
Parameters:
- table: the table to put data in
- - puts: a list of TPuts to commit
+ - tputs: a list of TPuts to commit
"""
- self.send_putMultiple(table, puts)
+ self.send_putMultiple(table, tputs)
self.recv_putMultiple()
- def send_putMultiple(self, table, puts):
+ def send_putMultiple(self, table, tputs):
self._oprot.writeMessageBegin('putMultiple', TMessageType.CALL, self._seqid)
args = putMultiple_args()
args.table = table
- args.puts = puts
+ args.tputs = tputs
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_putMultiple(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_putMultiple(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = putMultiple_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.io is not None:
raise result.io
return
- def deleteSingle(self, table, deleteSingle):
+ def deleteSingle(self, table, tdelete):
"""
Deletes as specified by the TDelete.
@@ -449,35 +584,36 @@ class Client(Iface):
Parameters:
- table: the table to delete from
- - deleteSingle: the TDelete to delete
+ - tdelete: the TDelete to delete
"""
- self.send_deleteSingle(table, deleteSingle)
+ self.send_deleteSingle(table, tdelete)
self.recv_deleteSingle()
- def send_deleteSingle(self, table, deleteSingle):
+ def send_deleteSingle(self, table, tdelete):
self._oprot.writeMessageBegin('deleteSingle', TMessageType.CALL, self._seqid)
args = deleteSingle_args()
args.table = table
- args.deleteSingle = deleteSingle
+ args.tdelete = tdelete
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_deleteSingle(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_deleteSingle(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = deleteSingle_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.io is not None:
raise result.io
return
- def deleteMultiple(self, table, deletes):
+ def deleteMultiple(self, table, tdeletes):
"""
Bulk commit a List of TDeletes to the table.
@@ -487,37 +623,38 @@ class Client(Iface):
Parameters:
- table: the table to delete from
- - deletes: list of TDeletes to delete
+ - tdeletes: list of TDeletes to delete
"""
- self.send_deleteMultiple(table, deletes)
+ self.send_deleteMultiple(table, tdeletes)
return self.recv_deleteMultiple()
- def send_deleteMultiple(self, table, deletes):
+ def send_deleteMultiple(self, table, tdeletes):
self._oprot.writeMessageBegin('deleteMultiple', TMessageType.CALL, self._seqid)
args = deleteMultiple_args()
args.table = table
- args.deletes = deletes
+ args.tdeletes = tdeletes
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_deleteMultiple(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_deleteMultiple(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = deleteMultiple_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteMultiple failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "deleteMultiple failed: unknown result")
- def checkAndDelete(self, table, row, family, qualifier, value, deleteSingle):
+ def checkAndDelete(self, table, row, family, qualifier, value, tdelete):
"""
Atomically checks if a row/family/qualifier value matches the expected
value. If it does, it adds the delete.
@@ -532,12 +669,12 @@ class Client(Iface):
- value: the expected value, if not provided the
check is for the non-existence of the
column in question
- - deleteSingle: the TDelete to execute if the check succeeds
+ - tdelete: the TDelete to execute if the check succeeds
"""
- self.send_checkAndDelete(table, row, family, qualifier, value, deleteSingle)
+ self.send_checkAndDelete(table, row, family, qualifier, value, tdelete)
return self.recv_checkAndDelete()
- def send_checkAndDelete(self, table, row, family, qualifier, value, deleteSingle):
+ def send_checkAndDelete(self, table, row, family, qualifier, value, tdelete):
self._oprot.writeMessageBegin('checkAndDelete', TMessageType.CALL, self._seqid)
args = checkAndDelete_args()
args.table = table
@@ -545,62 +682,99 @@ class Client(Iface):
args.family = family
args.qualifier = qualifier
args.value = value
- args.deleteSingle = deleteSingle
+ args.tdelete = tdelete
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_checkAndDelete(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_checkAndDelete(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = checkAndDelete_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndDelete failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndDelete failed: unknown result")
- def increment(self, table, increment):
+ def increment(self, table, tincrement):
"""
Parameters:
- table: the table to increment the value on
- - increment: the TIncrement to increment
+ - tincrement: the TIncrement to increment
"""
- self.send_increment(table, increment)
+ self.send_increment(table, tincrement)
return self.recv_increment()
- def send_increment(self, table, increment):
+ def send_increment(self, table, tincrement):
self._oprot.writeMessageBegin('increment', TMessageType.CALL, self._seqid)
args = increment_args()
args.table = table
- args.increment = increment
+ args.tincrement = tincrement
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_increment(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_increment(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = increment_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.io is not None:
+ raise result.io
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "increment failed: unknown result")
+
+ def append(self, table, tappend):
+ """
+ Parameters:
+ - table: the table to append the value on
+ - tappend: the TAppend to append
+ """
+ self.send_append(table, tappend)
+ return self.recv_append()
+
+ def send_append(self, table, tappend):
+ self._oprot.writeMessageBegin('append', TMessageType.CALL, self._seqid)
+ args = append_args()
+ args.table = table
+ args.tappend = tappend
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_append(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = append_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "increment failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "append failed: unknown result")
- def openScanner(self, table, scan):
+ def openScanner(self, table, tscan):
"""
Get a Scanner for the provided TScan object.
@@ -608,35 +782,36 @@ class Client(Iface):
Parameters:
- table: the table to get the Scanner for
- - scan: the scan object to get a Scanner for
+ - tscan: the scan object to get a Scanner for
"""
- self.send_openScanner(table, scan)
+ self.send_openScanner(table, tscan)
return self.recv_openScanner()
- def send_openScanner(self, table, scan):
+ def send_openScanner(self, table, tscan):
self._oprot.writeMessageBegin('openScanner', TMessageType.CALL, self._seqid)
args = openScanner_args()
args.table = table
- args.scan = scan
+ args.tscan = tscan
args.write(self._oprot)
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_openScanner(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_openScanner(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = openScanner_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
- raise TApplicationException(TApplicationException.MISSING_RESULT, "openScanner failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "openScanner failed: unknown result")
def getScannerRows(self, scannerId, numRows):
"""
@@ -660,30 +835,30 @@ class Client(Iface):
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_getScannerRows(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_getScannerRows(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = getScannerRows_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.success is not None:
return result.success
if result.io is not None:
raise result.io
if result.ia is not None:
raise result.ia
- raise TApplicationException(TApplicationException.MISSING_RESULT, "getScannerRows failed: unknown result");
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getScannerRows failed: unknown result")
def closeScanner(self, scannerId):
"""
- Closes the scanner. Should be called if you need to close
- the Scanner before all results are read.
-
- Exhausted scanners are closed automatically.
+ Closes the scanner. Should be called to free server side resources timely.
+ Typically close once the scanner is not needed anymore, i.e. after looping
+ over it to get all the required rows.
Parameters:
- scannerId: the Id of the Scanner to close *
@@ -699,28 +874,237 @@ class Client(Iface):
self._oprot.writeMessageEnd()
self._oprot.trans.flush()
- def recv_closeScanner(self, ):
- (fname, mtype, rseqid) = self._iprot.readMessageBegin()
+ def recv_closeScanner(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
if mtype == TMessageType.EXCEPTION:
x = TApplicationException()
- x.read(self._iprot)
- self._iprot.readMessageEnd()
+ x.read(iprot)
+ iprot.readMessageEnd()
raise x
result = closeScanner_result()
- result.read(self._iprot)
- self._iprot.readMessageEnd()
+ result.read(iprot)
+ iprot.readMessageEnd()
if result.io is not None:
raise result.io
if result.ia is not None:
raise result.ia
return
+ def mutateRow(self, table, trowMutations):
+ """
+ mutateRow performs multiple mutations atomically on a single row.
+
+ Parameters:
+ - table: table to apply the mutations
+ - trowMutations: mutations to apply
+ """
+ self.send_mutateRow(table, trowMutations)
+ self.recv_mutateRow()
+
+ def send_mutateRow(self, table, trowMutations):
+ self._oprot.writeMessageBegin('mutateRow', TMessageType.CALL, self._seqid)
+ args = mutateRow_args()
+ args.table = table
+ args.trowMutations = trowMutations
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_mutateRow(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = mutateRow_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.io is not None:
+ raise result.io
+ return
+
+ def getScannerResults(self, table, tscan, numRows):
+ """
+ Get results for the provided TScan object.
+ This helper function opens a scanner, get the results and close the scanner.
+
+ @return between zero and numRows TResults
+
+ Parameters:
+ - table: the table to get the Scanner for
+ - tscan: the scan object to get a Scanner for
+ - numRows: number of rows to return
+ """
+ self.send_getScannerResults(table, tscan, numRows)
+ return self.recv_getScannerResults()
+
+ def send_getScannerResults(self, table, tscan, numRows):
+ self._oprot.writeMessageBegin('getScannerResults', TMessageType.CALL, self._seqid)
+ args = getScannerResults_args()
+ args.table = table
+ args.tscan = tscan
+ args.numRows = numRows
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_getScannerResults(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = getScannerResults_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.io is not None:
+ raise result.io
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getScannerResults failed: unknown result")
+
+ def getRegionLocation(self, table, row, reload):
+ """
+ Given a table and a row get the location of the region that
+ would contain the given row key.
+
+ reload = true means the cache will be cleared and the location
+ will be fetched from meta.
+
+ Parameters:
+ - table
+ - row
+ - reload
+ """
+ self.send_getRegionLocation(table, row, reload)
+ return self.recv_getRegionLocation()
+
+ def send_getRegionLocation(self, table, row, reload):
+ self._oprot.writeMessageBegin('getRegionLocation', TMessageType.CALL, self._seqid)
+ args = getRegionLocation_args()
+ args.table = table
+ args.row = row
+ args.reload = reload
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_getRegionLocation(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = getRegionLocation_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.io is not None:
+ raise result.io
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getRegionLocation failed: unknown result")
+
+ def getAllRegionLocations(self, table):
+ """
+ Get all of the region locations for a given table.
+
+
+ Parameters:
+ - table
+ """
+ self.send_getAllRegionLocations(table)
+ return self.recv_getAllRegionLocations()
+
+ def send_getAllRegionLocations(self, table):
+ self._oprot.writeMessageBegin('getAllRegionLocations', TMessageType.CALL, self._seqid)
+ args = getAllRegionLocations_args()
+ args.table = table
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_getAllRegionLocations(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = getAllRegionLocations_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.io is not None:
+ raise result.io
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "getAllRegionLocations failed: unknown result")
+
+ def checkAndMutate(self, table, row, family, qualifier, compareOp, value, rowMutations):
+ """
+ Atomically checks if a row/family/qualifier value matches the expected
+ value. If it does, it mutates the row.
+
+ @return true if the row was mutated, false otherwise
+
+ Parameters:
+ - table: to check in and delete from
+ - row: row to check
+ - family: column family to check
+ - qualifier: column qualifier to check
+ - compareOp: comparison to make on the value
+ - value: the expected value to be compared against, if not provided the
+ check is for the non-existence of the column in question
+ - rowMutations: row mutations to execute if the value matches
+ """
+ self.send_checkAndMutate(table, row, family, qualifier, compareOp, value, rowMutations)
+ return self.recv_checkAndMutate()
+
+ def send_checkAndMutate(self, table, row, family, qualifier, compareOp, value, rowMutations):
+ self._oprot.writeMessageBegin('checkAndMutate', TMessageType.CALL, self._seqid)
+ args = checkAndMutate_args()
+ args.table = table
+ args.row = row
+ args.family = family
+ args.qualifier = qualifier
+ args.compareOp = compareOp
+ args.value = value
+ args.rowMutations = rowMutations
+ args.write(self._oprot)
+ self._oprot.writeMessageEnd()
+ self._oprot.trans.flush()
+
+ def recv_checkAndMutate(self):
+ iprot = self._iprot
+ (fname, mtype, rseqid) = iprot.readMessageBegin()
+ if mtype == TMessageType.EXCEPTION:
+ x = TApplicationException()
+ x.read(iprot)
+ iprot.readMessageEnd()
+ raise x
+ result = checkAndMutate_result()
+ result.read(iprot)
+ iprot.readMessageEnd()
+ if result.success is not None:
+ return result.success
+ if result.io is not None:
+ raise result.io
+ raise TApplicationException(TApplicationException.MISSING_RESULT, "checkAndMutate failed: unknown result")
+
class Processor(Iface, TProcessor):
def __init__(self, handler):
self._handler = handler
self._processMap = {}
self._processMap["exists"] = Processor.process_exists
+ self._processMap["existsAll"] = Processor.process_existsAll
self._processMap["get"] = Processor.process_get
self._processMap["getMultiple"] = Processor.process_getMultiple
self._processMap["put"] = Processor.process_put
@@ -730,9 +1114,15 @@ class Processor(Iface, TProcessor):
self._processMap["deleteMultiple"] = Processor.process_deleteMultiple
self._processMap["checkAndDelete"] = Processor.process_checkAndDelete
self._processMap["increment"] = Processor.process_increment
+ self._processMap["append"] = Processor.process_append
self._processMap["openScanner"] = Processor.process_openScanner
self._processMap["getScannerRows"] = Processor.process_getScannerRows
self._processMap["closeScanner"] = Processor.process_closeScanner
+ self._processMap["mutateRow"] = Processor.process_mutateRow
+ self._processMap["getScannerResults"] = Processor.process_getScannerResults
+ self._processMap["getRegionLocation"] = Processor.process_getRegionLocation
+ self._processMap["getAllRegionLocations"] = Processor.process_getAllRegionLocations
+ self._processMap["checkAndMutate"] = Processor.process_checkAndMutate
def process(self, iprot, oprot):
(name, type, seqid) = iprot.readMessageBegin()
@@ -755,10 +1145,40 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = exists_result()
try:
- result.success = self._handler.exists(args.table, args.get)
+ result.success = self._handler.exists(args.table, args.tget)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except TIOError as io:
+ msg_type = TMessageType.REPLY
+ result.io = io
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("exists", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_existsAll(self, seqid, iprot, oprot):
+ args = existsAll_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = existsAll_result()
+ try:
+ result.success = self._handler.existsAll(args.table, args.tgets)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("exists", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("existsAll", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -769,10 +1189,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = get_result()
try:
- result.success = self._handler.get(args.table, args.get)
+ result.success = self._handler.get(args.table, args.tget)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("get", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("get", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -783,10 +1211,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = getMultiple_result()
try:
- result.success = self._handler.getMultiple(args.table, args.gets)
+ result.success = self._handler.getMultiple(args.table, args.tgets)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("getMultiple", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("getMultiple", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -797,10 +1233,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = put_result()
try:
- self._handler.put(args.table, args.put)
+ self._handler.put(args.table, args.tput)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("put", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("put", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -811,10 +1255,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = checkAndPut_result()
try:
- result.success = self._handler.checkAndPut(args.table, args.row, args.family, args.qualifier, args.value, args.put)
+ result.success = self._handler.checkAndPut(args.table, args.row, args.family, args.qualifier, args.value, args.tput)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("checkAndPut", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("checkAndPut", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -825,10 +1277,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = putMultiple_result()
try:
- self._handler.putMultiple(args.table, args.puts)
+ self._handler.putMultiple(args.table, args.tputs)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("putMultiple", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("putMultiple", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -839,10 +1299,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = deleteSingle_result()
try:
- self._handler.deleteSingle(args.table, args.deleteSingle)
+ self._handler.deleteSingle(args.table, args.tdelete)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("deleteSingle", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("deleteSingle", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -853,10 +1321,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = deleteMultiple_result()
try:
- result.success = self._handler.deleteMultiple(args.table, args.deletes)
+ result.success = self._handler.deleteMultiple(args.table, args.tdeletes)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("deleteMultiple", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("deleteMultiple", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -867,10 +1343,18 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = checkAndDelete_result()
try:
- result.success = self._handler.checkAndDelete(args.table, args.row, args.family, args.qualifier, args.value, args.deleteSingle)
+ result.success = self._handler.checkAndDelete(args.table, args.row, args.family, args.qualifier, args.value, args.tdelete)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("checkAndDelete", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("checkAndDelete", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -881,40 +1365,87 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = increment_result()
try:
- result.success = self._handler.increment(args.table, args.increment)
+ result.success = self._handler.increment(args.table, args.tincrement)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("increment", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("increment", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
- def process_openScanner(self, seqid, iprot, oprot):
- args = openScanner_args()
+ def process_append(self, seqid, iprot, oprot):
+ args = append_args()
args.read(iprot)
iprot.readMessageEnd()
- result = openScanner_result()
+ result = append_result()
try:
- result.success = self._handler.openScanner(args.table, args.scan)
+ result.success = self._handler.append(args.table, args.tappend)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
- oprot.writeMessageBegin("openScanner", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("append", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
- def process_getScannerRows(self, seqid, iprot, oprot):
- args = getScannerRows_args()
+ def process_openScanner(self, seqid, iprot, oprot):
+ args = openScanner_args()
args.read(iprot)
iprot.readMessageEnd()
- result = getScannerRows_result()
+ result = openScanner_result()
+ try:
+ result.success = self._handler.openScanner(args.table, args.tscan)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except TIOError as io:
+ msg_type = TMessageType.REPLY
+ result.io = io
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("openScanner", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_getScannerRows(self, seqid, iprot, oprot):
+ args = getScannerRows_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = getScannerRows_result()
try:
result.success = self._handler.getScannerRows(args.scannerId, args.numRows)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
except TIllegalArgument as ia:
+ msg_type = TMessageType.REPLY
result.ia = ia
- oprot.writeMessageBegin("getScannerRows", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("getScannerRows", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -926,11 +1457,130 @@ class Processor(Iface, TProcessor):
result = closeScanner_result()
try:
self._handler.closeScanner(args.scannerId)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
except TIOError as io:
+ msg_type = TMessageType.REPLY
result.io = io
except TIllegalArgument as ia:
+ msg_type = TMessageType.REPLY
result.ia = ia
- oprot.writeMessageBegin("closeScanner", TMessageType.REPLY, seqid)
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("closeScanner", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_mutateRow(self, seqid, iprot, oprot):
+ args = mutateRow_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = mutateRow_result()
+ try:
+ self._handler.mutateRow(args.table, args.trowMutations)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except TIOError as io:
+ msg_type = TMessageType.REPLY
+ result.io = io
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("mutateRow", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_getScannerResults(self, seqid, iprot, oprot):
+ args = getScannerResults_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = getScannerResults_result()
+ try:
+ result.success = self._handler.getScannerResults(args.table, args.tscan, args.numRows)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except TIOError as io:
+ msg_type = TMessageType.REPLY
+ result.io = io
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("getScannerResults", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_getRegionLocation(self, seqid, iprot, oprot):
+ args = getRegionLocation_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = getRegionLocation_result()
+ try:
+ result.success = self._handler.getRegionLocation(args.table, args.row, args.reload)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except TIOError as io:
+ msg_type = TMessageType.REPLY
+ result.io = io
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("getRegionLocation", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_getAllRegionLocations(self, seqid, iprot, oprot):
+ args = getAllRegionLocations_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = getAllRegionLocations_result()
+ try:
+ result.success = self._handler.getAllRegionLocations(args.table)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except TIOError as io:
+ msg_type = TMessageType.REPLY
+ result.io = io
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("getAllRegionLocations", msg_type, seqid)
+ result.write(oprot)
+ oprot.writeMessageEnd()
+ oprot.trans.flush()
+
+ def process_checkAndMutate(self, seqid, iprot, oprot):
+ args = checkAndMutate_args()
+ args.read(iprot)
+ iprot.readMessageEnd()
+ result = checkAndMutate_result()
+ try:
+ result.success = self._handler.checkAndMutate(args.table, args.row, args.family, args.qualifier, args.compareOp, args.value, args.rowMutations)
+ msg_type = TMessageType.REPLY
+ except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
+ raise
+ except TIOError as io:
+ msg_type = TMessageType.REPLY
+ result.io = io
+ except Exception as ex:
+ msg_type = TMessageType.EXCEPTION
+ logging.exception(ex)
+ result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
+ oprot.writeMessageBegin("checkAndMutate", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
@@ -942,18 +1592,18 @@ class exists_args:
"""
Attributes:
- table: the table to check on
- - get: the TGet to check for
+ - tget: the TGet to check for
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'table', None, None, ), # 1
- (2, TType.STRUCT, 'get', (TGet, TGet.thrift_spec), None, ), # 2
+ (2, TType.STRUCT, 'tget', (TGet, TGet.thrift_spec), None, ), # 2
)
- def __init__(self, table=None, get=None,):
+ def __init__(self, table=None, tget=None,):
self.table = table
- self.get = get
+ self.tget = tget
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -966,13 +1616,13 @@ class exists_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
- self.get = TGet()
- self.get.read(iprot)
+ self.tget = TGet()
+ self.tget.read(iprot)
else:
iprot.skip(ftype)
else:
@@ -989,9 +1639,9 @@ class exists_args:
oprot.writeFieldBegin('table', TType.STRING, 1)
oprot.writeString(self.table)
oprot.writeFieldEnd()
- if self.get is not None:
- oprot.writeFieldBegin('get', TType.STRUCT, 2)
- self.get.write(oprot)
+ if self.tget is not None:
+ oprot.writeFieldBegin('tget', TType.STRUCT, 2)
+ self.tget.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -999,11 +1649,17 @@ class exists_args:
def validate(self):
if self.table is None:
raise TProtocol.TProtocolException(message='Required field table is unset!')
- if self.get is None:
- raise TProtocol.TProtocolException(message='Required field get is unset!')
+ if self.tget is None:
+ raise TProtocol.TProtocolException(message='Required field tget is unset!')
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.tget)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1042,7 +1698,7 @@ class exists_result:
break
if fid == 0:
if ftype == TType.BOOL:
- self.success = iprot.readBool();
+ self.success = iprot.readBool()
else:
iprot.skip(ftype)
elif fid == 1:
@@ -1076,6 +1732,189 @@ class exists_result:
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.success)
+ value = (value * 31) ^ hash(self.io)
+ return value
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class existsAll_args:
+ """
+ Attributes:
+ - table: the table to check on
+ - tgets: a list of TGets to check for
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.STRING, 'table', None, None, ), # 1
+ (2, TType.LIST, 'tgets', (TType.STRUCT,(TGet, TGet.thrift_spec)), None, ), # 2
+ )
+
+ def __init__(self, table=None, tgets=None,):
+ self.table = table
+ self.tgets = tgets
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.STRING:
+ self.table = iprot.readString()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.tgets = []
+ (_etype129, _size126) = iprot.readListBegin()
+ for _i130 in xrange(_size126):
+ _elem131 = TGet()
+ _elem131.read(iprot)
+ self.tgets.append(_elem131)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('existsAll_args')
+ if self.table is not None:
+ oprot.writeFieldBegin('table', TType.STRING, 1)
+ oprot.writeString(self.table)
+ oprot.writeFieldEnd()
+ if self.tgets is not None:
+ oprot.writeFieldBegin('tgets', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.tgets))
+ for iter132 in self.tgets:
+ iter132.write(oprot)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.table is None:
+ raise TProtocol.TProtocolException(message='Required field table is unset!')
+ if self.tgets is None:
+ raise TProtocol.TProtocolException(message='Required field tgets is unset!')
+ return
+
+
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.tgets)
+ return value
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
+
+class existsAll_result:
+ """
+ Attributes:
+ - success
+ - io
+ """
+
+ thrift_spec = (
+ (0, TType.LIST, 'success', (TType.BOOL,None), None, ), # 0
+ (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), # 1
+ )
+
+ def __init__(self, success=None, io=None,):
+ self.success = success
+ self.io = io
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 0:
+ if ftype == TType.LIST:
+ self.success = []
+ (_etype136, _size133) = iprot.readListBegin()
+ for _i137 in xrange(_size133):
+ _elem138 = iprot.readBool()
+ self.success.append(_elem138)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 1:
+ if ftype == TType.STRUCT:
+ self.io = TIOError()
+ self.io.read(iprot)
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('existsAll_result')
+ if self.success is not None:
+ oprot.writeFieldBegin('success', TType.LIST, 0)
+ oprot.writeListBegin(TType.BOOL, len(self.success))
+ for iter139 in self.success:
+ oprot.writeBool(iter139)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.io is not None:
+ oprot.writeFieldBegin('io', TType.STRUCT, 1)
+ self.io.write(oprot)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ return
+
+
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.success)
+ value = (value * 31) ^ hash(self.io)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1091,18 +1930,18 @@ class get_args:
"""
Attributes:
- table: the table to get from
- - get: the TGet to fetch
+ - tget: the TGet to fetch
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'table', None, None, ), # 1
- (2, TType.STRUCT, 'get', (TGet, TGet.thrift_spec), None, ), # 2
+ (2, TType.STRUCT, 'tget', (TGet, TGet.thrift_spec), None, ), # 2
)
- def __init__(self, table=None, get=None,):
+ def __init__(self, table=None, tget=None,):
self.table = table
- self.get = get
+ self.tget = tget
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1115,13 +1954,13 @@ class get_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
- self.get = TGet()
- self.get.read(iprot)
+ self.tget = TGet()
+ self.tget.read(iprot)
else:
iprot.skip(ftype)
else:
@@ -1138,9 +1977,9 @@ class get_args:
oprot.writeFieldBegin('table', TType.STRING, 1)
oprot.writeString(self.table)
oprot.writeFieldEnd()
- if self.get is not None:
- oprot.writeFieldBegin('get', TType.STRUCT, 2)
- self.get.write(oprot)
+ if self.tget is not None:
+ oprot.writeFieldBegin('tget', TType.STRUCT, 2)
+ self.tget.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -1148,11 +1987,17 @@ class get_args:
def validate(self):
if self.table is None:
raise TProtocol.TProtocolException(message='Required field table is unset!')
- if self.get is None:
- raise TProtocol.TProtocolException(message='Required field get is unset!')
+ if self.tget is None:
+ raise TProtocol.TProtocolException(message='Required field tget is unset!')
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.tget)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1226,6 +2071,12 @@ class get_result:
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.success)
+ value = (value * 31) ^ hash(self.io)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1241,7 +2092,7 @@ class getMultiple_args:
"""
Attributes:
- table: the table to get from
- - gets: a list of TGets to fetch, the Result list
+ - tgets: a list of TGets to fetch, the Result list
will have the Results at corresponding positions
or null if there was an error
"""
@@ -1249,12 +2100,12 @@ class getMultiple_args:
thrift_spec = (
None, # 0
(1, TType.STRING, 'table', None, None, ), # 1
- (2, TType.LIST, 'gets', (TType.STRUCT,(TGet, TGet.thrift_spec)), None, ), # 2
+ (2, TType.LIST, 'tgets', (TType.STRUCT,(TGet, TGet.thrift_spec)), None, ), # 2
)
- def __init__(self, table=None, gets=None,):
+ def __init__(self, table=None, tgets=None,):
self.table = table
- self.gets = gets
+ self.tgets = tgets
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1267,17 +2118,17 @@ class getMultiple_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.LIST:
- self.gets = []
- (_etype45, _size42) = iprot.readListBegin()
- for _i46 in xrange(_size42):
- _elem47 = TGet()
- _elem47.read(iprot)
- self.gets.append(_elem47)
+ self.tgets = []
+ (_etype143, _size140) = iprot.readListBegin()
+ for _i144 in xrange(_size140):
+ _elem145 = TGet()
+ _elem145.read(iprot)
+ self.tgets.append(_elem145)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -1295,11 +2146,11 @@ class getMultiple_args:
oprot.writeFieldBegin('table', TType.STRING, 1)
oprot.writeString(self.table)
oprot.writeFieldEnd()
- if self.gets is not None:
- oprot.writeFieldBegin('gets', TType.LIST, 2)
- oprot.writeListBegin(TType.STRUCT, len(self.gets))
- for iter48 in self.gets:
- iter48.write(oprot)
+ if self.tgets is not None:
+ oprot.writeFieldBegin('tgets', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.tgets))
+ for iter146 in self.tgets:
+ iter146.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
@@ -1308,11 +2159,17 @@ class getMultiple_args:
def validate(self):
if self.table is None:
raise TProtocol.TProtocolException(message='Required field table is unset!')
- if self.gets is None:
- raise TProtocol.TProtocolException(message='Required field gets is unset!')
+ if self.tgets is None:
+ raise TProtocol.TProtocolException(message='Required field tgets is unset!')
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.tgets)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1352,11 +2209,11 @@ class getMultiple_result:
if fid == 0:
if ftype == TType.LIST:
self.success = []
- (_etype52, _size49) = iprot.readListBegin()
- for _i53 in xrange(_size49):
- _elem54 = TResult()
- _elem54.read(iprot)
- self.success.append(_elem54)
+ (_etype150, _size147) = iprot.readListBegin()
+ for _i151 in xrange(_size147):
+ _elem152 = TResult()
+ _elem152.read(iprot)
+ self.success.append(_elem152)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -1379,8 +2236,8 @@ class getMultiple_result:
if self.success is not None:
oprot.writeFieldBegin('success', TType.LIST, 0)
oprot.writeListBegin(TType.STRUCT, len(self.success))
- for iter55 in self.success:
- iter55.write(oprot)
+ for iter153 in self.success:
+ iter153.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.io is not None:
@@ -1394,6 +2251,12 @@ class getMultiple_result:
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.success)
+ value = (value * 31) ^ hash(self.io)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1409,18 +2272,18 @@ class put_args:
"""
Attributes:
- table: the table to put data in
- - put: the TPut to put
+ - tput: the TPut to put
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'table', None, None, ), # 1
- (2, TType.STRUCT, 'put', (TPut, TPut.thrift_spec), None, ), # 2
+ (2, TType.STRUCT, 'tput', (TPut, TPut.thrift_spec), None, ), # 2
)
- def __init__(self, table=None, put=None,):
+ def __init__(self, table=None, tput=None,):
self.table = table
- self.put = put
+ self.tput = tput
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1433,13 +2296,13 @@ class put_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
- self.put = TPut()
- self.put.read(iprot)
+ self.tput = TPut()
+ self.tput.read(iprot)
else:
iprot.skip(ftype)
else:
@@ -1456,9 +2319,9 @@ class put_args:
oprot.writeFieldBegin('table', TType.STRING, 1)
oprot.writeString(self.table)
oprot.writeFieldEnd()
- if self.put is not None:
- oprot.writeFieldBegin('put', TType.STRUCT, 2)
- self.put.write(oprot)
+ if self.tput is not None:
+ oprot.writeFieldBegin('tput', TType.STRUCT, 2)
+ self.tput.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -1466,11 +2329,17 @@ class put_args:
def validate(self):
if self.table is None:
raise TProtocol.TProtocolException(message='Required field table is unset!')
- if self.put is None:
- raise TProtocol.TProtocolException(message='Required field put is unset!')
+ if self.tput is None:
+ raise TProtocol.TProtocolException(message='Required field tput is unset!')
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.tput)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1532,6 +2401,11 @@ class put_result:
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.io)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1553,7 +2427,7 @@ class checkAndPut_args:
- value: the expected value, if not provided the
check is for the non-existence of the
column in question
- - put: the TPut to put if the check succeeds
+ - tput: the TPut to put if the check succeeds
"""
thrift_spec = (
@@ -1563,16 +2437,16 @@ class checkAndPut_args:
(3, TType.STRING, 'family', None, None, ), # 3
(4, TType.STRING, 'qualifier', None, None, ), # 4
(5, TType.STRING, 'value', None, None, ), # 5
- (6, TType.STRUCT, 'put', (TPut, TPut.thrift_spec), None, ), # 6
+ (6, TType.STRUCT, 'tput', (TPut, TPut.thrift_spec), None, ), # 6
)
- def __init__(self, table=None, row=None, family=None, qualifier=None, value=None, put=None,):
+ def __init__(self, table=None, row=None, family=None, qualifier=None, value=None, tput=None,):
self.table = table
self.row = row
self.family = family
self.qualifier = qualifier
self.value = value
- self.put = put
+ self.tput = tput
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1585,33 +2459,33 @@ class checkAndPut_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRING:
- self.row = iprot.readString();
+ self.row = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 3:
if ftype == TType.STRING:
- self.family = iprot.readString();
+ self.family = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 4:
if ftype == TType.STRING:
- self.qualifier = iprot.readString();
+ self.qualifier = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 5:
if ftype == TType.STRING:
- self.value = iprot.readString();
+ self.value = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 6:
if ftype == TType.STRUCT:
- self.put = TPut()
- self.put.read(iprot)
+ self.tput = TPut()
+ self.tput.read(iprot)
else:
iprot.skip(ftype)
else:
@@ -1644,9 +2518,9 @@ class checkAndPut_args:
oprot.writeFieldBegin('value', TType.STRING, 5)
oprot.writeString(self.value)
oprot.writeFieldEnd()
- if self.put is not None:
- oprot.writeFieldBegin('put', TType.STRUCT, 6)
- self.put.write(oprot)
+ if self.tput is not None:
+ oprot.writeFieldBegin('tput', TType.STRUCT, 6)
+ self.tput.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -1660,11 +2534,21 @@ class checkAndPut_args:
raise TProtocol.TProtocolException(message='Required field family is unset!')
if self.qualifier is None:
raise TProtocol.TProtocolException(message='Required field qualifier is unset!')
- if self.put is None:
- raise TProtocol.TProtocolException(message='Required field put is unset!')
+ if self.tput is None:
+ raise TProtocol.TProtocolException(message='Required field tput is unset!')
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.row)
+ value = (value * 31) ^ hash(self.family)
+ value = (value * 31) ^ hash(self.qualifier)
+ value = (value * 31) ^ hash(self.value)
+ value = (value * 31) ^ hash(self.tput)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1703,7 +2587,7 @@ class checkAndPut_result:
break
if fid == 0:
if ftype == TType.BOOL:
- self.success = iprot.readBool();
+ self.success = iprot.readBool()
else:
iprot.skip(ftype)
elif fid == 1:
@@ -1737,6 +2621,12 @@ class checkAndPut_result:
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.success)
+ value = (value * 31) ^ hash(self.io)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1752,18 +2642,18 @@ class putMultiple_args:
"""
Attributes:
- table: the table to put data in
- - puts: a list of TPuts to commit
+ - tputs: a list of TPuts to commit
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'table', None, None, ), # 1
- (2, TType.LIST, 'puts', (TType.STRUCT,(TPut, TPut.thrift_spec)), None, ), # 2
+ (2, TType.LIST, 'tputs', (TType.STRUCT,(TPut, TPut.thrift_spec)), None, ), # 2
)
- def __init__(self, table=None, puts=None,):
+ def __init__(self, table=None, tputs=None,):
self.table = table
- self.puts = puts
+ self.tputs = tputs
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1776,17 +2666,17 @@ class putMultiple_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.LIST:
- self.puts = []
- (_etype59, _size56) = iprot.readListBegin()
- for _i60 in xrange(_size56):
- _elem61 = TPut()
- _elem61.read(iprot)
- self.puts.append(_elem61)
+ self.tputs = []
+ (_etype157, _size154) = iprot.readListBegin()
+ for _i158 in xrange(_size154):
+ _elem159 = TPut()
+ _elem159.read(iprot)
+ self.tputs.append(_elem159)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -1804,11 +2694,11 @@ class putMultiple_args:
oprot.writeFieldBegin('table', TType.STRING, 1)
oprot.writeString(self.table)
oprot.writeFieldEnd()
- if self.puts is not None:
- oprot.writeFieldBegin('puts', TType.LIST, 2)
- oprot.writeListBegin(TType.STRUCT, len(self.puts))
- for iter62 in self.puts:
- iter62.write(oprot)
+ if self.tputs is not None:
+ oprot.writeFieldBegin('tputs', TType.LIST, 2)
+ oprot.writeListBegin(TType.STRUCT, len(self.tputs))
+ for iter160 in self.tputs:
+ iter160.write(oprot)
oprot.writeListEnd()
oprot.writeFieldEnd()
oprot.writeFieldStop()
@@ -1817,11 +2707,17 @@ class putMultiple_args:
def validate(self):
if self.table is None:
raise TProtocol.TProtocolException(message='Required field table is unset!')
- if self.puts is None:
- raise TProtocol.TProtocolException(message='Required field puts is unset!')
+ if self.tputs is None:
+ raise TProtocol.TProtocolException(message='Required field tputs is unset!')
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.tputs)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1883,6 +2779,11 @@ class putMultiple_result:
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.io)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -1898,18 +2799,18 @@ class deleteSingle_args:
"""
Attributes:
- table: the table to delete from
- - deleteSingle: the TDelete to delete
+ - tdelete: the TDelete to delete
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'table', None, None, ), # 1
- (2, TType.STRUCT, 'deleteSingle', (TDelete, TDelete.thrift_spec), None, ), # 2
+ (2, TType.STRUCT, 'tdelete', (TDelete, TDelete.thrift_spec), None, ), # 2
)
- def __init__(self, table=None, deleteSingle=None,):
+ def __init__(self, table=None, tdelete=None,):
self.table = table
- self.deleteSingle = deleteSingle
+ self.tdelete = tdelete
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -1922,13 +2823,13 @@ class deleteSingle_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.STRUCT:
- self.deleteSingle = TDelete()
- self.deleteSingle.read(iprot)
+ self.tdelete = TDelete()
+ self.tdelete.read(iprot)
else:
iprot.skip(ftype)
else:
@@ -1945,9 +2846,9 @@ class deleteSingle_args:
oprot.writeFieldBegin('table', TType.STRING, 1)
oprot.writeString(self.table)
oprot.writeFieldEnd()
- if self.deleteSingle is not None:
- oprot.writeFieldBegin('deleteSingle', TType.STRUCT, 2)
- self.deleteSingle.write(oprot)
+ if self.tdelete is not None:
+ oprot.writeFieldBegin('tdelete', TType.STRUCT, 2)
+ self.tdelete.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -1955,11 +2856,17 @@ class deleteSingle_args:
def validate(self):
if self.table is None:
raise TProtocol.TProtocolException(message='Required field table is unset!')
- if self.deleteSingle is None:
- raise TProtocol.TProtocolException(message='Required field deleteSingle is unset!')
+ if self.tdelete is None:
+ raise TProtocol.TProtocolException(message='Required field tdelete is unset!')
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.table)
+ value = (value * 31) ^ hash(self.tdelete)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -2021,6 +2928,11 @@ class deleteSingle_result:
return
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.io)
+ return value
+
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.iteritems()]
@@ -2036,18 +2948,18 @@ class deleteMultiple_args:
"""
Attributes:
- table: the table to delete from
- - deletes: list of TDeletes to delete
+ - tdeletes: list of TDeletes to delete
"""
thrift_spec = (
None, # 0
(1, TType.STRING, 'table', None, None, ), # 1
- (2, TType.LIST, 'deletes', (TType.STRUCT,(TDelete, TDelete.thrift_spec)), None, ), # 2
+ (2, TType.LIST, 'tdeletes', (TType.STRUCT,(TDelete, TDelete.thrift_spec)), None, ), # 2
)
- def __init__(self, table=None, deletes=None,):
+ def __init__(self, table=None, tdeletes=None,):
self.table = table
- self.deletes = deletes
+ self.tdeletes = tdeletes
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -2060,17 +2972,17 @@ class deleteMultiple_args:
break
if fid == 1:
if ftype == TType.STRING:
- self.table = iprot.readString();
+ self.table = iprot.readString()
else:
iprot.skip(ftype)
elif fid == 2:
if ftype == TType.LIST:
- self.deletes = []
- (_etype66, _size63) = iprot.readListBegin()
- for _i67 in xrange(_size63):
- _elem68 = TDelete()
- _elem68.read(iprot)
- self.deletes.append(_elem68)
+ self.tdeletes = []
+ (_etype164, _size161) = iprot.readListBegin()
+ for _i165 in xrange(_size161):
+ _elem166 = TDelete()
+ _elem166.read(iprot)
+ self.tdeletes.append(_elem166)
iprot.readListEnd()
else:
iprot.skip(ftype)
@@ -2088,11 +3000,11 @@ class deleteMultiple_args:
oprot.writeFieldBegin('table', TType.STRING, 1)
oprot.writeString(self.table)
oprot.writeFieldEnd()
- if self.deletes is not None:
- oprot.writeFieldBegin('deletes', TType.LIST, 2)
- oprot.writeListBegin(TType.STRUCT, len(self.deletes))
- fo
<TRUNCATED>