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 |
---|---|
protected static Logger |
LOG
Constant
LOG |
static long |
MAX_RPC_WAIT_TIME |
Constructor and Description |
---|
BulkMutation(BigtableTableName tableName,
AsyncExecutor asyncExecutor,
RetryOptions retryOptions,
ScheduledExecutorService retryExecutorService,
int maxRowKeyCount,
long maxRequestSize)
Constructor for BulkMutation.
|
BulkMutation(BigtableTableName tableName,
AsyncExecutor asyncExecutor,
RetryOptions retryOptions,
ScheduledExecutorService retryExecutorService,
int maxRowKeyCount,
long maxRequestSize,
long autoflushMs)
Constructor for BulkMutation.
|
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<MutateRowResponse> |
add(MutateRowRequest request) |
com.google.common.util.concurrent.ListenableFuture<MutateRowResponse> |
add(MutateRowsRequest.Entry entry)
Adds a
MutateRowsRequest.Entry to the MutateRowsRequest.Builder . |
void |
flush()
Send any outstanding
MutateRowRequest s. |
boolean |
isFlushed() |
protected static final Logger LOG
LOG
public static final long MAX_RPC_WAIT_TIME
public BulkMutation(BigtableTableName tableName, AsyncExecutor asyncExecutor, RetryOptions retryOptions, ScheduledExecutorService retryExecutorService, int maxRowKeyCount, long maxRequestSize)
tableName
- a BigtableTableName
object for the table to which all MutateRowRequest
s will be sent.asyncExecutor
- a AsyncExecutor
object that asynchronously sends MutateRowsRequest
.retryOptions
- a RetryOptions
object that describes how to perform retries.retryExecutorService
- a ScheduledExecutorService
object on which to schedule
retries.maxRowKeyCount
- describes the maximum number of MutateRowRequest
s to send in a
single MutateRowsRequest
.maxRequestSize
- describes the maximum cumulative size of a MutateRowsRequest
.public BulkMutation(BigtableTableName tableName, AsyncExecutor asyncExecutor, RetryOptions retryOptions, ScheduledExecutorService retryExecutorService, int maxRowKeyCount, long maxRequestSize, long autoflushMs)
tableName
- a BigtableTableName
object for the table to which all MutateRowRequest
s will be sent.asyncExecutor
- a AsyncExecutor
object that asynchronously sends MutateRowsRequest
.retryOptions
- a RetryOptions
object that describes how to perform retries.retryExecutorService
- a ScheduledExecutorService
object on which to schedule
retries.maxRowKeyCount
- describes the maximum number of MutateRowRequest
s to send in a
single MutateRowsRequest
.maxRequestSize
- describes the maximum cumulative size of a MutateRowsRequest
.autoflushMs
- the maximum number of milliseconds that items can linger before being flush. 0 to disable.public com.google.common.util.concurrent.ListenableFuture<MutateRowResponse> add(MutateRowRequest request)
public com.google.common.util.concurrent.ListenableFuture<MutateRowResponse> add(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()
MutateRowRequest
s.public boolean isFlushed()
MutateRowRequest
that still need to be sent.