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<CheckAndMutateRowRequest,CheckAndMutateRowResponse> |
CHECK_AND_MUTATE_ASYNC
|
protected static Logger |
LOG
Constant
LOG |
protected static AsyncExecutor.AsyncCall<MutateRowRequest,MutateRowResponse> |
MUTATE_ROW_ASYNC
|
protected static AsyncExecutor.AsyncCall<MutateRowsRequest,List<MutateRowsResponse>> |
MUTATE_ROWS_ASYNC
|
protected static AsyncExecutor.AsyncCall<ReadRowsRequest,List<FlatRow>> |
READ_FLAT_ROWS_ASYNC
|
protected static AsyncExecutor.AsyncCall<ReadModifyWriteRowRequest,ReadModifyWriteRowResponse> |
READ_MODIFY_WRITE_ASYNC
|
protected static AsyncExecutor.AsyncCall<ReadRowsRequest,List<Row>> |
READ_ROWS_ASYNC
|
Constructor and Description |
---|
AsyncExecutor(BigtableDataClient client,
RpcThrottler rpcThrottler)
Constructor for AsyncExecutor.
|
protected static final Logger LOG
LOG
protected static AsyncExecutor.AsyncCall<MutateRowRequest,MutateRowResponse> MUTATE_ROW_ASYNC
protected static AsyncExecutor.AsyncCall<MutateRowsRequest,List<MutateRowsResponse>> MUTATE_ROWS_ASYNC
protected static AsyncExecutor.AsyncCall<ReadModifyWriteRowRequest,ReadModifyWriteRowResponse> READ_MODIFY_WRITE_ASYNC
protected static AsyncExecutor.AsyncCall<CheckAndMutateRowRequest,CheckAndMutateRowResponse> CHECK_AND_MUTATE_ASYNC
protected static AsyncExecutor.AsyncCall<ReadRowsRequest,List<Row>> READ_ROWS_ASYNC
protected static AsyncExecutor.AsyncCall<ReadRowsRequest,List<FlatRow>> READ_FLAT_ROWS_ASYNC
public AsyncExecutor(BigtableDataClient client, RpcThrottler rpcThrottler)
Constructor for AsyncExecutor.
client
- a BigtableDataClient
object.rpcThrottler
- a RpcThrottler
object.public com.google.common.util.concurrent.ListenableFuture<MutateRowResponse> mutateRowAsync(MutateRowRequest request, long operationId)
BigtableDataClient.mutateRowAsync(MutateRowRequest)
on the
MutateRowRequest
given an operationId generated from
RpcThrottler.registerOperationWithHeapSize(long)
.request
- The MutateRowRequest
to send.operationId
- The Id generated from
RpcThrottler.registerOperationWithHeapSize(long)
that will be released when
the mutate operation is completed.ListenableFuture
which can be listened to for completion events.public com.google.common.util.concurrent.ListenableFuture<List<MutateRowsResponse>> mutateRowAsync(MutateRowsRequest request, long operationId)
BigtableDataClient.mutateRowsAsync(MutateRowsRequest)
on the
MutateRowsRequest
given an operationId generated from
RpcThrottler.registerOperationWithHeapSize(long)
.request
- The MutateRowsRequest
to send.operationId
- The Id generated from
RpcThrottler.registerOperationWithHeapSize(long)
that will be released when
the mutate operation is completed.ListenableFuture
which can be listened to for completion events.public com.google.common.util.concurrent.ListenableFuture<CheckAndMutateRowResponse> checkAndMutateRowAsync(CheckAndMutateRowRequest request, long operationId)
BigtableDataClient.checkAndMutateRowAsync(CheckAndMutateRowRequest)
on the
CheckAndMutateRowRequest
given an operationId generated from
RpcThrottler.registerOperationWithHeapSize(long)
.request
- The CheckAndMutateRowRequest
to send.operationId
- The Id generated from
RpcThrottler.registerOperationWithHeapSize(long)
that will be released when
the checkAndMutateRow operation is completed.ListenableFuture
which can be listened to for completion events.public com.google.common.util.concurrent.ListenableFuture<ReadModifyWriteRowResponse> readModifyWriteRowAsync(ReadModifyWriteRowRequest request, long operationId)
BigtableDataClient.readModifyWriteRowAsync(ReadModifyWriteRowRequest)
on the
ReadModifyWriteRowRequest
given an operationId generated from
RpcThrottler.registerOperationWithHeapSize(long)
.request
- The ReadModifyWriteRowRequest
to send.operationId
- The Id generated from
RpcThrottler.registerOperationWithHeapSize(long)
that will be released when
the readModifyWriteRowAsync operation is completed.ListenableFuture
which can be listened to for completion events.public com.google.common.util.concurrent.ListenableFuture<List<Row>> readRowsAsync(ReadRowsRequest request, long operationId)
BigtableDataClient.readRowsAsync(ReadRowsRequest)
on the
ReadRowsRequest
given an operationId generated from
RpcThrottler.registerOperationWithHeapSize(long)
.request
- The ReadRowsRequest
to send.operationId
- a long.ListenableFuture
which can be listened to for completion events.public com.google.common.util.concurrent.ListenableFuture<MutateRowResponse> mutateRowAsync(MutateRowRequest request) throws InterruptedException
BigtableDataClient.mutateRowAsync(MutateRowRequest)
on the
MutateRowRequest
. This method may block if
RpcThrottler.registerOperationWithHeapSize(long)
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<MutateRowsResponse>> mutateRowsAsync(MutateRowsRequest request) throws InterruptedException
BigtableDataClient.mutateRowsAsync(MutateRowsRequest)
on the
MutateRowsRequest
. This method may block if
RpcThrottler.registerOperationWithHeapSize(long)
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<CheckAndMutateRowResponse> checkAndMutateRowAsync(CheckAndMutateRowRequest request) throws InterruptedException
BigtableDataClient.checkAndMutateRowAsync(CheckAndMutateRowRequest)
on the
CheckAndMutateRowRequest
. This method may block if
RpcThrottler.registerOperationWithHeapSize(long)
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<ReadModifyWriteRowResponse> readModifyWriteRowAsync(ReadModifyWriteRowRequest request) throws InterruptedException
BigtableDataClient.readModifyWriteRow(ReadModifyWriteRowRequest)
on the
ReadModifyWriteRowRequest
. This method may block if
RpcThrottler.registerOperationWithHeapSize(long)
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<Row>> readRowsAsync(ReadRowsRequest request) throws InterruptedException
BigtableDataClient.readRowsAsync(ReadRowsRequest)
on the
ReadRowsRequest
. This method may block if
RpcThrottler.registerOperationWithHeapSize(long)
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(ReadRowsRequest request) throws InterruptedException
BigtableDataClient.readRowsAsync(ReadRowsRequest)
on the
ReadRowsRequest
. This method may block if
RpcThrottler.registerOperationWithHeapSize(long)
blocks.request
- The ReadRowsRequest
to send.ListenableFuture
which can be listened to for completion events.InterruptedException
- if any.public void flush() throws IOException
RpcThrottler
complete. See
RpcThrottler.awaitCompletion()
for more information.IOException
- if something goes wrong.public boolean hasInflightRequests()
hasInflightRequests.
public long getMaxHeapSize()
getMaxHeapSize.
public BigtableDataClient getClient()
Getter for the field client
.
BigtableDataClient
object.public RpcThrottler getRpcThrottler()
Getter for the field rpcThrottler
.
RpcThrottler
object.