com.google.cloud.bigtable.hbase
Class BatchExecutor
- java.lang.Object
-
- com.google.cloud.bigtable.hbase.BatchExecutor
-
public class BatchExecutor extends Object
Class to help BigtableTable with batch operations on an BigtableClient, such asTable.batch(List, Object[])
.Table.put(List)
andTable.get(List)
. This class relies on implementations found inBulkRead
and inBigtableBufferedMutatorHelper
.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Field Summary
Fields Modifier and Type Field and Description protected Timer
batchTimer
protected static Logger
LOG
ConstantLOG
static byte[]
NO_REGION
For callbacks that take a region, this is the region we will use.protected BigtableOptions
options
protected HBaseRequestAdapter
requestAdapter
-
Constructor Summary
Constructors Constructor and Description BatchExecutor(BigtableSession session, HBaseRequestAdapter requestAdapter)
Constructor for BatchExecutor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Result[]
batch(List<? extends Row> actions)
batch.void
batch(List<? extends Row> actions, Object[] results)
batch.<R> void
batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback)
Implementation ofHTable.batchCallback(List, Object[], Batch.Callback)
boolean[]
exists(List<Get> gets)
Implementation ofTable.existsAll(List)
.<R> List<com.google.api.core.ApiFuture<?>>
issueAsyncRowRequests(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback)
-
-
-
Field Detail
-
LOG
protected static final Logger LOG
ConstantLOG
-
NO_REGION
public static final byte[] NO_REGION
For callbacks that take a region, this is the region we will use.
-
options
protected final BigtableOptions options
-
requestAdapter
protected final HBaseRequestAdapter requestAdapter
-
batchTimer
protected final Timer batchTimer
-
-
Constructor Detail
-
BatchExecutor
public BatchExecutor(BigtableSession session, HBaseRequestAdapter requestAdapter)
Constructor for BatchExecutor.- Parameters:
session
- aBigtableSession
object.requestAdapter
- aHBaseRequestAdapter
object.
-
-
Method Detail
-
batch
public void batch(List<? extends Row> actions, @Nullable Object[] results) throws IOException, InterruptedException
batch.- Parameters:
actions
- aList
object.results
- an array ofObject
objects.- Throws:
IOException
- if any.InterruptedException
- if any.
-
issueAsyncRowRequests
public <R> List<com.google.api.core.ApiFuture<?>> issueAsyncRowRequests(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback)
-
batch
public Result[] batch(List<? extends Row> actions) throws IOException
batch.- Parameters:
actions
- aList
object.- Returns:
- an array of
Result
objects. - Throws:
IOException
- if any.
-
batchCallback
public <R> void batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback) throws IOException, InterruptedException
Implementation ofHTable.batchCallback(List, Object[], Batch.Callback)
- Type Parameters:
R
- a R object.- Parameters:
actions
- aList
object.results
- an array ofObject
objects.callback
- aBatch.Callback
object.- Throws:
IOException
- if any.InterruptedException
- if any.
-
exists
public boolean[] exists(List<Get> gets) throws IOException
Implementation ofTable.existsAll(List)
.- Parameters:
gets
- aList
object.- Returns:
- an array of
Boolean
objects. - Throws:
IOException
- if any.
-
-