public class BulkMutation extends Object
MutateRowRequest
s into a single MutateRowsRequest
. This class is not thread safe, and requires calling classes to make it thread
safe.Modifier and Type | Field and Description |
---|---|
static long |
MAX_RPC_WAIT_TIME_NANOS |
Constructor and Description |
---|
BulkMutation(BigtableTableName tableName,
BigtableDataClient client,
ScheduledExecutorService retryExecutorService,
BulkOptions bulkOptions)
Constructor for BulkMutation.
|
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.MutateRowResponse> |
add(com.google.bigtable.v2.MutateRowRequest request) |
com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.MutateRowResponse> |
add(com.google.bigtable.v2.MutateRowsRequest.Entry entry)
Adds a
MutateRowsRequest.Entry to the MutateRowsRequest.Builder . |
void |
flush()
Send any outstanding
MutateRowRequest s and wait until all requests are complete. |
boolean |
isFlushed() |
public BulkMutation(BigtableTableName tableName, BigtableDataClient client, ScheduledExecutorService retryExecutorService, BulkOptions bulkOptions)
tableName
- a BigtableTableName
object for the table to which all
MutateRowRequest
s will be sent.client
- a BigtableDataClient
object on which to perform RPCs.
RPCs that this object performed.retryExecutorService
- a ScheduledExecutorService
object on which to schedule
retries.bulkOptions
- a BulkOptions
with the user specified options for the behavior of
this instance.public com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.MutateRowResponse> add(com.google.bigtable.v2.MutateRowRequest request)
public com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.MutateRowResponse> add(com.google.bigtable.v2.MutateRowsRequest.Entry entry)
MutateRowsRequest.Entry
to the MutateRowsRequest.Builder
.entry
- The MutateRowsRequest.Entry
to addSettableFuture
that will be populated when
the MutateRowsResponse
returns from the server. See BulkMutation.Batch.addCallback(ListenableFuture)
for more information about how the
SettableFuture is set.public void flush() throws InterruptedException
MutateRowRequest
s and wait until all requests are complete.InterruptedException
public boolean isFlushed()
MutateRowRequest
that still need to be sent.