HBASE-20395 Displaying thrift server type on the thrift page (#811)

Signed-off-by: Lijin Bin <binlijin@apache.org>
Signed-off-by: Bharath Vissapragada <bharathv@apache.org>
This commit is contained in:
Guangxu Cheng 2019-11-26 19:52:46 +08:00 committed by GitHub
parent df9cbd4254
commit b99f58304e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
71 changed files with 28967 additions and 18616 deletions

View File

@ -30,7 +30,7 @@ sys.path.append(gen_py_path)
from thrift import Thrift
from thrift.transport import TSocket, TTransport
from thrift.protocol import TBinaryProtocol
from hbase import ttypes
from hbase.ttypes import TThriftServerType
from hbase.Hbase import Client, ColumnDescriptor, Mutation
def printVersions(row, versions):
@ -66,6 +66,11 @@ def demo_client(host, port, is_framed_transport):
# Connect!
transport.open()
# Check Thrift Server Type
serverType = client.getThriftServerType()
if serverType != TThriftServerType.ONE:
raise Exception("Mismatch between client and server, server type is %s" % serverType)
t = "demo_table"
#

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Autogenerated by Thrift Compiler (0.9.0)
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
@ -9,374 +9,417 @@
import sys
import pprint
from urlparse import urlparse
from thrift.transport import TTransport
from thrift.transport import TSocket
from thrift.transport import THttpClient
from thrift.protocol import TBinaryProtocol
if sys.version_info[0] > 2:
from urllib.parse import urlparse
else:
from urlparse import urlparse
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
import Hbase
from ttypes import *
from hbase import Hbase
from hbase.ttypes import *
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print ''
print 'Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] function [arg1 [arg2...]]'
print ''
print 'Functions:'
print ' void enableTable(Bytes tableName)'
print ' void disableTable(Bytes tableName)'
print ' bool isTableEnabled(Bytes tableName)'
print ' void compact(Bytes tableNameOrRegionName)'
print ' void majorCompact(Bytes tableNameOrRegionName)'
print ' getTableNames()'
print ' getColumnDescriptors(Text tableName)'
print ' getTableRegions(Text tableName)'
print ' void createTable(Text tableName, columnFamilies)'
print ' void deleteTable(Text tableName)'
print ' get(Text tableName, Text row, Text column, attributes)'
print ' getVer(Text tableName, Text row, Text column, i32 numVersions, attributes)'
print ' getVerTs(Text tableName, Text row, Text column, i64 timestamp, i32 numVersions, attributes)'
print ' getRow(Text tableName, Text row, attributes)'
print ' getRowWithColumns(Text tableName, Text row, columns, attributes)'
print ' getRowTs(Text tableName, Text row, i64 timestamp, attributes)'
print ' getRowWithColumnsTs(Text tableName, Text row, columns, i64 timestamp, attributes)'
print ' getRows(Text tableName, rows, attributes)'
print ' getRowsWithColumns(Text tableName, rows, columns, attributes)'
print ' getRowsTs(Text tableName, rows, i64 timestamp, attributes)'
print ' getRowsWithColumnsTs(Text tableName, rows, columns, i64 timestamp, attributes)'
print ' void mutateRow(Text tableName, Text row, mutations, attributes)'
print ' void mutateRowTs(Text tableName, Text row, mutations, i64 timestamp, attributes)'
print ' void mutateRows(Text tableName, rowBatches, attributes)'
print ' void mutateRowsTs(Text tableName, rowBatches, i64 timestamp, attributes)'
print ' i64 atomicIncrement(Text tableName, Text row, Text column, i64 value)'
print ' void deleteAll(Text tableName, Text row, Text column, attributes)'
print ' void deleteAllTs(Text tableName, Text row, Text column, i64 timestamp, attributes)'
print ' void deleteAllRow(Text tableName, Text row, attributes)'
print ' void increment(TIncrement increment)'
print ' void incrementRows( increments)'
print ' void deleteAllRowTs(Text tableName, Text row, i64 timestamp, attributes)'
print ' ScannerID scannerOpenWithScan(Text tableName, TScan scan, attributes)'
print ' ScannerID scannerOpen(Text tableName, Text startRow, columns, attributes)'
print ' ScannerID scannerOpenWithStop(Text tableName, Text startRow, Text stopRow, columns, attributes)'
print ' ScannerID scannerOpenWithPrefix(Text tableName, Text startAndPrefix, columns, attributes)'
print ' ScannerID scannerOpenTs(Text tableName, Text startRow, columns, i64 timestamp, attributes)'
print ' ScannerID scannerOpenWithStopTs(Text tableName, Text startRow, Text stopRow, columns, i64 timestamp, attributes)'
print ' scannerGet(ScannerID id)'
print ' scannerGetList(ScannerID id, i32 nbRows)'
print ' void scannerClose(ScannerID id)'
print ' getRowOrBefore(Text tableName, Text row, Text family)'
print ' TRegionInfo getRegionInfo(Text row)'
print ''
sys.exit(0)
print('')
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
print('')
print('Functions:')
print(' void enableTable(Bytes tableName)')
print(' void disableTable(Bytes tableName)')
print(' bool isTableEnabled(Bytes tableName)')
print(' void compact(Bytes tableNameOrRegionName)')
print(' void majorCompact(Bytes tableNameOrRegionName)')
print(' getTableNames()')
print(' getColumnDescriptors(Text tableName)')
print(' getTableRegions(Text tableName)')
print(' void createTable(Text tableName, columnFamilies)')
print(' void deleteTable(Text tableName)')
print(' get(Text tableName, Text row, Text column, attributes)')
print(' getVer(Text tableName, Text row, Text column, i32 numVersions, attributes)')
print(' getVerTs(Text tableName, Text row, Text column, i64 timestamp, i32 numVersions, attributes)')
print(' getRow(Text tableName, Text row, attributes)')
print(' getRowWithColumns(Text tableName, Text row, columns, attributes)')
print(' getRowTs(Text tableName, Text row, i64 timestamp, attributes)')
print(' getRowWithColumnsTs(Text tableName, Text row, columns, i64 timestamp, attributes)')
print(' getRows(Text tableName, rows, attributes)')
print(' getRowsWithColumns(Text tableName, rows, columns, attributes)')
print(' getRowsTs(Text tableName, rows, i64 timestamp, attributes)')
print(' getRowsWithColumnsTs(Text tableName, rows, columns, i64 timestamp, attributes)')
print(' void mutateRow(Text tableName, Text row, mutations, attributes)')
print(' void mutateRowTs(Text tableName, Text row, mutations, i64 timestamp, attributes)')
print(' void mutateRows(Text tableName, rowBatches, attributes)')
print(' void mutateRowsTs(Text tableName, rowBatches, i64 timestamp, attributes)')
print(' i64 atomicIncrement(Text tableName, Text row, Text column, i64 value)')
print(' void deleteAll(Text tableName, Text row, Text column, attributes)')
print(' void deleteAllTs(Text tableName, Text row, Text column, i64 timestamp, attributes)')
print(' void deleteAllRow(Text tableName, Text row, attributes)')
print(' void increment(TIncrement increment)')
print(' void incrementRows( increments)')
print(' void deleteAllRowTs(Text tableName, Text row, i64 timestamp, attributes)')
print(' ScannerID scannerOpenWithScan(Text tableName, TScan scan, attributes)')
print(' ScannerID scannerOpen(Text tableName, Text startRow, columns, attributes)')
print(' ScannerID scannerOpenWithStop(Text tableName, Text startRow, Text stopRow, columns, attributes)')
print(' ScannerID scannerOpenWithPrefix(Text tableName, Text startAndPrefix, columns, attributes)')
print(' ScannerID scannerOpenTs(Text tableName, Text startRow, columns, i64 timestamp, attributes)')
print(' ScannerID scannerOpenWithStopTs(Text tableName, Text startRow, Text stopRow, columns, i64 timestamp, attributes)')
print(' scannerGet(ScannerID id)')
print(' scannerGetList(ScannerID id, i32 nbRows)')
print(' void scannerClose(ScannerID id)')
print(' TRegionInfo getRegionInfo(Text row)')
print(' append(TAppend append)')
print(' bool checkAndPut(Text tableName, Text row, Text column, Text value, Mutation mput, attributes)')
print(' TThriftServerType getThriftServerType()')
print('')
sys.exit(0)
pp = pprint.PrettyPrinter(indent = 2)
pp = pprint.PrettyPrinter(indent=2)
host = 'localhost'
port = 9090
uri = ''
framed = False
ssl = False
validate = True
ca_certs = None
keyfile = None
certfile = None
http = False
argi = 1
if sys.argv[argi] == '-h':
parts = sys.argv[argi+1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
argi += 2
parts = sys.argv[argi + 1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
argi += 2
if sys.argv[argi] == '-u':
url = urlparse(sys.argv[argi+1])
parts = url[1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
else:
port = 80
uri = url[2]
if url[4]:
uri += '?%s' % url[4]
http = True
argi += 2
url = urlparse(sys.argv[argi + 1])
parts = url[1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
else:
port = 80
uri = url[2]
if url[4]:
uri += '?%s' % url[4]
http = True
argi += 2
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
framed = True
argi += 1
framed = True
argi += 1
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
ssl = True
argi += 1
if sys.argv[argi] == '-novalidate':
validate = False
argi += 1
if sys.argv[argi] == '-ca_certs':
ca_certs = sys.argv[argi+1]
argi += 2
if sys.argv[argi] == '-keyfile':
keyfile = sys.argv[argi+1]
argi += 2
if sys.argv[argi] == '-certfile':
certfile = sys.argv[argi+1]
argi += 2
cmd = sys.argv[argi]
args = sys.argv[argi+1:]
args = sys.argv[argi + 1:]
if http:
transport = THttpClient.THttpClient(host, port, uri)
transport = THttpClient.THttpClient(host, port, uri)
else:
socket = TSocket.TSocket(host, port)
if framed:
transport = TTransport.TFramedTransport(socket)
else:
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
if ssl:
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
else:
socket = TSocket.TSocket(host, port)
if framed:
transport = TTransport.TFramedTransport(socket)
else:
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol(transport)
client = Hbase.Client(protocol)
transport.open()
if cmd == 'enableTable':
if len(args) != 1:
print 'enableTable requires 1 args'
sys.exit(1)
pp.pprint(client.enableTable(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.disableTable(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.isTableEnabled(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.compact(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.majorCompact(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.getTableNames())
if len(args) != 0:
print('getTableNames requires 0 args')
sys.exit(1)
pp.pprint(client.getTableNames())
elif cmd == 'getColumnDescriptors':
if len(args) != 1:
print 'getColumnDescriptors requires 1 args'
sys.exit(1)
pp.pprint(client.getColumnDescriptors(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.getTableRegions(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.createTable(eval(args[0]),eval(args[1]),))
if len(args) != 2:
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'
sys.exit(1)
pp.pprint(client.deleteTable(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.get(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.getVer(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
if len(args) != 5:
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'
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]),))
if len(args) != 6:
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'
sys.exit(1)
pp.pprint(client.getRow(eval(args[0]),eval(args[1]),eval(args[2]),))
if len(args) != 3:
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'
sys.exit(1)
pp.pprint(client.getRowWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.getRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.getRowWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
if len(args) != 5:
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'
sys.exit(1)
pp.pprint(client.getRows(eval(args[0]),eval(args[1]),eval(args[2]),))
if len(args) != 3:
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'
sys.exit(1)
pp.pprint(client.getRowsWithColumns(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.getRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.getRowsWithColumnsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
if len(args) != 5:
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'
sys.exit(1)
pp.pprint(client.mutateRow(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.mutateRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
if len(args) != 5:
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'
sys.exit(1)
pp.pprint(client.mutateRows(eval(args[0]),eval(args[1]),eval(args[2]),))
if len(args) != 3:
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'
sys.exit(1)
pp.pprint(client.mutateRowsTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.atomicIncrement(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.deleteAll(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.deleteAllTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
if len(args) != 5:
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'
sys.exit(1)
pp.pprint(client.deleteAllRow(eval(args[0]),eval(args[1]),eval(args[2]),))
if len(args) != 3:
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'
sys.exit(1)
pp.pprint(client.increment(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.incrementRows(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.deleteAllRowTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.scannerOpenWithScan(eval(args[0]),eval(args[1]),eval(args[2]),))
if len(args) != 3:
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'
sys.exit(1)
pp.pprint(client.scannerOpen(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.scannerOpenWithStop(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
if len(args) != 5:
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'
sys.exit(1)
pp.pprint(client.scannerOpenWithPrefix(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),))
if len(args) != 4:
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'
sys.exit(1)
pp.pprint(client.scannerOpenTs(eval(args[0]),eval(args[1]),eval(args[2]),eval(args[3]),eval(args[4]),))
if len(args) != 5:
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'
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]),))
if len(args) != 6:
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'
sys.exit(1)
pp.pprint(client.scannerGet(eval(args[0]),))
if len(args) != 1:
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'
sys.exit(1)
pp.pprint(client.scannerGetList(eval(args[0]),eval(args[1]),))
if len(args) != 2:
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'
sys.exit(1)
pp.pprint(client.scannerClose(eval(args[0]),))
elif cmd == 'getRowOrBefore':
if len(args) != 3:
print 'getRowOrBefore requires 3 args'
sys.exit(1)
pp.pprint(client.getRowOrBefore(eval(args[0]),eval(args[1]),eval(args[2]),))
if len(args) != 1:
print('scannerClose requires 1 args')
sys.exit(1)
pp.pprint(client.scannerClose(eval(args[0]),))
elif cmd == 'getRegionInfo':
if len(args) != 1:
print 'getRegionInfo requires 1 args'
sys.exit(1)
pp.pprint(client.getRegionInfo(eval(args[0]),))
if len(args) != 1:
print('getRegionInfo requires 1 args')
sys.exit(1)
pp.pprint(client.getRegionInfo(eval(args[0]),))
elif cmd == 'append':
if len(args) != 1:
print('append requires 1 args')
sys.exit(1)
pp.pprint(client.append(eval(args[0]),))
elif cmd == 'checkAndPut':
if len(args) != 6:
print('checkAndPut requires 6 args')
sys.exit(1)
pp.pprint(client.checkAndPut(eval(args[0]), eval(args[1]), eval(args[2]), eval(args[3]), eval(args[4]), eval(args[5]),))
elif cmd == 'getThriftServerType':
if len(args) != 0:
print('getThriftServerType requires 0 args')
sys.exit(1)
pp.pprint(client.getThriftServerType())
else:
print 'Unrecognized method %s' % cmd
sys.exit(1)
print('Unrecognized method %s' % cmd)
sys.exit(1)
transport.close()

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,14 @@
#
# Autogenerated by Thrift Compiler (0.9.0)
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec
import sys
from .ttypes import *

File diff suppressed because it is too large Load Diff

View File

@ -61,6 +61,11 @@ client = THBaseService.Client(protocol)
transport.open()
# Check Thrift Server Type
serverType = client.getThriftServerType()
if serverType != TThriftServerType.TWO:
raise Exception("Mismatch between client and server, server type is %s" % serverType)
table = "example"
put = TPut(row="row1", columnValues=[TColumnValue(family="family1",qualifier="qualifier1",value="value1")])

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
#
# Autogenerated by Thrift Compiler (0.9.3)
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
@ -9,219 +9,431 @@
import sys
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
if sys.version_info[0] > 2:
from urllib.parse import urlparse
else:
from urlparse import urlparse
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
from hbase import THBaseService
from hbase.ttypes import *
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print('')
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] function [arg1 [arg2...]]')
print('')
print('Functions:')
print(' bool exists(string table, TGet tget)')
print(' existsAll(string table, tgets)')
print(' TResult get(string table, TGet tget)')
print(' getMultiple(string table, tgets)')
print(' void put(string table, TPut tput)')
print(' bool checkAndPut(string table, string row, string family, string qualifier, string value, TPut tput)')
print(' void putMultiple(string table, tputs)')
print(' void deleteSingle(string table, TDelete tdelete)')
print(' deleteMultiple(string table, tdeletes)')
print(' bool checkAndDelete(string table, string row, string family, string qualifier, string value, TDelete tdelete)')
print(' TResult increment(string table, TIncrement tincrement)')
print(' TResult append(string table, TAppend tappend)')
print(' i32 openScanner(string table, TScan tscan)')
print(' getScannerRows(i32 scannerId, i32 numRows)')
print(' void closeScanner(i32 scannerId)')
print(' void mutateRow(string table, TRowMutations trowMutations)')
print(' getScannerResults(string table, TScan tscan, i32 numRows)')
print(' THRegionLocation getRegionLocation(string table, string row, bool reload)')
print(' getAllRegionLocations(string table)')
print(' bool checkAndMutate(string table, string row, string family, string qualifier, TCompareOp compareOp, string value, TRowMutations rowMutations)')
print('')
sys.exit(0)
print('')
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
print('')
print('Functions:')
print(' bool exists(string table, TGet tget)')
print(' existsAll(string table, tgets)')
print(' TResult get(string table, TGet tget)')
print(' getMultiple(string table, tgets)')
print(' void put(string table, TPut tput)')
print(' bool checkAndPut(string table, string row, string family, string qualifier, string value, TPut tput)')
print(' void putMultiple(string table, tputs)')
print(' void deleteSingle(string table, TDelete tdelete)')
print(' deleteMultiple(string table, tdeletes)')
print(' bool checkAndDelete(string table, string row, string family, string qualifier, string value, TDelete tdelete)')
print(' TResult increment(string table, TIncrement tincrement)')
print(' TResult append(string table, TAppend tappend)')
print(' i32 openScanner(string table, TScan tscan)')
print(' getScannerRows(i32 scannerId, i32 numRows)')
print(' void closeScanner(i32 scannerId)')
print(' void mutateRow(string table, TRowMutations trowMutations)')
print(' getScannerResults(string table, TScan tscan, i32 numRows)')
print(' THRegionLocation getRegionLocation(string table, string row, bool reload)')
print(' getAllRegionLocations(string table)')
print(' bool checkAndMutate(string table, string row, string family, string qualifier, TCompareOperator compareOperator, string value, TRowMutations rowMutations)')
print(' TTableDescriptor getTableDescriptor(TTableName table)')
print(' getTableDescriptors( tables)')
print(' bool tableExists(TTableName tableName)')
print(' getTableDescriptorsByPattern(string regex, bool includeSysTables)')
print(' getTableDescriptorsByNamespace(string name)')
print(' getTableNamesByPattern(string regex, bool includeSysTables)')
print(' getTableNamesByNamespace(string name)')
print(' void createTable(TTableDescriptor desc, splitKeys)')
print(' void deleteTable(TTableName tableName)')
print(' void truncateTable(TTableName tableName, bool preserveSplits)')
print(' void enableTable(TTableName tableName)')
print(' void disableTable(TTableName tableName)')
print(' bool isTableEnabled(TTableName tableName)')
print(' bool isTableDisabled(TTableName tableName)')
print(' bool isTableAvailable(TTableName tableName)')
print(' bool isTableAvailableWithSplit(TTableName tableName, splitKeys)')
print(' void addColumnFamily(TTableName tableName, TColumnFamilyDescriptor column)')
print(' void deleteColumnFamily(TTableName tableName, string column)')
print(' void modifyColumnFamily(TTableName tableName, TColumnFamilyDescriptor column)')
print(' void modifyTable(TTableDescriptor desc)')
print(' void createNamespace(TNamespaceDescriptor namespaceDesc)')
print(' void modifyNamespace(TNamespaceDescriptor namespaceDesc)')
print(' void deleteNamespace(string name)')
print(' TNamespaceDescriptor getNamespaceDescriptor(string name)')
print(' listNamespaceDescriptors()')
print(' listNamespaces()')
print(' TThriftServerType getThriftServerType()')
print('')
sys.exit(0)
pp = pprint.PrettyPrinter(indent = 2)
pp = pprint.PrettyPrinter(indent=2)
host = 'localhost'
port = 9090
uri = ''
framed = False
ssl = False
validate = True
ca_certs = None
keyfile = None
certfile = None
http = False
argi = 1
if sys.argv[argi] == '-h':
parts = sys.argv[argi+1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
argi += 2
parts = sys.argv[argi + 1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
argi += 2
if sys.argv[argi] == '-u':
url = urlparse(sys.argv[argi+1])
parts = url[1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
else:
port = 80
uri = url[2]
if url[4]:
uri += '?%s' % url[4]
http = True
argi += 2
url = urlparse(sys.argv[argi + 1])
parts = url[1].split(':')
host = parts[0]
if len(parts) > 1:
port = int(parts[1])
else:
port = 80
uri = url[2]
if url[4]:
uri += '?%s' % url[4]
http = True
argi += 2
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
framed = True
argi += 1
framed = True
argi += 1
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
ssl = True
argi += 1
ssl = True
argi += 1
if sys.argv[argi] == '-novalidate':
validate = False
argi += 1
if sys.argv[argi] == '-ca_certs':
ca_certs = sys.argv[argi+1]
argi += 2
if sys.argv[argi] == '-keyfile':
keyfile = sys.argv[argi+1]
argi += 2
if sys.argv[argi] == '-certfile':
certfile = sys.argv[argi+1]
argi += 2
cmd = sys.argv[argi]
args = sys.argv[argi+1:]
args = sys.argv[argi + 1:]
if http:
transport = THttpClient.THttpClient(host, port, uri)
transport = THttpClient.THttpClient(host, port, uri)
else:
socket = TSSLSocket.TSSLSocket(host, port, validate=False) if ssl else TSocket.TSocket(host, port)
if framed:
transport = TTransport.TFramedTransport(socket)
else:
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
if ssl:
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
else:
socket = TSocket.TSocket(host, port)
if framed:
transport = TTransport.TFramedTransport(socket)
else:
transport = TTransport.TBufferedTransport(socket)
protocol = TBinaryProtocol(transport)
client = THBaseService.Client(protocol)
transport.open()
if cmd == 'exists':
if len(args) != 2:
print('exists requires 2 args')
sys.exit(1)
pp.pprint(client.exists(args[0],eval(args[1]),))
if len(args) != 2:
print('exists requires 2 args')
sys.exit(1)
pp.pprint(client.exists(args[0], eval(args[1]),))
elif cmd == 'existsAll':
if len(args) != 2:
print('existsAll requires 2 args')
sys.exit(1)
pp.pprint(client.existsAll(args[0],eval(args[1]),))
if len(args) != 2:
print('existsAll requires 2 args')
sys.exit(1)
pp.pprint(client.existsAll(args[0], eval(args[1]),))
elif cmd == 'get':
if len(args) != 2:
print('get requires 2 args')
sys.exit(1)
pp.pprint(client.get(args[0],eval(args[1]),))
if len(args) != 2:
print('get requires 2 args')
sys.exit(1)
pp.pprint(client.get(args[0], eval(args[1]),))
elif cmd == 'getMultiple':
if len(args) != 2:
print('getMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.getMultiple(args[0],eval(args[1]),))
if len(args) != 2:
print('getMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.getMultiple(args[0], eval(args[1]),))
elif cmd == 'put':
if len(args) != 2:
print('put requires 2 args')
sys.exit(1)
pp.pprint(client.put(args[0],eval(args[1]),))
if len(args) != 2:
print('put requires 2 args')
sys.exit(1)
pp.pprint(client.put(args[0], eval(args[1]),))
elif cmd == 'checkAndPut':
if len(args) != 6:
print('checkAndPut requires 6 args')
sys.exit(1)
pp.pprint(client.checkAndPut(args[0],args[1],args[2],args[3],args[4],eval(args[5]),))
if len(args) != 6:
print('checkAndPut requires 6 args')
sys.exit(1)
pp.pprint(client.checkAndPut(args[0], args[1], args[2], args[3], args[4], eval(args[5]),))
elif cmd == 'putMultiple':
if len(args) != 2:
print('putMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.putMultiple(args[0],eval(args[1]),))
if len(args) != 2:
print('putMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.putMultiple(args[0], eval(args[1]),))
elif cmd == 'deleteSingle':
if len(args) != 2:
print('deleteSingle requires 2 args')
sys.exit(1)
pp.pprint(client.deleteSingle(args[0],eval(args[1]),))
if len(args) != 2:
print('deleteSingle requires 2 args')
sys.exit(1)
pp.pprint(client.deleteSingle(args[0], eval(args[1]),))
elif cmd == 'deleteMultiple':
if len(args) != 2:
print('deleteMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.deleteMultiple(args[0],eval(args[1]),))
if len(args) != 2:
print('deleteMultiple requires 2 args')
sys.exit(1)
pp.pprint(client.deleteMultiple(args[0], eval(args[1]),))
elif cmd == 'checkAndDelete':
if len(args) != 6:
print('checkAndDelete requires 6 args')
sys.exit(1)
pp.pprint(client.checkAndDelete(args[0],args[1],args[2],args[3],args[4],eval(args[5]),))
if len(args) != 6:
print('checkAndDelete requires 6 args')
sys.exit(1)
pp.pprint(client.checkAndDelete(args[0], args[1], args[2], args[3], args[4], eval(args[5]),))
elif cmd == 'increment':
if len(args) != 2:
print('increment requires 2 args')
sys.exit(1)
pp.pprint(client.increment(args[0],eval(args[1]),))
if len(args) != 2:
print('increment requires 2 args')
sys.exit(1)
pp.pprint(client.increment(args[0], eval(args[1]),))
elif cmd == 'append':
if len(args) != 2:
print('append requires 2 args')
sys.exit(1)
pp.pprint(client.append(args[0],eval(args[1]),))
if len(args) != 2:
print('append requires 2 args')
sys.exit(1)
pp.pprint(client.append(args[0], eval(args[1]),))
elif cmd == 'openScanner':
if len(args) != 2:
print('openScanner requires 2 args')
sys.exit(1)
pp.pprint(client.openScanner(args[0],eval(args[1]),))
if len(args) != 2:
print('openScanner requires 2 args')
sys.exit(1)
pp.pprint(client.openScanner(args[0], eval(args[1]),))
elif cmd == 'getScannerRows':
if len(args) != 2:
print('getScannerRows requires 2 args')
sys.exit(1)
pp.pprint(client.getScannerRows(eval(args[0]),eval(args[1]),))
if len(args) != 2:
print('getScannerRows requires 2 args')
sys.exit(1)
pp.pprint(client.getScannerRows(eval(args[0]), eval(args[1]),))
elif cmd == 'closeScanner':
if len(args) != 1:
print('closeScanner requires 1 args')
sys.exit(1)
pp.pprint(client.closeScanner(eval(args[0]),))
if len(args) != 1:
print('closeScanner requires 1 args')
sys.exit(1)
pp.pprint(client.closeScanner(eval(args[0]),))
elif cmd == 'mutateRow':
if len(args) != 2:
print('mutateRow requires 2 args')
sys.exit(1)
pp.pprint(client.mutateRow(args[0],eval(args[1]),))
if len(args) != 2:
print('mutateRow requires 2 args')
sys.exit(1)
pp.pprint(client.mutateRow(args[0], eval(args[1]),))
elif cmd == 'getScannerResults':
if len(args) != 3:
print('getScannerResults requires 3 args')
sys.exit(1)
pp.pprint(client.getScannerResults(args[0],eval(args[1]),eval(args[2]),))
if len(args) != 3:
print('getScannerResults requires 3 args')
sys.exit(1)
pp.pprint(client.getScannerResults(args[0], eval(args[1]), eval(args[2]),))
elif cmd == 'getRegionLocation':
if len(args) != 3:
print('getRegionLocation requires 3 args')
sys.exit(1)
pp.pprint(client.getRegionLocation(args[0],args[1],eval(args[2]),))
if len(args) != 3:
print('getRegionLocation requires 3 args')
sys.exit(1)
pp.pprint(client.getRegionLocation(args[0], args[1], eval(args[2]),))
elif cmd == 'getAllRegionLocations':
if len(args) != 1:
print('getAllRegionLocations requires 1 args')
sys.exit(1)
pp.pprint(client.getAllRegionLocations(args[0],))
if len(args) != 1:
print('getAllRegionLocations requires 1 args')
sys.exit(1)
pp.pprint(client.getAllRegionLocations(args[0],))
elif cmd == 'checkAndMutate':
if len(args) != 7:
print('checkAndMutate requires 7 args')
sys.exit(1)
pp.pprint(client.checkAndMutate(args[0],args[1],args[2],args[3],eval(args[4]),args[5],eval(args[6]),))
if len(args) != 7:
print('checkAndMutate requires 7 args')
sys.exit(1)
pp.pprint(client.checkAndMutate(args[0], args[1], args[2], args[3], eval(args[4]), args[5], eval(args[6]),))
elif cmd == 'getTableDescriptor':
if len(args) != 1:
print('getTableDescriptor requires 1 args')
sys.exit(1)
pp.pprint(client.getTableDescriptor(eval(args[0]),))
elif cmd == 'getTableDescriptors':
if len(args) != 1:
print('getTableDescriptors requires 1 args')
sys.exit(1)
pp.pprint(client.getTableDescriptors(eval(args[0]),))
elif cmd == 'tableExists':
if len(args) != 1:
print('tableExists requires 1 args')
sys.exit(1)
pp.pprint(client.tableExists(eval(args[0]),))
elif cmd == 'getTableDescriptorsByPattern':
if len(args) != 2:
print('getTableDescriptorsByPattern requires 2 args')
sys.exit(1)
pp.pprint(client.getTableDescriptorsByPattern(args[0], eval(args[1]),))
elif cmd == 'getTableDescriptorsByNamespace':
if len(args) != 1:
print('getTableDescriptorsByNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.getTableDescriptorsByNamespace(args[0],))
elif cmd == 'getTableNamesByPattern':
if len(args) != 2:
print('getTableNamesByPattern requires 2 args')
sys.exit(1)
pp.pprint(client.getTableNamesByPattern(args[0], eval(args[1]),))
elif cmd == 'getTableNamesByNamespace':
if len(args) != 1:
print('getTableNamesByNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.getTableNamesByNamespace(args[0],))
elif cmd == 'createTable':
if len(args) != 2:
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')
sys.exit(1)
pp.pprint(client.deleteTable(eval(args[0]),))
elif cmd == 'truncateTable':
if len(args) != 2:
print('truncateTable requires 2 args')
sys.exit(1)
pp.pprint(client.truncateTable(eval(args[0]), eval(args[1]),))
elif cmd == 'enableTable':
if len(args) != 1:
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')
sys.exit(1)
pp.pprint(client.disableTable(eval(args[0]),))
elif cmd == 'isTableEnabled':
if len(args) != 1:
print('isTableEnabled requires 1 args')
sys.exit(1)
pp.pprint(client.isTableEnabled(eval(args[0]),))
elif cmd == 'isTableDisabled':
if len(args) != 1:
print('isTableDisabled requires 1 args')
sys.exit(1)
pp.pprint(client.isTableDisabled(eval(args[0]),))
elif cmd == 'isTableAvailable':
if len(args) != 1:
print('isTableAvailable requires 1 args')
sys.exit(1)
pp.pprint(client.isTableAvailable(eval(args[0]),))
elif cmd == 'isTableAvailableWithSplit':
if len(args) != 2:
print('isTableAvailableWithSplit requires 2 args')
sys.exit(1)
pp.pprint(client.isTableAvailableWithSplit(eval(args[0]), eval(args[1]),))
elif cmd == 'addColumnFamily':
if len(args) != 2:
print('addColumnFamily requires 2 args')
sys.exit(1)
pp.pprint(client.addColumnFamily(eval(args[0]), eval(args[1]),))
elif cmd == 'deleteColumnFamily':
if len(args) != 2:
print('deleteColumnFamily requires 2 args')
sys.exit(1)
pp.pprint(client.deleteColumnFamily(eval(args[0]), args[1],))
elif cmd == 'modifyColumnFamily':
if len(args) != 2:
print('modifyColumnFamily requires 2 args')
sys.exit(1)
pp.pprint(client.modifyColumnFamily(eval(args[0]), eval(args[1]),))
elif cmd == 'modifyTable':
if len(args) != 1:
print('modifyTable requires 1 args')
sys.exit(1)
pp.pprint(client.modifyTable(eval(args[0]),))
elif cmd == 'createNamespace':
if len(args) != 1:
print('createNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.createNamespace(eval(args[0]),))
elif cmd == 'modifyNamespace':
if len(args) != 1:
print('modifyNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.modifyNamespace(eval(args[0]),))
elif cmd == 'deleteNamespace':
if len(args) != 1:
print('deleteNamespace requires 1 args')
sys.exit(1)
pp.pprint(client.deleteNamespace(args[0],))
elif cmd == 'getNamespaceDescriptor':
if len(args) != 1:
print('getNamespaceDescriptor requires 1 args')
sys.exit(1)
pp.pprint(client.getNamespaceDescriptor(args[0],))
elif cmd == 'listNamespaceDescriptors':
if len(args) != 0:
print('listNamespaceDescriptors requires 0 args')
sys.exit(1)
pp.pprint(client.listNamespaceDescriptors())
elif cmd == 'listNamespaces':
if len(args) != 0:
print('listNamespaces requires 0 args')
sys.exit(1)
pp.pprint(client.listNamespaces())
elif cmd == 'getThriftServerType':
if len(args) != 0:
print('getThriftServerType requires 0 args')
sys.exit(1)
pp.pprint(client.getThriftServerType())
else:
print('Unrecognized method %s' % cmd)
sys.exit(1)
print('Unrecognized method %s' % cmd)
sys.exit(1)
transport.close()

View File

@ -1,11 +1,14 @@
#
# Autogenerated by Thrift Compiler (0.9.3)
# Autogenerated by Thrift Compiler (0.12.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolException
from thrift.TRecursive import fix_spec
import sys
from .ttypes import *

File diff suppressed because it is too large Load Diff

View File

@ -85,6 +85,4 @@ public abstract class HBaseServiceHandler {
protected Table getTable(final ByteBuffer tableName) throws IOException {
return getTable(Bytes.getBytes(tableName));
}
}

View File

@ -77,6 +77,7 @@ import org.apache.hadoop.hbase.thrift.generated.TIncrement;
import org.apache.hadoop.hbase.thrift.generated.TRegionInfo;
import org.apache.hadoop.hbase.thrift.generated.TRowResult;
import org.apache.hadoop.hbase.thrift.generated.TScan;
import org.apache.hadoop.hbase.thrift.generated.TThriftServerType;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.thrift.TException;
import org.apache.yetus.audience.InterfaceAudience;
@ -1266,6 +1267,11 @@ public class ThriftHBaseServiceHandler extends HBaseServiceHandler implements Hb
}
}
@Override
public TThriftServerType getThriftServerType() {
return TThriftServerType.ONE;
}
private static IOError getIOError(Throwable throwable) {
IOError error = new IOErrorWithCause(throwable);
error.setMessage(Throwables.getStackTraceAsString(throwable));

View File

@ -61,11 +61,11 @@ public class ThriftMetrics {
public static final String SLOW_RESPONSE_NANO_SEC =
"hbase.thrift.slow.response.nano.second";
public static final long DEFAULT_SLOW_RESPONSE_NANO_SEC = 10 * 1000 * 1000;
private final ThriftServerType thriftServerType;
public ThriftMetrics(Configuration conf, ThriftServerType t) {
slowResponseTime = conf.getLong(SLOW_RESPONSE_NANO_SEC, DEFAULT_SLOW_RESPONSE_NANO_SEC);
thriftServerType = t;
if (t == ThriftServerType.ONE) {
source = CompatibilitySingletonFactory.getInstance(MetricsThriftServerSourceFactory.class)
.createThriftOneSource();
@ -158,4 +158,8 @@ public class ThriftMetrics {
}
return ClientExceptionsUtil.findException(t);
}
public ThriftServerType getThriftServerType() {
return thriftServerType;
}
}

View File

@ -304,6 +304,7 @@ public class ThriftServer extends Configured implements Tool {
.get(THRIFT_INFO_SERVER_BINDING_ADDRESS, THRIFT_INFO_SERVER_BINDING_ADDRESS_DEFAULT);
infoServer = new InfoServer("thrift", a, port, false, conf);
infoServer.setAttribute("hbase.conf", conf);
infoServer.setAttribute("hbase.thrift.server.type", metrics.getThriftServerType());
infoServer.start();
}
}

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift.generated;
* An AlreadyExists exceptions signals that a table with the specified
* name already exists
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class AlreadyExists extends org.apache.thrift.TException implements org.apache.thrift.TBase<AlreadyExists, AlreadyExists._Fields>, java.io.Serializable, Cloneable, Comparable<AlreadyExists> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyExists");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift.generated;
/**
* A BatchMutation object is used to apply a number of Mutations to a single row.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class BatchMutation implements org.apache.thrift.TBase<BatchMutation, BatchMutation._Fields>, java.io.Serializable, Cloneable, Comparable<BatchMutation> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BatchMutation");

View File

@ -12,7 +12,7 @@ package org.apache.hadoop.hbase.thrift.generated;
* such as the number of versions, compression settings, etc. It is
* used as input when creating a table or adding a column.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class ColumnDescriptor implements org.apache.thrift.TBase<ColumnDescriptor, ColumnDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<ColumnDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColumnDescriptor");

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class Hbase {
public interface Iface {
@ -615,6 +615,13 @@ public class Hbase {
*/
public boolean checkAndPut(java.nio.ByteBuffer tableName, java.nio.ByteBuffer row, java.nio.ByteBuffer column, java.nio.ByteBuffer value, Mutation mput, java.util.Map<java.nio.ByteBuffer,java.nio.ByteBuffer> attributes) throws IOError, IllegalArgument, org.apache.thrift.TException;
/**
* Get the type of this thrift server.
*
* @return the type of this thrift server
*/
public TThriftServerType getThriftServerType() throws org.apache.thrift.TException;
}
public interface AsyncIface {
@ -707,6 +714,8 @@ public class Hbase {
public void checkAndPut(java.nio.ByteBuffer tableName, java.nio.ByteBuffer row, java.nio.ByteBuffer column, java.nio.ByteBuffer value, Mutation mput, java.util.Map<java.nio.ByteBuffer,java.nio.ByteBuffer> attributes, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;
public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@ -1945,6 +1954,28 @@ public class Hbase {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "checkAndPut failed: unknown result");
}
public TThriftServerType getThriftServerType() throws org.apache.thrift.TException
{
send_getThriftServerType();
return recv_getThriftServerType();
}
public void send_getThriftServerType() throws org.apache.thrift.TException
{
getThriftServerType_args args = new getThriftServerType_args();
sendBase("getThriftServerType", args);
}
public TThriftServerType recv_getThriftServerType() throws org.apache.thrift.TException
{
getThriftServerType_result result = new getThriftServerType_result();
receiveBase(result, "getThriftServerType");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getThriftServerType failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@ -3641,6 +3672,35 @@ public class Hbase {
}
}
public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler) throws org.apache.thrift.TException {
checkReady();
getThriftServerType_call method_call = new getThriftServerType_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getThriftServerType_call extends org.apache.thrift.async.TAsyncMethodCall<TThriftServerType> {
public getThriftServerType_call(org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getThriftServerType", org.apache.thrift.protocol.TMessageType.CALL, 0));
getThriftServerType_args args = new getThriftServerType_args();
args.write(prot);
prot.writeMessageEnd();
}
public TThriftServerType getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getThriftServerType();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@ -3698,6 +3758,7 @@ public class Hbase {
processMap.put("getRegionInfo", new getRegionInfo());
processMap.put("append", new append());
processMap.put("checkAndPut", new checkAndPut());
processMap.put("getThriftServerType", new getThriftServerType());
return processMap;
}
@ -5008,6 +5069,31 @@ public class Hbase {
}
}
public static class getThriftServerType<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getThriftServerType_args> {
public getThriftServerType() {
super("getThriftServerType");
}
public getThriftServerType_args getEmptyArgsInstance() {
return new getThriftServerType_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public getThriftServerType_result getResult(I iface, getThriftServerType_args args) throws org.apache.thrift.TException {
getThriftServerType_result result = new getThriftServerType_result();
result.success = iface.getThriftServerType();
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@ -5065,6 +5151,7 @@ public class Hbase {
processMap.put("getRegionInfo", new getRegionInfo());
processMap.put("append", new append());
processMap.put("checkAndPut", new checkAndPut());
processMap.put("getThriftServerType", new getThriftServerType());
return processMap;
}
@ -7964,6 +8051,67 @@ public class Hbase {
}
}
public static class getThriftServerType<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getThriftServerType_args, TThriftServerType> {
public getThriftServerType() {
super("getThriftServerType");
}
public getThriftServerType_args getEmptyArgsInstance() {
return new getThriftServerType_args();
}
public org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<TThriftServerType>() {
public void onComplete(TThriftServerType o) {
getThriftServerType_result result = new getThriftServerType_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getThriftServerType_result result = new getThriftServerType_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getThriftServerType_args args, org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler) throws org.apache.thrift.TException {
iface.getThriftServerType(resultHandler);
}
}
}
public static class enableTable_args implements org.apache.thrift.TBase<enableTable_args, enableTable_args._Fields>, java.io.Serializable, Cloneable, Comparable<enableTable_args> {
@ -59799,4 +59947,641 @@ public class Hbase {
}
}
public static class getThriftServerType_args implements org.apache.thrift.TBase<getThriftServerType_args, getThriftServerType_args._Fields>, java.io.Serializable, Cloneable, Comparable<getThriftServerType_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_args");
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getThriftServerType_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getThriftServerType_argsTupleSchemeFactory();
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_args.class, metaDataMap);
}
public getThriftServerType_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getThriftServerType_args(getThriftServerType_args other) {
}
public getThriftServerType_args deepCopy() {
return new getThriftServerType_args(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getThriftServerType_args)
return this.equals((getThriftServerType_args)that);
return false;
}
public boolean equals(getThriftServerType_args that) {
if (that == null)
return false;
if (this == that)
return true;
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
return hashCode;
}
@Override
public int compareTo(getThriftServerType_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getThriftServerType_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getThriftServerType_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_argsStandardScheme getScheme() {
return new getThriftServerType_argsStandardScheme();
}
}
private static class getThriftServerType_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getThriftServerType_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getThriftServerType_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_argsTupleScheme getScheme() {
return new getThriftServerType_argsTupleScheme();
}
}
private static class getThriftServerType_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getThriftServerType_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getThriftServerType_result implements org.apache.thrift.TBase<getThriftServerType_result, getThriftServerType_result._Fields>, java.io.Serializable, Cloneable, Comparable<getThriftServerType_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getThriftServerType_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getThriftServerType_resultTupleSchemeFactory();
/**
*
* @see TThriftServerType
*/
public @org.apache.thrift.annotation.Nullable TThriftServerType success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
*
* @see TThriftServerType
*/
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TThriftServerType.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_result.class, metaDataMap);
}
public getThriftServerType_result() {
}
public getThriftServerType_result(
TThriftServerType success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getThriftServerType_result(getThriftServerType_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public getThriftServerType_result deepCopy() {
return new getThriftServerType_result(this);
}
@Override
public void clear() {
this.success = null;
}
/**
*
* @see TThriftServerType
*/
@org.apache.thrift.annotation.Nullable
public TThriftServerType getSuccess() {
return this.success;
}
/**
*
* @see TThriftServerType
*/
public getThriftServerType_result setSuccess(@org.apache.thrift.annotation.Nullable TThriftServerType success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((TThriftServerType)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getThriftServerType_result)
return this.equals((getThriftServerType_result)that);
return false;
}
public boolean equals(getThriftServerType_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.getValue();
return hashCode;
}
@Override
public int compareTo(getThriftServerType_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getThriftServerType_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getThriftServerType_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_resultStandardScheme getScheme() {
return new getThriftServerType_resultStandardScheme();
}
}
private static class getThriftServerType_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getThriftServerType_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.success = org.apache.hadoop.hbase.thrift.generated.TThriftServerType.findByValue(iprot.readI32());
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI32(struct.success.getValue());
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getThriftServerType_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_resultTupleScheme getScheme() {
return new getThriftServerType_resultTupleScheme();
}
}
private static class getThriftServerType_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getThriftServerType_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeI32(struct.success.getValue());
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = org.apache.hadoop.hbase.thrift.generated.TThriftServerType.findByValue(iprot.readI32());
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
}

View File

@ -12,7 +12,7 @@ package org.apache.hadoop.hbase.thrift.generated;
* to the Hbase master or an Hbase region server. Also used to return
* more general Hbase error conditions.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class IOError extends org.apache.thrift.TException implements org.apache.thrift.TBase<IOError, IOError._Fields>, java.io.Serializable, Cloneable, Comparable<IOError> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IOError");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift.generated;
* An IllegalArgument exception indicates an illegal or invalid
* argument was passed into a procedure.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class IllegalArgument extends org.apache.thrift.TException implements org.apache.thrift.TBase<IllegalArgument, IllegalArgument._Fields>, java.io.Serializable, Cloneable, Comparable<IllegalArgument> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IllegalArgument");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift.generated;
/**
* A Mutation object is used to either update or delete a column-value.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class Mutation implements org.apache.thrift.TBase<Mutation, Mutation._Fields>, java.io.Serializable, Cloneable, Comparable<Mutation> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Mutation");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift.generated;
/**
* An Append object is used to specify the parameters for performing the append operation.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields>, java.io.Serializable, Cloneable, Comparable<TAppend> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAppend");

View File

@ -13,7 +13,7 @@ package org.apache.hadoop.hbase.thrift.generated;
* the timestamp of a cell to a first-class value, making it easy to take
* note of temporal data. Cell is used all the way from HStore up to HTable.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TCell implements org.apache.thrift.TBase<TCell, TCell._Fields>, java.io.Serializable, Cloneable, Comparable<TCell> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCell");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift.generated;
/**
* Holds column name and the cell.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TColumn implements org.apache.thrift.TBase<TColumn, TColumn._Fields>, java.io.Serializable, Cloneable, Comparable<TColumn> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift.generated;
* For increments that are not incrementColumnValue
* equivalents.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncrement._Fields>, java.io.Serializable, Cloneable, Comparable<TIncrement> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIncrement");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift.generated;
/**
* A TRegionInfo contains information about an HTable region.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TRegionInfo implements org.apache.thrift.TBase<TRegionInfo, TRegionInfo._Fields>, java.io.Serializable, Cloneable, Comparable<TRegionInfo> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRegionInfo");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift.generated;
/**
* Holds row name and then a map of columns to cells.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TRowResult implements org.apache.thrift.TBase<TRowResult, TRowResult._Fields>, java.io.Serializable, Cloneable, Comparable<TRowResult> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowResult");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift.generated;
/**
* A Scan object is used to specify scanner parameters when opening a scanner.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable, Cloneable, Comparable<TScan> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");

View File

@ -0,0 +1,46 @@
/**
* Autogenerated by Thrift Compiler (0.12.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift.generated;
/**
* Specify type of thrift server: thrift and thrift2
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TThriftServerType implements org.apache.thrift.TEnum {
ONE(1),
TWO(2);
private final int value;
private TThriftServerType(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
@org.apache.thrift.annotation.Nullable
public static TThriftServerType findByValue(int value) {
switch (value) {
case 1:
return ONE;
case 2:
return TWO;
default:
return null;
}
}
}

View File

@ -84,6 +84,7 @@ import org.apache.hadoop.hbase.thrift2.generated.TRowMutations;
import org.apache.hadoop.hbase.thrift2.generated.TScan;
import org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TTableName;
import org.apache.hadoop.hbase.thrift2.generated.TThriftServerType;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.thrift.TException;
import org.apache.yetus.audience.InterfaceAudience;
@ -811,6 +812,11 @@ public class ThriftHBaseServiceHandler extends HBaseServiceHandler implements TH
}
}
@Override
public TThriftServerType getThriftServerType() {
return TThriftServerType.TWO;
}
@Override
public List<TNamespaceDescriptor> listNamespaceDescriptors() throws TIOError, TException {
try {

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TAppend implements org.apache.thrift.TBase<TAppend, TAppend._Fields>, java.io.Serializable, Cloneable, Comparable<TAppend> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAppend");

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TAuthorization implements org.apache.thrift.TBase<TAuthorization, TAuthorization._Fields>, java.io.Serializable, Cloneable, Comparable<TAuthorization> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAuthorization");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.regionserver.BloomType
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TBloomFilterType implements org.apache.thrift.TEnum {
/**
* Bloomfilters disabled

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TCellVisibility implements org.apache.thrift.TBase<TCellVisibility, TCellVisibility._Fields>, java.io.Serializable, Cloneable, Comparable<TCellVisibility> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCellVisibility");

View File

@ -12,7 +12,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* in a HBase table by column family and optionally
* a column qualifier and timestamp
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TColumn implements org.apache.thrift.TBase<TColumn, TColumn._Fields>, java.io.Serializable, Cloneable, Comparable<TColumn> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.client.ColumnFamilyDescriptor
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TColumnFamilyDescriptor implements org.apache.thrift.TBase<TColumnFamilyDescriptor, TColumnFamilyDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<TColumnFamilyDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnFamilyDescriptor");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
/**
* Represents a single cell and the amount to increment it by
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TColumnIncrement implements org.apache.thrift.TBase<TColumnIncrement, TColumnIncrement._Fields>, java.io.Serializable, Cloneable, Comparable<TColumnIncrement> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnIncrement");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
/**
* Represents a single cell and its value.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TColumnValue implements org.apache.thrift.TBase<TColumnValue, TColumnValue._Fields>, java.io.Serializable, Cloneable, Comparable<TColumnValue> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.CompareOperator.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TCompareOperator implements org.apache.thrift.TEnum {
LESS(0),
LESS_OR_EQUAL(1),

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.io.compress.Algorithm
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TCompressionAlgorithm implements org.apache.thrift.TEnum {
LZO(0),
GZ(1),

View File

@ -12,7 +12,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* - STRONG means reads only from primary region
* - TIMELINE means reads might return values from secondary region replicas
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TConsistency implements org.apache.thrift.TEnum {
STRONG(1),
TIMELINE(2);

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.io.encoding.DataBlockEncoding
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TDataBlockEncoding implements org.apache.thrift.TEnum {
/**
* Disable data block encoding.

View File

@ -33,7 +33,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* by changing the durability. If you don't provide durability, it defaults to
* column family's default setting for durability.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TDelete implements org.apache.thrift.TBase<TDelete, TDelete._Fields>, java.io.Serializable, Cloneable, Comparable<TDelete> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDelete");

View File

@ -12,7 +12,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* - DELETE_COLUMN means exactly one version will be removed,
* - DELETE_COLUMNS means previous versions will also be removed.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TDeleteType implements org.apache.thrift.TEnum {
DELETE_COLUMN(0),
DELETE_COLUMNS(1),

View File

@ -14,7 +14,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* - SYNC_WAL means write the Mutation to the WAL synchronously,
* - FSYNC_WAL means Write the Mutation to the WAL synchronously and force the entries to disk.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TDurability implements org.apache.thrift.TEnum {
USE_DEFAULT(0),
SKIP_WAL(1),

View File

@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* If you specify a time range and a timestamp the range is ignored.
* Timestamps on TColumns are ignored.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TGet implements org.apache.thrift.TBase<TGet, TGet._Fields>, java.io.Serializable, Cloneable, Comparable<TGet> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGet");

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class THBaseService {
public interface Iface {
@ -500,6 +500,13 @@ public class THBaseService {
*/
public java.util.List<java.lang.String> listNamespaces() throws TIOError, org.apache.thrift.TException;
/**
* Get the type of this thrift server.
*
* @return the type of this thrift server
*/
public TThriftServerType getThriftServerType() throws org.apache.thrift.TException;
}
public interface AsyncIface {
@ -596,6 +603,8 @@ public class THBaseService {
public void listNamespaces(org.apache.thrift.async.AsyncMethodCallback<java.util.List<java.lang.String>> resultHandler) throws org.apache.thrift.TException;
public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@ -1808,6 +1817,28 @@ public class THBaseService {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "listNamespaces failed: unknown result");
}
public TThriftServerType getThriftServerType() throws org.apache.thrift.TException
{
send_getThriftServerType();
return recv_getThriftServerType();
}
public void send_getThriftServerType() throws org.apache.thrift.TException
{
getThriftServerType_args args = new getThriftServerType_args();
sendBase("getThriftServerType", args);
}
public TThriftServerType recv_getThriftServerType() throws org.apache.thrift.TException
{
getThriftServerType_result result = new getThriftServerType_result();
receiveBase(result, "getThriftServerType");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getThriftServerType failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
@ -3415,6 +3446,35 @@ public class THBaseService {
}
}
public void getThriftServerType(org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler) throws org.apache.thrift.TException {
checkReady();
getThriftServerType_call method_call = new getThriftServerType_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getThriftServerType_call extends org.apache.thrift.async.TAsyncMethodCall<TThriftServerType> {
public getThriftServerType_call(org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getThriftServerType", org.apache.thrift.protocol.TMessageType.CALL, 0));
getThriftServerType_args args = new getThriftServerType_args();
args.write(prot);
prot.writeMessageEnd();
}
public TThriftServerType getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new java.lang.IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getThriftServerType();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
@ -3474,6 +3534,7 @@ public class THBaseService {
processMap.put("getNamespaceDescriptor", new getNamespaceDescriptor());
processMap.put("listNamespaceDescriptors", new listNamespaceDescriptors());
processMap.put("listNamespaces", new listNamespaces());
processMap.put("getThriftServerType", new getThriftServerType());
return processMap;
}
@ -4825,6 +4886,31 @@ public class THBaseService {
}
}
public static class getThriftServerType<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getThriftServerType_args> {
public getThriftServerType() {
super("getThriftServerType");
}
public getThriftServerType_args getEmptyArgsInstance() {
return new getThriftServerType_args();
}
protected boolean isOneway() {
return false;
}
@Override
protected boolean rethrowUnhandledExceptions() {
return false;
}
public getThriftServerType_result getResult(I iface, getThriftServerType_args args) throws org.apache.thrift.TException {
getThriftServerType_result result = new getThriftServerType_result();
result.success = iface.getThriftServerType();
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
@ -4884,6 +4970,7 @@ public class THBaseService {
processMap.put("getNamespaceDescriptor", new getNamespaceDescriptor());
processMap.put("listNamespaceDescriptors", new listNamespaceDescriptors());
processMap.put("listNamespaces", new listNamespaces());
processMap.put("getThriftServerType", new getThriftServerType());
return processMap;
}
@ -7878,6 +7965,67 @@ public class THBaseService {
}
}
public static class getThriftServerType<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getThriftServerType_args, TThriftServerType> {
public getThriftServerType() {
super("getThriftServerType");
}
public getThriftServerType_args getEmptyArgsInstance() {
return new getThriftServerType_args();
}
public org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new org.apache.thrift.async.AsyncMethodCallback<TThriftServerType>() {
public void onComplete(TThriftServerType o) {
getThriftServerType_result result = new getThriftServerType_result();
result.success = o;
try {
fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
} catch (org.apache.thrift.transport.TTransportException e) {
_LOGGER.error("TTransportException writing to internal frame buffer", e);
fb.close();
} catch (java.lang.Exception e) {
_LOGGER.error("Exception writing to internal frame buffer", e);
onError(e);
}
}
public void onError(java.lang.Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TSerializable msg;
getThriftServerType_result result = new getThriftServerType_result();
if (e instanceof org.apache.thrift.transport.TTransportException) {
_LOGGER.error("TTransportException inside handler", e);
fb.close();
return;
} else if (e instanceof org.apache.thrift.TApplicationException) {
_LOGGER.error("TApplicationException inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TApplicationException)e;
} else {
_LOGGER.error("Exception inside handler", e);
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
} catch (java.lang.Exception ex) {
_LOGGER.error("Exception writing to internal frame buffer", ex);
fb.close();
}
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getThriftServerType_args args, org.apache.thrift.async.AsyncMethodCallback<TThriftServerType> resultHandler) throws org.apache.thrift.TException {
iface.getThriftServerType(resultHandler);
}
}
}
public static class exists_args implements org.apache.thrift.TBase<exists_args, exists_args._Fields>, java.io.Serializable, Cloneable, Comparable<exists_args> {
@ -51327,4 +51475,641 @@ public class THBaseService {
}
}
public static class getThriftServerType_args implements org.apache.thrift.TBase<getThriftServerType_args, getThriftServerType_args._Fields>, java.io.Serializable, Cloneable, Comparable<getThriftServerType_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_args");
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getThriftServerType_argsStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getThriftServerType_argsTupleSchemeFactory();
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_args.class, metaDataMap);
}
public getThriftServerType_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getThriftServerType_args(getThriftServerType_args other) {
}
public getThriftServerType_args deepCopy() {
return new getThriftServerType_args(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getThriftServerType_args)
return this.equals((getThriftServerType_args)that);
return false;
}
public boolean equals(getThriftServerType_args that) {
if (that == null)
return false;
if (this == that)
return true;
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
return hashCode;
}
@Override
public int compareTo(getThriftServerType_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getThriftServerType_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getThriftServerType_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_argsStandardScheme getScheme() {
return new getThriftServerType_argsStandardScheme();
}
}
private static class getThriftServerType_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<getThriftServerType_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getThriftServerType_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_argsTupleScheme getScheme() {
return new getThriftServerType_argsTupleScheme();
}
}
private static class getThriftServerType_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<getThriftServerType_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
public static class getThriftServerType_result implements org.apache.thrift.TBase<getThriftServerType_result, getThriftServerType_result._Fields>, java.io.Serializable, Cloneable, Comparable<getThriftServerType_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getThriftServerType_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new getThriftServerType_resultStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new getThriftServerType_resultTupleSchemeFactory();
/**
*
* @see TThriftServerType
*/
public @org.apache.thrift.annotation.Nullable TThriftServerType success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
*
* @see TThriftServerType
*/
SUCCESS((short)0, "success");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TThriftServerType.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getThriftServerType_result.class, metaDataMap);
}
public getThriftServerType_result() {
}
public getThriftServerType_result(
TThriftServerType success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getThriftServerType_result(getThriftServerType_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public getThriftServerType_result deepCopy() {
return new getThriftServerType_result(this);
}
@Override
public void clear() {
this.success = null;
}
/**
*
* @see TThriftServerType
*/
@org.apache.thrift.annotation.Nullable
public TThriftServerType getSuccess() {
return this.success;
}
/**
*
* @see TThriftServerType
*/
public getThriftServerType_result setSuccess(@org.apache.thrift.annotation.Nullable TThriftServerType success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((TThriftServerType)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that == null)
return false;
if (that instanceof getThriftServerType_result)
return this.equals((getThriftServerType_result)that);
return false;
}
public boolean equals(getThriftServerType_result that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
if (isSetSuccess())
hashCode = hashCode * 8191 + success.getValue();
return hashCode;
}
@Override
public int compareTo(getThriftServerType_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("getThriftServerType_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getThriftServerType_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_resultStandardScheme getScheme() {
return new getThriftServerType_resultStandardScheme();
}
}
private static class getThriftServerType_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<getThriftServerType_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getThriftServerType_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.success = org.apache.hadoop.hbase.thrift2.generated.TThriftServerType.findByValue(iprot.readI32());
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getThriftServerType_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI32(struct.success.getValue());
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getThriftServerType_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public getThriftServerType_resultTupleScheme getScheme() {
return new getThriftServerType_resultTupleScheme();
}
}
private static class getThriftServerType_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<getThriftServerType_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeI32(struct.success.getValue());
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getThriftServerType_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
java.util.BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = org.apache.hadoop.hbase.thrift2.generated.TThriftServerType.findByValue(iprot.readI32());
struct.setSuccessIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
}

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class THRegionInfo implements org.apache.thrift.TBase<THRegionInfo, THRegionInfo._Fields>, java.io.Serializable, Cloneable, Comparable<THRegionInfo> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THRegionInfo");

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class THRegionLocation implements org.apache.thrift.TBase<THRegionLocation, THRegionLocation._Fields>, java.io.Serializable, Cloneable, Comparable<THRegionLocation> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THRegionLocation");

View File

@ -12,7 +12,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* to the HBase master or a HBase region server. Also used to return
* more general HBase error conditions.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TIOError extends org.apache.thrift.TException implements org.apache.thrift.TBase<TIOError, TIOError._Fields>, java.io.Serializable, Cloneable, Comparable<TIOError> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIOError");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* A TIllegalArgument exception indicates an illegal or invalid
* argument was passed into a procedure.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TIllegalArgument extends org.apache.thrift.TException implements org.apache.thrift.TBase<TIllegalArgument, TIllegalArgument._Fields>, java.io.Serializable, Cloneable, Comparable<TIllegalArgument> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIllegalArgument");

View File

@ -14,7 +14,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* by changing the durability. If you don't provide durability, it defaults to
* column family's default setting for durability.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TIncrement implements org.apache.thrift.TBase<TIncrement, TIncrement._Fields>, java.io.Serializable, Cloneable, Comparable<TIncrement> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TIncrement");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.KeepDeletedCells
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TKeepDeletedCells implements org.apache.thrift.TEnum {
/**
* Deleted Cells are not retained.

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
/**
* Atomic mutation for the specified row. It can be either Put or Delete.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TMutation extends org.apache.thrift.TUnion<TMutation, TMutation._Fields> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMutation");
private static final org.apache.thrift.protocol.TField PUT_FIELD_DESC = new org.apache.thrift.protocol.TField("put", org.apache.thrift.protocol.TType.STRUCT, (short)1);

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.NamespaceDescriptor
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TNamespaceDescriptor implements org.apache.thrift.TBase<TNamespaceDescriptor, TNamespaceDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<TNamespaceDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TNamespaceDescriptor");

View File

@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* by changing the durability. If you don't provide durability, it defaults to
* column family's default setting for durability.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TPut implements org.apache.thrift.TBase<TPut, TPut._Fields>, java.io.Serializable, Cloneable, Comparable<TPut> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPut");

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TReadType implements org.apache.thrift.TEnum {
DEFAULT(1),
STREAM(2),

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
/**
* if no Result is found, row and columnValues will not be set.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TResult implements org.apache.thrift.TBase<TResult, TResult._Fields>, java.io.Serializable, Cloneable, Comparable<TResult> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TResult");

View File

@ -10,7 +10,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
/**
* A TRowMutations object is used to apply a number of Mutations to a single row.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TRowMutations implements org.apache.thrift.TBase<TRowMutations, TRowMutations._Fields>, java.io.Serializable, Cloneable, Comparable<TRowMutations> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowMutations");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Any timestamps in the columns are ignored but the colFamTimeRangeMap included, use timeRange to select by timestamp.
* Max versions defaults to 1.
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TScan implements org.apache.thrift.TBase<TScan, TScan._Fields>, java.io.Serializable, Cloneable, Comparable<TScan> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TScan");

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TServerName implements org.apache.thrift.TBase<TServerName, TServerName._Fields>, java.io.Serializable, Cloneable, Comparable<TServerName> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TServerName");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.client.TableDescriptor
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TTableDescriptor implements org.apache.thrift.TBase<TTableDescriptor, TTableDescriptor._Fields>, java.io.Serializable, Cloneable, Comparable<TTableDescriptor> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableDescriptor");

View File

@ -11,7 +11,7 @@ package org.apache.hadoop.hbase.thrift2.generated;
* Thrift wrapper around
* org.apache.hadoop.hbase.TableName
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TTableName implements org.apache.thrift.TBase<TTableName, TTableName._Fields>, java.io.Serializable, Cloneable, Comparable<TTableName> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableName");

View File

@ -0,0 +1,46 @@
/**
* Autogenerated by Thrift Compiler (0.12.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hbase.thrift2.generated;
/**
* Specify type of thrift server: thrift and thrift2
*/
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public enum TThriftServerType implements org.apache.thrift.TEnum {
ONE(1),
TWO(2);
private final int value;
private TThriftServerType(int value) {
this.value = value;
}
/**
* Get the integer value of this enum value, as defined in the Thrift IDL.
*/
public int getValue() {
return value;
}
/**
* Find a the enum type by its integer value, as defined in the Thrift IDL.
* @return null if the value is not found.
*/
@org.apache.thrift.annotation.Nullable
public static TThriftServerType findByValue(int value) {
switch (value) {
case 1:
return ONE;
case 2:
return TWO;
default:
return null;
}
}
}

View File

@ -7,7 +7,7 @@
package org.apache.hadoop.hbase.thrift2.generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-05-06")
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-07")
public class TTimeRange implements org.apache.thrift.TBase<TTimeRange, TTimeRange._Fields>, java.io.Serializable, Cloneable, Comparable<TTimeRange> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTimeRange");

View File

@ -27,9 +27,9 @@
<%
Configuration conf = (Configuration)getServletContext().getAttribute("hbase.conf");
String serverType = (String)getServletContext().getAttribute("hbase.thrift.server.type");
long startcode = conf.getLong("startcode", System.currentTimeMillis());
String listenPort = conf.get("hbase.regionserver.thrift.port", "9090");
String serverInfo = listenPort + "," + String.valueOf(startcode);
ImplType implType = ImplType.getServerImpl(conf);
String framed = implType.isAlwaysFramed()
? "true" : conf.get("hbase.regionserver.thrift.framed", "false");
@ -121,6 +121,11 @@ String compact = conf.get("hbase.regionserver.thrift.compact", "false");
<td><%= framed %></td>
<td>Thrift RPC engine uses framed transport</td>
</tr>
<tr>
<td>Thrift Server Type</td>
<td><%= serverType %></td>
<td>The type of this Thrift server</td>
</tr>
</table>
</section>
</div>

View File

@ -192,6 +192,14 @@ exception AlreadyExists {
1:string message
}
/**
* Specify type of thrift server: thrift and thrift2
*/
enum TThriftServerType {
ONE = 1,
TWO = 2
}
//
// Service
//
@ -957,4 +965,11 @@ service Hbase {
/** Mutation attributes */
7:map<Text, Text> attributes
) throws (1:IOError io, 2:IllegalArgument ia)
/**
* Get the type of this thrift server.
*
* @return the type of this thrift server
*/
TThriftServerType getThriftServerType()
}

View File

@ -476,6 +476,14 @@ exception TIllegalArgument {
1: optional string message
}
/**
* Specify type of thrift server: thrift and thrift2
*/
enum TThriftServerType {
ONE = 1,
TWO = 2
}
service THBaseService {
/**
@ -1038,4 +1046,11 @@ service THBaseService {
**/
list<string> listNamespaces(
) throws (1: TIOError io)
/**
* Get the type of this thrift server.
*
* @return the type of this thrift server
*/
TThriftServerType getThriftServerType()
}

View File

@ -0,0 +1,128 @@
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.hbase.thrift;
import static org.apache.hadoop.hbase.thrift.Constants.INFOPORT_OPTION;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.thrift.ThriftMetrics.ThriftServerType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hbase.thirdparty.com.google.common.base.Joiner;
public class HBaseThriftTestingUtility {
private static final Logger LOG = LoggerFactory.getLogger(HBaseThriftTestingUtility.class);
private Thread thriftServerThread;
private volatile Exception thriftServerException;
private ThriftServer thriftServer;
private int port;
public int getServerPort() {
return port;
}
/**
* start thrift server
* @param conf configuration
* @param type the type of thrift server
* @throws Exception When starting the thrift server fails.
*/
public void startThriftServer(Configuration conf, ThriftServerType type) throws Exception {
List<String> args = new ArrayList<>();
port = HBaseTestingUtility.randomFreePort();
args.add("-" + Constants.PORT_OPTION);
args.add(String.valueOf(port));
args.add("-" + INFOPORT_OPTION);
int infoPort = HBaseTestingUtility.randomFreePort();
args.add(String.valueOf(infoPort));
LOG.info("Starting Thrift Server {} on port: {} ", type, port);
thriftServer = createThriftServer(conf, type);
startThriftServerThread(args.toArray(new String[args.size()]));
// wait up to 10s for the server to start
waitForThriftServer();
LOG.info("Started Thrift Server {} on port {}", type, port);
}
private void startThriftServerThread(final String[] args) {
LOG.info("Starting HBase Thrift server with command line: " + Joiner.on(" ").join(args));
thriftServerException = null;
thriftServerThread = new Thread(() -> {
try {
thriftServer.run(args);
} catch (Exception e) {
thriftServerException = e;
}
});
thriftServerThread.setName(ThriftServer.class.getSimpleName());
thriftServerThread.start();
}
/**
* create a new thrift server
* @param conf configuration
* @param type the type of thrift server
* @return the instance of ThriftServer
*/
private ThriftServer createThriftServer(Configuration conf, ThriftServerType type) {
switch (type) {
case ONE:
return new ThriftServer(conf);
case TWO:
return new org.apache.hadoop.hbase.thrift2.ThriftServer(conf);
default:
throw new IllegalArgumentException("Unknown type: " + type);
}
}
private void waitForThriftServer() throws Exception {
boolean isServing = false;
int i = 0;
while (i++ < 100) {
if (thriftServer.tserver == null) {
Thread.sleep(100);
} else {
isServing = true;
break;
}
}
if (!isServing) {
if (thriftServer != null) {
thriftServer.stop();
}
throw new IOException("Failed to start thrift server ");
}
}
public void stopThriftServer() throws Exception{
LOG.debug("Stopping Thrift Server");
thriftServer.stop();
thriftServerThread.join();
if (thriftServerException != null) {
LOG.error("HBase Thrift server threw an exception ", thriftServerException);
throw new Exception(thriftServerException);
}
}
}

View File

@ -25,6 +25,7 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
@ -47,6 +48,7 @@ import org.apache.hadoop.hbase.security.UserProvider;
import org.apache.hadoop.hbase.test.MetricsAssertHelper;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.LargeTests;
import org.apache.hadoop.hbase.thrift.ThriftMetrics.ThriftServerType;
import org.apache.hadoop.hbase.thrift.generated.BatchMutation;
import org.apache.hadoop.hbase.thrift.generated.ColumnDescriptor;
import org.apache.hadoop.hbase.thrift.generated.Hbase;
@ -58,9 +60,14 @@ import org.apache.hadoop.hbase.thrift.generated.TIncrement;
import org.apache.hadoop.hbase.thrift.generated.TRegionInfo;
import org.apache.hadoop.hbase.thrift.generated.TRowResult;
import org.apache.hadoop.hbase.thrift.generated.TScan;
import org.apache.hadoop.hbase.thrift.generated.TThriftServerType;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.TableDescriptorChecker;
import org.apache.hadoop.hbase.util.Threads;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
@ -871,4 +878,35 @@ public class TestThriftServer {
handler.scannerGet(scannerId);
handler.scannerClose(scannerId);
}
@Test
public void testGetThriftServerType() throws Exception {
ThriftHBaseServiceHandler handler =
new ThriftHBaseServiceHandler(UTIL.getConfiguration(),
UserProvider.instantiate(UTIL.getConfiguration()));
assertEquals(TThriftServerType.ONE, handler.getThriftServerType());
}
/**
* Verify that thrift client calling thrift2 server can get the thrift2 server type correctly.
*/
@Test
public void testGetThriftServerOneType() throws Exception {
// start a thrift2 server
HBaseThriftTestingUtility THRIFT_TEST_UTIL = new HBaseThriftTestingUtility();
LOG.info("Starting HBase Thrift Server Two");
THRIFT_TEST_UTIL.startThriftServer(UTIL.getConfiguration(), ThriftServerType.TWO);
try (TTransport transport = new TSocket(InetAddress.getLocalHost().getHostName(),
THRIFT_TEST_UTIL.getServerPort())){
TProtocol protocol = new TBinaryProtocol(transport);
// This is our thrift client.
Hbase.Client client = new Hbase.Client(protocol);
// open the transport
transport.open();
assertEquals(TThriftServerType.TWO.name(), client.getThriftServerType().name());
} finally {
THRIFT_TEST_UTIL.stopThriftServer();
}
}
}

View File

@ -34,6 +34,7 @@ import static org.junit.Assert.fail;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
@ -73,8 +74,10 @@ import org.apache.hadoop.hbase.test.MetricsAssertHelper;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.thrift.ErrorThrowingGetObserver;
import org.apache.hadoop.hbase.thrift.HBaseThriftTestingUtility;
import org.apache.hadoop.hbase.thrift.HbaseHandlerMetricsProxy;
import org.apache.hadoop.hbase.thrift.ThriftMetrics;
import org.apache.hadoop.hbase.thrift.ThriftMetrics.ThriftServerType;
import org.apache.hadoop.hbase.thrift2.generated.TAppend;
import org.apache.hadoop.hbase.thrift2.generated.TColumn;
import org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor;
@ -100,9 +103,14 @@ import org.apache.hadoop.hbase.thrift2.generated.TRowMutations;
import org.apache.hadoop.hbase.thrift2.generated.TScan;
import org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor;
import org.apache.hadoop.hbase.thrift2.generated.TTableName;
import org.apache.hadoop.hbase.thrift2.generated.TThriftServerType;
import org.apache.hadoop.hbase.thrift2.generated.TTimeRange;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
@ -1691,6 +1699,36 @@ public class TestThriftHBaseServiceHandler {
assertTrue(table.getColumnFamily(familyBname).getMaxVersions() == 2);
}
@Test
public void testGetThriftServerType() throws Exception {
ThriftHBaseServiceHandler handler = createHandler();
assertEquals(TThriftServerType.TWO, handler.getThriftServerType());
}
/**
* Verify that thrift2 client calling thrift server can get the thrift server type correctly.
*/
@Test
public void testGetThriftServerOneType() throws Exception {
// start a thrift server
HBaseThriftTestingUtility THRIFT_TEST_UTIL = new HBaseThriftTestingUtility();
LOG.info("Starting HBase Thrift server One");
THRIFT_TEST_UTIL.startThriftServer(UTIL.getConfiguration(), ThriftServerType.ONE);
try (TTransport transport = new TSocket(InetAddress.getLocalHost().getHostName(),
THRIFT_TEST_UTIL.getServerPort())){
TProtocol protocol = new TBinaryProtocol(transport);
// This is our thrift2 client.
THBaseService.Iface client = new THBaseService.Client(protocol);
// open the transport
transport.open();
assertEquals(TThriftServerType.ONE.name(), client.getThriftServerType().name());
} finally {
THRIFT_TEST_UTIL.stopThriftServer();
}
}
public static class DelayingRegionObserver implements RegionCoprocessor, RegionObserver {
private static final Logger LOG = LoggerFactory.getLogger(DelayingRegionObserver.class);
// sleep time in msec