com.google.cloud.bigtable.grpc.async
Class BulkMutationWrapper
- java.lang.Object
-
- com.google.cloud.bigtable.grpc.async.BulkMutationWrapper
-
- All Implemented Interfaces:
- IBulkMutation
public class BulkMutationWrapper extends Object implements IBulkMutation
This class wraps existingBulkMutation
with Google-cloud-java's model.
-
-
Constructor Summary
Constructors Constructor and Description BulkMutationWrapper(BulkMutation bulkMutation, com.google.cloud.bigtable.data.v2.internal.RequestContext requestContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description com.google.api.core.ApiFuture<Void>
add(com.google.cloud.bigtable.data.v2.models.RowMutation rowMutation)
Adds aRowMutation
to the underlying IBulkMutation mechanism.void
flush()
Sends any outstandingRowMutation
and wait until all requests are complete.boolean
isFlushed()
void
sendUnsent()
Sends any outstandingRowMutation
s, present in the current batch.
-
-
-
Constructor Detail
-
BulkMutationWrapper
public BulkMutationWrapper(BulkMutation bulkMutation, com.google.cloud.bigtable.data.v2.internal.RequestContext requestContext)
-
-
Method Detail
-
add
public com.google.api.core.ApiFuture<Void> add(com.google.cloud.bigtable.data.v2.models.RowMutation rowMutation)
Adds aRowMutation
to the underlying IBulkMutation mechanism.- Specified by:
add
in interfaceIBulkMutation
- Parameters:
rowMutation
- TheRowMutation
to add.- Returns:
- a
ApiFuture
of typeVoid
will be set when request is successful otherwise exception will be thrown.
-
sendUnsent
public void sendUnsent()
Sends any outstandingRowMutation
s, present in the current batch.- Specified by:
sendUnsent
in interfaceIBulkMutation
-
flush
public void flush() throws InterruptedException
Sends any outstandingRowMutation
and wait until all requests are complete.- Specified by:
flush
in interfaceIBulkMutation
- Throws:
InterruptedException
-
isFlushed
public boolean isFlushed()
- Specified by:
isFlushed
in interfaceIBulkMutation
- Returns:
- false if there is any outstanding
RowMutation
that still needs to be sent.
-
-