@InterfaceAudience.Private public class ThriftTable extends Object implements Table
| Modifier and Type | Class and Description | 
|---|---|
| private class  | ThriftTable.CheckAndMutateBuilderImpl | 
| private class  | ThriftTable.ScannerA scanner to perform scan from thrift server
 getScannerResults is used in this scanner | 
Table.CheckAndMutateBuilder, Table.CheckAndMutateWithFilterBuilder| Modifier and Type | Field and Description | 
|---|---|
| private org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client | client | 
| private org.apache.hadoop.conf.Configuration | conf | 
| private int | operationTimeout | 
| private int | scannerCaching | 
| private TableName | tableName | 
| private ByteBuffer | tableNameInBytes | 
| private org.apache.thrift.transport.TTransport | tTransport | 
| Constructor and Description | 
|---|
| ThriftTable(TableName tableName,
           org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client,
           org.apache.thrift.transport.TTransport tTransport,
           org.apache.hadoop.conf.Configuration conf) | 
| Modifier and Type | Method and Description | 
|---|---|
| Result | append(Append append)Appends values to one or more columns within a single row. | 
| void | batch(List<? extends Row> actions,
     Object[] results)Method that does a batch call on Deletes, Gets, Puts, Increments, Appends, RowMutations. | 
| <R> void | batchCallback(List<? extends Row> actions,
             Object[] results,
             Batch.Callback<R> callback)Same as  Table.batch(List, Object[]), but with a callback. | 
| Table.CheckAndMutateBuilder | checkAndMutate(byte[] row,
              byte[] family)Atomically checks if a row/family/qualifier value matches the expected value. | 
| boolean | checkAndMutate(byte[] row,
              byte[] family,
              byte[] qualifier,
              CompareOperator op,
              byte[] value,
              RowMutations mutation)Atomically checks if a row/family/qualifier value matches the expected value. | 
| Table.CheckAndMutateWithFilterBuilder | checkAndMutate(byte[] row,
              Filter filter)Atomically checks if a row matches the specified filter. | 
| CheckAndMutateResult | checkAndMutate(CheckAndMutate checkAndMutate)checkAndMutate that atomically checks if a row matches the specified condition. | 
| List<CheckAndMutateResult> | checkAndMutate(List<CheckAndMutate> checkAndMutates)Batch version of checkAndMutate. | 
| void | close()Releases any resources held or pending changes in internal buffers. | 
| CoprocessorRpcChannel | coprocessorService(byte[] row)Creates and returns a  RpcChannelinstance connected to the
 table region containing the specified row. | 
| void | delete(Delete delete)Deletes the specified cells/row. | 
| void | delete(List<Delete> deletes)Batch Deletes the specified cells/rows from the table. | 
| boolean | exists(Get get)Test for the existence of columns in the table, as specified by the Get. | 
| boolean[] | exists(List<Get> gets)Test for the existence of columns in the table, as specified by the Gets. | 
| Result | get(Get get)Extracts certain cells from a given row. | 
| Result[] | get(List<Get> gets)Extracts specified cells from the given rows, as a batch. | 
| org.apache.hadoop.conf.Configuration | getConfiguration()Returns the  Configurationobject used by this instance. | 
| TableDescriptor | getDescriptor()Gets the  table descriptorfor this table. | 
| TableName | getName()Gets the fully qualified table name instance of this table. | 
| long | getOperationTimeout(TimeUnit unit)Get timeout of each operation in Table instance. | 
| long | getReadRpcTimeout(TimeUnit unit)Get timeout of each rpc read request in this Table instance. | 
| RegionLocator | getRegionLocator()Gets the  RegionLocatorfor this table. | 
| long | getRpcTimeout(TimeUnit unit)Get timeout of each rpc request in this Table instance. | 
| ResultScanner | getScanner(byte[] family)Gets a scanner on the current table for the given family. | 
| ResultScanner | getScanner(byte[] family,
          byte[] qualifier)Gets a scanner on the current table for the given family and qualifier. | 
| ResultScanner | getScanner(Scan scan)Returns a scanner on the current table as specified by the  Scanobject. | 
| long | getWriteRpcTimeout(TimeUnit unit)Get timeout of each rpc write request in this Table instance. | 
| Result | increment(Increment increment)Increments one or more columns within a single row. | 
| Result | mutateRow(RowMutations rm)Performs multiple mutations atomically on a single row. | 
| void | put(List<Put> puts)Batch puts the specified data into the table. | 
| void | put(Put put)Puts some data in the table. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbatchCoprocessorService, batchCoprocessorService, checkAndDelete, checkAndDelete, checkAndDelete, checkAndMutate, checkAndPut, checkAndPut, checkAndPut, coprocessorService, coprocessorService, existsAll, getOperationTimeout, getReadRpcTimeout, getRpcTimeout, getTableDescriptor, getWriteRpcTimeout, incrementColumnValue, incrementColumnValue, setOperationTimeout, setReadRpcTimeout, setRpcTimeout, setWriteRpcTimeoutprivate org.apache.hadoop.conf.Configuration conf
private org.apache.thrift.transport.TTransport tTransport
private org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client
private ByteBuffer tableNameInBytes
private int operationTimeout
private final int scannerCaching
public ThriftTable(TableName tableName, org.apache.hadoop.hbase.thrift2.generated.THBaseService.Client client, org.apache.thrift.transport.TTransport tTransport, org.apache.hadoop.conf.Configuration conf)
public TableName getName()
Tablepublic org.apache.hadoop.conf.Configuration getConfiguration()
TableConfiguration object used by this instance.
 The reference returned is not a copy, so any change made to it will affect this instance.
getConfiguration in interface Tablepublic TableDescriptor getDescriptor() throws IOException
Tabletable descriptor for this table.getDescriptor in interface TableIOException - if a remote or network exception occurs.public boolean exists(Get get) throws IOException
TableThis will return true if the Get matches one or more keys, false if not.
This is a server-side call so it prevents any data from being transfered to the client.
exists in interface Tableget - the GetIOException - epublic boolean[] exists(List<Get> gets) throws IOException
TableThis will return an array of booleans. Each value will be true if the related Get matches one or more keys, false if not.
This is a server-side call so it prevents any data from being transferred to the client.
exists in interface Tablegets - the GetsIOException - epublic void batch(List<? extends Row> actions, Object[] results) throws IOException
TableTable.batch(java.util.List<? extends org.apache.hadoop.hbase.client.Row>, java.lang.Object[]) call, you will not necessarily be
 guaranteed that the Get returns what the Put had put.batch in interface Tableactions - list of Get, Put, Delete, Increment, Append, RowMutations.results - Empty Object[], same size as actions. Provides access to partial
                results, in case an exception is thrown. A null in the result array means that
                the call for that action failed, even after retries. The order of the objects
                in the results array corresponds to the order of actions in the request list.IOExceptionpublic <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback) throws IOException
TableTable.batch(List, Object[]), but with a callback.batchCallback in interface TableIOExceptionpublic Result get(Get get) throws IOException
Tableget in interface Tableget - The object that specifies what data to fetch and from which row.Result instance returned won't
   contain any KeyValue, as indicated by
   Result.isEmpty().IOException - if a remote or network exception occurs.public Result[] get(List<Get> gets) throws IOException
Tableget in interface Tablegets - The objects that specify what data to fetch and from which rows.Result instance returned won't contain any
   Cells, as indicated by Result.isEmpty(). If there
   are any failures even after retries, there will be a null in the results' array
   for  those Gets, AND an exception will be thrown. The ordering of the Result array
   corresponds to  the order of the list of passed in Gets.IOException - if a remote or network exception occurs.public ResultScanner getScanner(Scan scan) throws IOException
TableScan
 object.
 Note that the passed Scan's start row and caching properties
 maybe changed.getScanner in interface Tablescan - A configured Scan object.IOException - if a remote or network exception occurs.public ResultScanner getScanner(byte[] family) throws IOException
TablegetScanner in interface Tablefamily - The column family to scan.IOException - if a remote or network exception occurs.public ResultScanner getScanner(byte[] family, byte[] qualifier) throws IOException
TablegetScanner in interface Tablefamily - The column family to scan.qualifier - The column qualifier to scan.IOException - if a remote or network exception occurs.public void put(Put put) throws IOException
Tableput in interface Tableput - The data to put.IOException - if a remote or network exception occurs.public void put(List<Put> puts) throws IOException
Table
 This can be used for group commit, or for submitting user defined batches. Before sending
 a batch of mutations to the server, the client runs a few validations on the input list. If an
 error is found, for example, a mutation was supplied but was missing it's column an
 IllegalArgumentException will be thrown and no mutations will be applied. If there
 are any failures even after retries, a RetriesExhaustedWithDetailsException will be
 thrown. RetriesExhaustedWithDetailsException contains lists of failed mutations and
 corresponding remote exceptions. The ordering of mutations and exceptions in the
 encapsulating exception corresponds to the order of the input list of Put requests.
put in interface Tableputs - The list of mutations to apply.IOException - if a remote or network exception occurs.public void delete(Delete delete) throws IOException
Tabledelete in interface Tabledelete - The object that specifies what to delete.IOException - if a remote or network exception occurs.public void delete(List<Delete> deletes) throws IOException
Table
 If a specified row does not exist, Delete will report as though sucessful
 delete; no exception will be thrown. If there are any failures even after retries,
 a RetriesExhaustedWithDetailsException will be thrown.
 RetriesExhaustedWithDetailsException contains lists of failed Deletes and
 corresponding remote exceptions.
delete in interface Tabledeletes - List of things to delete. The input list gets modified by this
 method. All successfully applied Deletes in the list are removed (in particular it
 gets re-ordered, so the order in which the elements are inserted in the list gives no
 guarantee as to the order in which the Deletes are executed).IOException - if a remote or network exception occurs. In that case
 the deletes argument will contain the Delete instances
 that have not be successfully applied.public boolean checkAndMutate(byte[] row, byte[] family, byte[] qualifier, CompareOperator op, byte[] value, RowMutations mutation) throws IOException
TablecheckAndMutate in interface Tablerow - to checkfamily - column family to checkqualifier - column qualifier to checkop - the comparison operatorvalue - the expected valuemutation - mutations to perform if check succeedsIOException - epublic Table.CheckAndMutateBuilder checkAndMutate(byte[] row, byte[] family)
Table
 Use the returned Table.CheckAndMutateBuilder to construct your request and then execute it.
 This is a fluent style API, the code is like:
 
 
 table.checkAndMutate(row, family).qualifier(qualifier).ifNotExists().thenPut(put);
 
 checkAndMutate in interface Tablepublic Table.CheckAndMutateWithFilterBuilder checkAndMutate(byte[] row, Filter filter)
Table
 Use the returned Table.CheckAndMutateWithFilterBuilder to construct your request and then
 execute it. This is a fluent style API, the code is like:
 
 
 table.checkAndMutate(row, filter).thenPut(put);
 
 checkAndMutate in interface Tablepublic CheckAndMutateResult checkAndMutate(CheckAndMutate checkAndMutate)
TablecheckAndMutate in interface TablecheckAndMutate - The CheckAndMutate object.public List<CheckAndMutateResult> checkAndMutate(List<CheckAndMutate> checkAndMutates)
TablecheckAndMutate in interface TablecheckAndMutates - The list of CheckAndMutate.public Result mutateRow(RowMutations rm) throws IOException
TablemutateRow in interface Tablerm - object that specifies the set of mutations to perform atomicallyIOException - if a remote or network exception occurs.public Result append(Append append) throws IOException
TableThis operation guaranteed atomicity to readers. Appends are done under a single row lock, so write operations to a row are synchronized, and readers are guaranteed to see this operation fully completed.
append in interface Tableappend - object that specifies the columns and values to be appendedIOException - epublic Result increment(Increment increment) throws IOException
TableThis operation ensures atomicity to readers. Increments are done under a single row lock, so write operations to a row are synchronized, and readers are guaranteed to see this operation fully completed.
increment in interface Tableincrement - object that specifies the columns and amounts to be used
                  for the increment operationsIOException - epublic void close() throws IOException
Tableclose in interface Closeableclose in interface AutoCloseableclose in interface TableIOException - if a remote or network exception occurs.public long getRpcTimeout(TimeUnit unit)
TablegetRpcTimeout in interface Tableunit - the unit of time the timeout to be represented inTable.getReadRpcTimeout(TimeUnit), 
Table.getWriteRpcTimeout(TimeUnit)public long getReadRpcTimeout(TimeUnit unit)
TablegetReadRpcTimeout in interface Tableunit - the unit of time the timeout to be represented inpublic long getWriteRpcTimeout(TimeUnit unit)
TablegetWriteRpcTimeout in interface Tableunit - the unit of time the timeout to be represented inpublic long getOperationTimeout(TimeUnit unit)
TablegetOperationTimeout in interface Tableunit - the unit of time the timeout to be represented inpublic CoprocessorRpcChannel coprocessorService(byte[] row)
TableRpcChannel instance connected to the
 table region containing the specified row.  The row given does not actually have
 to exist.  Whichever region would contain the row based on start and end keys will
 be used.  Note that the row parameter is also not passed to the
 coprocessor handler registered for this protocol, unless the row
 is separately passed as an argument in the service request.  The parameter
 here is only used to locate the region used to handle the call.
 
 The obtained RpcChannel instance can be used to access a published
 coprocessor Service using standard protobuf service invocations:
 
 CoprocessorRpcChannel channel = myTable.coprocessorService(rowkey);
 MyService.BlockingInterface service = MyService.newBlockingStub(channel);
 MyCallRequest request = MyCallRequest.newBuilder()
     ...
     .build();
 MyCallResponse response = service.myCall(null, request);
 coprocessorService in interface Tablerow - The row key used to identify the remote region locationpublic RegionLocator getRegionLocator() throws IOException
TableRegionLocator for this table.getRegionLocator in interface TableIOExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.