public class AsyncExecutor extends Object
Modifier and Type | Class and Description |
---|---|
protected static interface |
AsyncExecutor.AsyncCall<RequestT,ResponseT> |
Modifier and Type | Field and Description |
---|---|
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.CheckAndMutateRowRequest,com.google.bigtable.v2.CheckAndMutateRowResponse> |
CHECK_AND_MUTATE_ASYNC
|
protected static Logger |
LOG
Constant
LOG |
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.MutateRowRequest,com.google.bigtable.v2.MutateRowResponse> |
MUTATE_ROW_ASYNC
|
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.MutateRowsRequest,List<com.google.bigtable.v2.MutateRowsResponse>> |
MUTATE_ROWS_ASYNC
|
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.ReadRowsRequest,List<FlatRow>> |
READ_FLAT_ROWS_ASYNC
|
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.ReadModifyWriteRowRequest,com.google.bigtable.v2.ReadModifyWriteRowResponse> |
READ_MODIFY_WRITE_ASYNC
|
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.ReadRowsRequest,List<com.google.bigtable.v2.Row>> |
READ_ROWS_ASYNC
|
Constructor and Description |
---|
AsyncExecutor(BigtableDataClient client)
Constructor for AsyncExecutor.
|
Modifier and Type | Method and Description |
---|---|
com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.CheckAndMutateRowResponse> |
checkAndMutateRowAsync(com.google.bigtable.v2.CheckAndMutateRowRequest request)
Performs a
BigtableDataClient.checkAndMutateRowAsync(CheckAndMutateRowRequest) on the
CheckAndMutateRowRequest . |
void |
flush()
Waits until all operations managed by the
OperationAccountant complete. |
BigtableDataClient |
getClient()
Getter for the field
client . |
OperationAccountant |
getOperationAccountant()
Getter for the field
operationsAccountant . |
boolean |
hasInflightRequests()
hasInflightRequests.
|
com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.MutateRowResponse> |
mutateRowAsync(com.google.bigtable.v2.MutateRowRequest request)
Performs a
BigtableDataClient.mutateRowAsync(MutateRowRequest) on the
MutateRowRequest . |
com.google.common.util.concurrent.ListenableFuture<List<com.google.bigtable.v2.MutateRowsResponse>> |
mutateRowsAsync(com.google.bigtable.v2.MutateRowsRequest request)
Performs a
BigtableDataClient.mutateRowsAsync(MutateRowsRequest) on the
MutateRowsRequest . |
com.google.common.util.concurrent.ListenableFuture<List<FlatRow>> |
readFlatRowsAsync(com.google.bigtable.v2.ReadRowsRequest request)
Performs a
BigtableDataClient.readRowsAsync(ReadRowsRequest) on the
ReadRowsRequest . |
com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.ReadModifyWriteRowResponse> |
readModifyWriteRowAsync(com.google.bigtable.v2.ReadModifyWriteRowRequest request)
Performs a
BigtableDataClient.readModifyWriteRow(ReadModifyWriteRowRequest) on the
ReadModifyWriteRowRequest . |
com.google.common.util.concurrent.ListenableFuture<List<com.google.bigtable.v2.Row>> |
readRowsAsync(com.google.bigtable.v2.ReadRowsRequest request)
Performs a
BigtableDataClient.readRowsAsync(ReadRowsRequest) on the
ReadRowsRequest . |
protected static final Logger LOG
LOG
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.MutateRowRequest,com.google.bigtable.v2.MutateRowResponse> MUTATE_ROW_ASYNC
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.MutateRowsRequest,List<com.google.bigtable.v2.MutateRowsResponse>> MUTATE_ROWS_ASYNC
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.ReadModifyWriteRowRequest,com.google.bigtable.v2.ReadModifyWriteRowResponse> READ_MODIFY_WRITE_ASYNC
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.CheckAndMutateRowRequest,com.google.bigtable.v2.CheckAndMutateRowResponse> CHECK_AND_MUTATE_ASYNC
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.ReadRowsRequest,List<com.google.bigtable.v2.Row>> READ_ROWS_ASYNC
protected static AsyncExecutor.AsyncCall<com.google.bigtable.v2.ReadRowsRequest,List<FlatRow>> READ_FLAT_ROWS_ASYNC
public AsyncExecutor(BigtableDataClient client)
Constructor for AsyncExecutor.
client
- a BigtableDataClient
object for executing
RPCs.public com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.MutateRowResponse> mutateRowAsync(com.google.bigtable.v2.MutateRowRequest request) throws InterruptedException
BigtableDataClient.mutateRowAsync(MutateRowRequest)
on the
MutateRowRequest
. This method may block if
OperationAccountant.registerOperation(ListenableFuture)
blocks.request
- The MutateRowRequest
to send.ListenableFuture
which can be listened to for completion events.InterruptedException
- if any.public com.google.common.util.concurrent.ListenableFuture<List<com.google.bigtable.v2.MutateRowsResponse>> mutateRowsAsync(com.google.bigtable.v2.MutateRowsRequest request) throws InterruptedException
BigtableDataClient.mutateRowsAsync(MutateRowsRequest)
on the
MutateRowsRequest
. This method may block if
OperationAccountant.registerOperation(ListenableFuture)
blocks.request
- The MutateRowRequest
to send.ListenableFuture
which can be listened to for completion events.InterruptedException
- if any.public com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.CheckAndMutateRowResponse> checkAndMutateRowAsync(com.google.bigtable.v2.CheckAndMutateRowRequest request) throws InterruptedException
BigtableDataClient.checkAndMutateRowAsync(CheckAndMutateRowRequest)
on the
CheckAndMutateRowRequest
. This method may block if
OperationAccountant.registerOperation(ListenableFuture)
blocks.request
- The CheckAndMutateRowRequest
to send.ListenableFuture
which can be listened to for completion events.InterruptedException
- if any.public com.google.common.util.concurrent.ListenableFuture<com.google.bigtable.v2.ReadModifyWriteRowResponse> readModifyWriteRowAsync(com.google.bigtable.v2.ReadModifyWriteRowRequest request) throws InterruptedException
BigtableDataClient.readModifyWriteRow(ReadModifyWriteRowRequest)
on the
ReadModifyWriteRowRequest
. This method may block if
OperationAccountant.registerOperation(ListenableFuture)
blocks.request
- The ReadModifyWriteRowRequest
to send.ListenableFuture
which can be listened to for completion events.InterruptedException
- if any.public com.google.common.util.concurrent.ListenableFuture<List<com.google.bigtable.v2.Row>> readRowsAsync(com.google.bigtable.v2.ReadRowsRequest request) throws InterruptedException
BigtableDataClient.readRowsAsync(ReadRowsRequest)
on the
ReadRowsRequest
. This method may block if
OperationAccountant.registerOperation(ListenableFuture)
blocks.request
- The ReadRowsRequest
to send.ListenableFuture
which can be listened to for completion events.InterruptedException
- if any.public com.google.common.util.concurrent.ListenableFuture<List<FlatRow>> readFlatRowsAsync(com.google.bigtable.v2.ReadRowsRequest request) throws InterruptedException
BigtableDataClient.readRowsAsync(ReadRowsRequest)
on the
ReadRowsRequest
. This method may block if
OperationAccountant.registerOperation(ListenableFuture)
blocks.request
- The ReadRowsRequest
to send.ListenableFuture
which can be listened to for completion events.InterruptedException
- if any.public void flush() throws IOException
OperationAccountant
complete. See
OperationAccountant.awaitCompletion()
for more
information.IOException
- if something goes wrong.public boolean hasInflightRequests()
hasInflightRequests.
public BigtableDataClient getClient()
Getter for the field client
.
BigtableDataClient
object.public OperationAccountant getOperationAccountant()
Getter for the field operationsAccountant
.
OperationAccountant
object.