com.google.cloud.bigtable.grpc.async
Class BulkMutation
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.async.BulkMutation
-
public class BulkMutation extends Object
This class combines a collection ofMutateRowRequest
s into a singleMutateRowsRequest
. This class is not thread safe, and requires calling classes to make it thread safe.- Version:
- $Id: $Id
- Author:
- sduskis
-
-
Field Summary
Fields Modifier and Type Field and Description static long
MAX_NUMBER_OF_MUTATIONS
static long
MAX_RPC_WAIT_TIME_NANOS
-
Constructor Summary
Constructors Constructor and Description BulkMutation(BigtableTableName tableName, BigtableDataClient client, ScheduledExecutorService retryExecutorService, BulkOptions bulkOptions)
Constructor for BulkMutation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ListenableFuture<com.google.bigtable.v2.MutateRowResponse>
add(com.google.bigtable.v2.MutateRowRequest request)
ListenableFuture<com.google.bigtable.v2.MutateRowResponse>
add(com.google.bigtable.v2.MutateRowsRequest.Entry entry)
Adds aMutateRowsRequest.Entry
to theMutateRowsRequest.Builder
.void
flush()
Send any outstandingMutateRowRequest
s and wait until all requests are complete.boolean
isFlushed()
void
sendUnsent()
-
-
-
Field Detail
-
MAX_RPC_WAIT_TIME_NANOS
public static final long MAX_RPC_WAIT_TIME_NANOS
-
MAX_NUMBER_OF_MUTATIONS
public static final long MAX_NUMBER_OF_MUTATIONS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BulkMutation
public BulkMutation(BigtableTableName tableName, BigtableDataClient client, ScheduledExecutorService retryExecutorService, BulkOptions bulkOptions)
Constructor for BulkMutation.- Parameters:
tableName
- aBigtableTableName
object for the table to which allMutateRowRequest
s will be sent.client
- aBigtableDataClient
object on which to perform RPCs. RPCs that this object performed.retryExecutorService
- aScheduledExecutorService
object on which to schedule retries.bulkOptions
- aBulkOptions
with the user specified options for the behavior of this instance.
-
-
Method Detail
-
add
public ListenableFuture<com.google.bigtable.v2.MutateRowResponse> add(com.google.bigtable.v2.MutateRowRequest request)
-
add
public ListenableFuture<com.google.bigtable.v2.MutateRowResponse> add(com.google.bigtable.v2.MutateRowsRequest.Entry entry)
Adds aMutateRowsRequest.Entry
to theMutateRowsRequest.Builder
.- Parameters:
entry
- TheMutateRowsRequest.Entry
to add- Returns:
- a
SettableFuture
that will be populated when theMutateRowsResponse
returns from the server. SeeBulkMutation.Batch.addCallback(ListenableFuture)
for more information about how the SettableFuture is set.
-
flush
public void flush() throws InterruptedException
Send any outstandingMutateRowRequest
s and wait until all requests are complete.- Throws:
InterruptedException
-
sendUnsent
public void sendUnsent()
-
isFlushed
public boolean isFlushed()
- Returns:
- false if there are any outstanding
MutateRowRequest
that still need to be sent.
-
-