@InternalApi(value="For internal usage only") public class BatchExecutor extends Object implements AutoCloseable
Table.batch(List, Object[]). Table.put(List) and Table.get(List). This class relies on implementations found in
BulkReadWrapper and in BigtableBufferedMutatorHelper.
For internal use only - public for technical reasons.
| Modifier and Type | Field and Description |
|---|---|
protected com.google.cloud.bigtable.metrics.Timer |
batchTimer |
protected static Logger |
LOG
Constant
LOG |
static byte[] |
NO_REGION
For callbacks that take a region, this is the region we will use.
|
protected HBaseRequestAdapter |
requestAdapter |
protected BigtableHBaseSettings |
settings |
| Constructor and Description |
|---|
BatchExecutor(BigtableApi bigtableApi,
BigtableHBaseSettings settings,
HBaseRequestAdapter adapter)
Constructor for BatchExecutor.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.hbase.client.Result[] |
batch(List<? extends org.apache.hadoop.hbase.client.Row> actions)
batch.
|
void |
batch(List<? extends org.apache.hadoop.hbase.client.Row> actions,
Object[] results)
batch.
|
<R> void |
batchCallback(List<? extends org.apache.hadoop.hbase.client.Row> actions,
Object[] results,
org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) |
void |
close() |
boolean[] |
exists(List<org.apache.hadoop.hbase.client.Get> gets)
Implementation of
Table.existsAll(List). |
<R> List<com.google.api.core.ApiFuture<?>> |
issueAsyncRowRequests(List<? extends org.apache.hadoop.hbase.client.Row> actions,
Object[] results,
org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) |
protected static final Logger LOG
LOGpublic static final byte[] NO_REGION
protected final BigtableHBaseSettings settings
protected final HBaseRequestAdapter requestAdapter
protected final com.google.cloud.bigtable.metrics.Timer batchTimer
public BatchExecutor(BigtableApi bigtableApi, BigtableHBaseSettings settings, HBaseRequestAdapter adapter)
bigtableApi - a BigtableApi object to access bigtable data client.settings - a BigtableHBaseSettings object for bigtable settings.adapter - a HBaseRequestAdapter object to convert HBase object to Bigtable protos.public void close()
throws IOException
close in interface AutoCloseableIOExceptionpublic void batch(List<? extends org.apache.hadoop.hbase.client.Row> actions, @Nullable Object[] results) throws IOException, InterruptedException
actions - a List object.results - an array of Object objects.IOException - if any.InterruptedException - if any.public <R> List<com.google.api.core.ApiFuture<?>> issueAsyncRowRequests(List<? extends org.apache.hadoop.hbase.client.Row> actions, Object[] results, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback)
public org.apache.hadoop.hbase.client.Result[] batch(List<? extends org.apache.hadoop.hbase.client.Row> actions) throws IOException
actions - a List object.Result objects.IOException - if any.public <R> void batchCallback(List<? extends org.apache.hadoop.hbase.client.Row> actions, Object[] results, org.apache.hadoop.hbase.client.coprocessor.Batch.Callback<R> callback) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic boolean[] exists(List<org.apache.hadoop.hbase.client.Get> gets) throws IOException
Table.existsAll(List).gets - a List object.Boolean objects.IOException - if any.