@InterfaceAudience.Private public class ThriftHBaseServiceHandler extends HBaseServiceHandler implements THBaseService.Iface
CLEANUP_INTERVAL, conf, connectionCache, MAX_IDLETIME, metrics| Constructor and Description |
|---|
ThriftHBaseServiceHandler(org.apache.hadoop.conf.Configuration conf,
UserProvider userProvider) |
| Modifier and Type | Method and Description |
|---|---|
void |
addColumnFamily(TTableName tableName,
TColumnFamilyDescriptor column)
Add a column family to an existing table.
|
TResult |
append(ByteBuffer table,
TAppend append) |
boolean |
checkAndDelete(ByteBuffer table,
ByteBuffer row,
ByteBuffer family,
ByteBuffer qualifier,
ByteBuffer value,
TDelete deleteSingle)
Atomically checks if a row/family/qualifier value matches the expected
value.
|
boolean |
checkAndMutate(ByteBuffer table,
ByteBuffer row,
ByteBuffer family,
ByteBuffer qualifier,
TCompareOp compareOp,
ByteBuffer value,
TRowMutations rowMutations)
Atomically checks if a row/family/qualifier value matches the expected
value.
|
boolean |
checkAndPut(ByteBuffer table,
ByteBuffer row,
ByteBuffer family,
ByteBuffer qualifier,
ByteBuffer value,
TPut put)
Atomically checks if a row/family/qualifier value matches the expected
value.
|
void |
closeScanner(int scannerId)
Closes the scanner.
|
void |
createNamespace(TNamespaceDescriptor namespaceDesc)
Create a new namespace.
|
void |
createTable(TTableDescriptor desc,
List<ByteBuffer> splitKeys)
Creates a new table with an initial set of empty regions defined by the specified split keys.
|
void |
deleteColumnFamily(TTableName tableName,
ByteBuffer column)
Delete a column family from a table.
|
List<TDelete> |
deleteMultiple(ByteBuffer table,
List<TDelete> deletes)
Bulk commit a List of TDeletes to the table.
|
void |
deleteNamespace(String name)
Delete an existing namespace.
|
void |
deleteSingle(ByteBuffer table,
TDelete deleteSingle)
Deletes as specified by the TDelete.
|
void |
deleteTable(TTableName tableName)
Deletes a table.
|
void |
disableTable(TTableName tableName)
Disable a table
|
void |
enableTable(TTableName tableName)
Enalbe a table
|
boolean |
exists(ByteBuffer table,
TGet get)
Test for the existence of columns in the table, as specified in the TGet.
|
List<Boolean> |
existsAll(ByteBuffer table,
List<TGet> gets)
Test for the existence of columns in the table, as specified by the TGets.
|
TResult |
get(ByteBuffer table,
TGet get)
Method for getting data from a row.
|
List<THRegionLocation> |
getAllRegionLocations(ByteBuffer table)
Get all of the region locations for a given table.
|
List<TResult> |
getMultiple(ByteBuffer table,
List<TGet> gets)
Method for getting multiple rows.
|
TNamespaceDescriptor |
getNamespaceDescriptor(String name)
Get a namespace descriptor by name.
|
THRegionLocation |
getRegionLocation(ByteBuffer table,
ByteBuffer row,
boolean reload)
Given a table and a row get the location of the region that
would contain the given row key.
|
List<TResult> |
getScannerResults(ByteBuffer table,
TScan scan,
int numRows)
Get results for the provided TScan object.
|
List<TResult> |
getScannerRows(int scannerId,
int numRows)
Grabs multiple rows from a Scanner.
|
protected Table |
getTable(ByteBuffer tableName) |
TTableDescriptor |
getTableDescriptor(TTableName table)
Get a table descriptor.
|
List<TTableDescriptor> |
getTableDescriptors(List<TTableName> tables)
Get table descriptors of tables.
|
List<TTableDescriptor> |
getTableDescriptorsByNamespace(String name)
Get table descriptors of tables in the given namespace
|
List<TTableDescriptor> |
getTableDescriptorsByPattern(String regex,
boolean includeSysTables)
Get table descriptors of tables that match the given pattern
|
List<TTableName> |
getTableNamesByNamespace(String name)
Get table names of tables in the given namespace
|
List<TTableName> |
getTableNamesByPattern(String regex,
boolean includeSysTables)
Get table names of tables that match the given pattern
|
TResult |
increment(ByteBuffer table,
TIncrement increment) |
boolean |
isTableAvailable(TTableName tableName) |
boolean |
isTableAvailableWithSplit(TTableName tableName,
List<ByteBuffer> splitKeys)
* Use this api to check if the table has been created with the specified number of splitkeys
* which was used while creating the given table.
|
boolean |
isTableDisabled(TTableName tableName) |
boolean |
isTableEnabled(TTableName tableName) |
List<TNamespaceDescriptor> |
listNamespaceDescriptors() |
void |
modifyColumnFamily(TTableName tableName,
TColumnFamilyDescriptor column)
Modify an existing column family on a table.
|
void |
modifyNamespace(TNamespaceDescriptor namespaceDesc)
Modify an existing namespace.
|
void |
modifyTable(TTableDescriptor desc)
Modify an existing table
|
void |
mutateRow(ByteBuffer table,
TRowMutations rowMutations)
mutateRow performs multiple mutations atomically on a single row.
|
int |
openScanner(ByteBuffer table,
TScan scan)
Get a Scanner for the provided TScan object.
|
void |
put(ByteBuffer table,
TPut put)
Commit a TPut to a table.
|
void |
putMultiple(ByteBuffer table,
List<TPut> puts)
Commit a List of Puts to the table.
|
protected ResultScanner |
removeScanner(int id)
Removes the scanner associated with the specified ID from the internal HashMap.
|
boolean |
tableExists(TTableName tTableName) |
void |
truncateTable(TTableName tableName,
boolean preserveSplits)
Truncate a table.
|
getAdmin, getTable, initMetrics, setEffectiveUserpublic ThriftHBaseServiceHandler(org.apache.hadoop.conf.Configuration conf,
UserProvider userProvider)
throws IOException
IOExceptionprotected Table getTable(ByteBuffer tableName)
getTable in class HBaseServiceHandlerprotected ResultScanner removeScanner(int id)
id - of the Scanner to removenull if the Id is invalidpublic boolean exists(ByteBuffer table, TGet get) throws TIOError, org.apache.thrift.TException
THBaseService.Ifaceexists in interface THBaseService.Ifacetable - the table to check onget - the TGet to check forTIOErrororg.apache.thrift.TExceptionpublic List<Boolean> existsAll(ByteBuffer table, List<TGet> gets) throws TIOError, org.apache.thrift.TException
THBaseService.IfaceexistsAll in interface THBaseService.Ifacetable - the table to check ongets - a list of TGets to check forTIOErrororg.apache.thrift.TExceptionpublic TResult get(ByteBuffer table, TGet get) throws TIOError, org.apache.thrift.TException
THBaseService.Ifaceget in interface THBaseService.Ifacetable - the table to get fromget - the TGet to fetchTIOErrororg.apache.thrift.TExceptionpublic List<TResult> getMultiple(ByteBuffer table, List<TGet> gets) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetMultiple in interface THBaseService.Ifacetable - the table to get fromgets - a list of TGets to fetch, the Result list
will have the Results at corresponding positions
or null if there was an errorTIOErrororg.apache.thrift.TExceptionpublic void put(ByteBuffer table, TPut put) throws TIOError, org.apache.thrift.TException
THBaseService.Ifaceput in interface THBaseService.Ifacetable - the table to put data input - the TPut to putTIOErrororg.apache.thrift.TExceptionpublic boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TPut put) throws TIOError, org.apache.thrift.TException
THBaseService.IfacecheckAndPut in interface THBaseService.Ifacetable - to check in and put torow - row to checkfamily - column family to checkqualifier - column qualifier to checkvalue - the expected value, if not provided the
check is for the non-existence of the
column in questionput - the TPut to put if the check succeedsTIOErrororg.apache.thrift.TExceptionpublic void putMultiple(ByteBuffer table, List<TPut> puts) throws TIOError, org.apache.thrift.TException
THBaseService.IfaceputMultiple in interface THBaseService.Ifacetable - the table to put data inputs - a list of TPuts to commitTIOErrororg.apache.thrift.TExceptionpublic void deleteSingle(ByteBuffer table, TDelete deleteSingle) throws TIOError, org.apache.thrift.TException
THBaseService.IfacedeleteSingle in interface THBaseService.Ifacetable - the table to delete fromdeleteSingle - the TDelete to deleteTIOErrororg.apache.thrift.TExceptionpublic List<TDelete> deleteMultiple(ByteBuffer table, List<TDelete> deletes) throws TIOError, org.apache.thrift.TException
THBaseService.IfacedeleteMultiple in interface THBaseService.Ifacetable - the table to delete fromdeletes - list of TDeletes to deleteTIOErrororg.apache.thrift.TExceptionpublic boolean checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, TCompareOp compareOp, ByteBuffer value, TRowMutations rowMutations) throws TIOError, org.apache.thrift.TException
THBaseService.IfacecheckAndMutate in interface THBaseService.Ifacetable - to check in and delete fromrow - row to checkfamily - column family to checkqualifier - column qualifier to checkcompareOp - comparison to make on the valuevalue - the expected value to be compared against, if not provided the
check is for the non-existence of the column in questionrowMutations - row mutations to execute if the value matchesTIOErrororg.apache.thrift.TExceptionpublic boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, TDelete deleteSingle) throws TIOError, org.apache.thrift.TException
THBaseService.IfacecheckAndDelete in interface THBaseService.Ifacetable - to check in and delete fromrow - row to checkfamily - column family to checkqualifier - column qualifier to checkvalue - the expected value, if not provided the
check is for the non-existence of the
column in questiondeleteSingle - the TDelete to execute if the check succeedsTIOErrororg.apache.thrift.TExceptionpublic TResult increment(ByteBuffer table, TIncrement increment) throws TIOError, org.apache.thrift.TException
increment in interface THBaseService.IfaceTIOErrororg.apache.thrift.TExceptionpublic TResult append(ByteBuffer table, TAppend append) throws TIOError, org.apache.thrift.TException
append in interface THBaseService.IfaceTIOErrororg.apache.thrift.TExceptionpublic int openScanner(ByteBuffer table, TScan scan) throws TIOError, org.apache.thrift.TException
THBaseService.IfaceopenScanner in interface THBaseService.Ifacetable - the table to get the Scanner forscan - the scan object to get a Scanner forTIOErrororg.apache.thrift.TExceptionpublic List<TResult> getScannerRows(int scannerId, int numRows) throws TIOError, TIllegalArgument, org.apache.thrift.TException
THBaseService.IfacegetScannerRows in interface THBaseService.IfacescannerId - the Id of the Scanner to return rows from. This is an Id returned from the openScanner function.numRows - number of rows to returnTIOErrorTIllegalArgumentorg.apache.thrift.TExceptionpublic List<TResult> getScannerResults(ByteBuffer table, TScan scan, int numRows) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetScannerResults in interface THBaseService.Ifacetable - the table to get the Scanner forscan - the scan object to get a Scanner fornumRows - number of rows to returnTIOErrororg.apache.thrift.TExceptionpublic void closeScanner(int scannerId)
throws TIOError,
TIllegalArgument,
org.apache.thrift.TException
THBaseService.IfacecloseScanner in interface THBaseService.IfacescannerId - the Id of the Scanner to close *TIOErrorTIllegalArgumentorg.apache.thrift.TExceptionpublic void mutateRow(ByteBuffer table, TRowMutations rowMutations) throws TIOError, org.apache.thrift.TException
THBaseService.IfacemutateRow in interface THBaseService.Ifacetable - table to apply the mutationsrowMutations - mutations to applyTIOErrororg.apache.thrift.TExceptionpublic List<THRegionLocation> getAllRegionLocations(ByteBuffer table) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetAllRegionLocations in interface THBaseService.IfaceTIOErrororg.apache.thrift.TExceptionpublic THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetRegionLocation in interface THBaseService.IfaceTIOErrororg.apache.thrift.TExceptionpublic TTableDescriptor getTableDescriptor(TTableName table) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetTableDescriptor in interface THBaseService.Ifacetable - the tablename of the table to get tableDescriptorTIOErrororg.apache.thrift.TExceptionpublic List<TTableDescriptor> getTableDescriptors(List<TTableName> tables) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetTableDescriptors in interface THBaseService.Ifacetables - the tablename list of the tables to get tableDescriptorTIOErrororg.apache.thrift.TExceptionpublic boolean tableExists(TTableName tTableName) throws TIOError, org.apache.thrift.TException
tableExists in interface THBaseService.IfacetTableName - the tablename of the tables to checkTIOErrororg.apache.thrift.TExceptionpublic List<TTableDescriptor> getTableDescriptorsByPattern(String regex, boolean includeSysTables) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetTableDescriptorsByPattern in interface THBaseService.Ifaceregex - The regular expression to match againstincludeSysTables - set to false if match only against userspace tablesTIOErrororg.apache.thrift.TExceptionpublic List<TTableDescriptor> getTableDescriptorsByNamespace(String name) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetTableDescriptorsByNamespace in interface THBaseService.Ifacename - The namesapce's nameTIOErrororg.apache.thrift.TExceptionpublic List<TTableName> getTableNamesByPattern(String regex, boolean includeSysTables) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetTableNamesByPattern in interface THBaseService.Ifaceregex - The regular expression to match againstincludeSysTables - set to false if match only against userspace tablesTIOErrororg.apache.thrift.TExceptionpublic List<TTableName> getTableNamesByNamespace(String name) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetTableNamesByNamespace in interface THBaseService.Ifacename - The namesapce's nameTIOErrororg.apache.thrift.TExceptionpublic void createTable(TTableDescriptor desc, List<ByteBuffer> splitKeys) throws TIOError, org.apache.thrift.TException
THBaseService.IfacecreateTable in interface THBaseService.Ifacedesc - table descriptor for tablesplitKeys - rray of split keys for the initial regions of the tableTIOErrororg.apache.thrift.TExceptionpublic void deleteTable(TTableName tableName) throws TIOError, org.apache.thrift.TException
THBaseService.IfacedeleteTable in interface THBaseService.IfacetableName - the tablename to deleteTIOErrororg.apache.thrift.TExceptionpublic void truncateTable(TTableName tableName, boolean preserveSplits) throws TIOError, org.apache.thrift.TException
THBaseService.IfacetruncateTable in interface THBaseService.IfacetableName - the tablename to truncatepreserveSplits - whether to preserve previous splitsTIOErrororg.apache.thrift.TExceptionpublic void enableTable(TTableName tableName) throws TIOError, org.apache.thrift.TException
THBaseService.IfaceenableTable in interface THBaseService.IfacetableName - the tablename to enableTIOErrororg.apache.thrift.TExceptionpublic void disableTable(TTableName tableName) throws TIOError, org.apache.thrift.TException
THBaseService.IfacedisableTable in interface THBaseService.IfacetableName - the tablename to disableTIOErrororg.apache.thrift.TExceptionpublic boolean isTableEnabled(TTableName tableName) throws TIOError, org.apache.thrift.TException
isTableEnabled in interface THBaseService.IfacetableName - the tablename to checkTIOErrororg.apache.thrift.TExceptionpublic boolean isTableDisabled(TTableName tableName) throws TIOError, org.apache.thrift.TException
isTableDisabled in interface THBaseService.IfacetableName - the tablename to checkTIOErrororg.apache.thrift.TExceptionpublic boolean isTableAvailable(TTableName tableName) throws TIOError, org.apache.thrift.TException
isTableAvailable in interface THBaseService.IfacetableName - the tablename to checkTIOErrororg.apache.thrift.TExceptionpublic boolean isTableAvailableWithSplit(TTableName tableName, List<ByteBuffer> splitKeys) throws TIOError, org.apache.thrift.TException
THBaseService.IfaceTHBaseService.Iface.isTableAvailable(TTableName tableName) instead
*isTableAvailableWithSplit in interface THBaseService.IfacetableName - the tablename to checksplitKeys - keys to check if the table has been created with all split keysTIOErrororg.apache.thrift.TExceptionpublic void addColumnFamily(TTableName tableName, TColumnFamilyDescriptor column) throws TIOError, org.apache.thrift.TException
THBaseService.IfaceaddColumnFamily in interface THBaseService.IfacetableName - the tablename to add column family tocolumn - column family descriptor of column family to be addedTIOErrororg.apache.thrift.TExceptionpublic void deleteColumnFamily(TTableName tableName, ByteBuffer column) throws TIOError, org.apache.thrift.TException
THBaseService.IfacedeleteColumnFamily in interface THBaseService.IfacetableName - the tablename to delete column family fromcolumn - name of column family to be deletedTIOErrororg.apache.thrift.TExceptionpublic void modifyColumnFamily(TTableName tableName, TColumnFamilyDescriptor column) throws TIOError, org.apache.thrift.TException
THBaseService.IfacemodifyColumnFamily in interface THBaseService.IfacetableName - the tablename to modify column familycolumn - column family descriptor of column family to be modifiedTIOErrororg.apache.thrift.TExceptionpublic void modifyTable(TTableDescriptor desc) throws TIOError, org.apache.thrift.TException
THBaseService.IfacemodifyTable in interface THBaseService.Ifacedesc - the descriptor of the table to modifyTIOErrororg.apache.thrift.TExceptionpublic void createNamespace(TNamespaceDescriptor namespaceDesc) throws TIOError, org.apache.thrift.TException
THBaseService.IfacecreateNamespace in interface THBaseService.IfacenamespaceDesc - descriptor which describes the new namespaceTIOErrororg.apache.thrift.TExceptionpublic void modifyNamespace(TNamespaceDescriptor namespaceDesc) throws TIOError, org.apache.thrift.TException
THBaseService.IfacemodifyNamespace in interface THBaseService.IfacenamespaceDesc - descriptor which describes the new namespaceTIOErrororg.apache.thrift.TExceptionpublic void deleteNamespace(String name) throws TIOError, org.apache.thrift.TException
THBaseService.IfacedeleteNamespace in interface THBaseService.Ifacename - namespace nameTIOErrororg.apache.thrift.TExceptionpublic TNamespaceDescriptor getNamespaceDescriptor(String name) throws TIOError, org.apache.thrift.TException
THBaseService.IfacegetNamespaceDescriptor in interface THBaseService.Ifacename - name of namespace descriptorTIOErrororg.apache.thrift.TExceptionpublic List<TNamespaceDescriptor> listNamespaceDescriptors() throws TIOError, org.apache.thrift.TException
listNamespaceDescriptors in interface THBaseService.IfaceTIOErrororg.apache.thrift.TExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.