@InternalApi(value="For internal usage only") @NotThreadSafe public class RetryingReadRowsOperation extends AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String> implements ScanHandler
AbstractRetryingOperation
that manages retries for the readRows streaming
RPC. This class will keep track of the last returned row key via ReadRowsRequestManager
and automatically retry from the last row key .
For internal use only - public for technical reasons.
AbstractRetryingOperation.GrpcFuture<RespT>
callWrapper, completionFuture, failedCount, LOG, operationSpan, operationTimerContext, retryExecutorService, retryOptions, rpc, rpcTimerContext
Constructor and Description |
---|
RetryingReadRowsOperation(io.grpc.stub.StreamObserver<FlatRow> observer,
RetryOptions retryOptions,
com.google.bigtable.v2.ReadRowsRequest request,
BigtableAsyncRpc<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse> retryableRpc,
DeadlineGenerator deadlineGenerator,
ScheduledExecutorService retryExecutorService,
io.grpc.Metadata originalMetadata,
com.google.api.core.ApiClock clock) |
Modifier and Type | Method and Description |
---|---|
protected CallController<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse> |
createCallController() |
protected void |
finalizeStats(io.grpc.Status status) |
protected com.google.bigtable.v2.ReadRowsRequest |
getRetryRequest()
Updates the original request via
ReadRowsRequestManager.buildUpdatedRequest() . |
protected boolean |
isRequestRetryable()
All read rows requests are retryable.
|
protected boolean |
isStatusRetryable(io.grpc.Status status)
Read rows requests are retryable if the status is a rst stream error.
|
void |
onClose(io.grpc.Status status,
io.grpc.Metadata trailers) |
void |
onMessage(com.google.bigtable.v2.ReadRowsResponse message) |
protected boolean |
onOK(io.grpc.Metadata trailers)
A subclass has the opportunity to perform the final operations it needs now that the RPC is
successfully complete.
|
protected void |
performRetry(long nextBackOff) |
void |
run()
Calls
BigtableAsyncRpc.newCall(CallOptions) and BigtableAsyncRpc.start(Object,
io.grpc.ClientCall.Listener, Metadata, ClientCall) } with this as the listener so that retries
happen correctly. |
void |
setException(Exception exception) |
void |
setResultObserver(io.grpc.stub.StreamObserver<com.google.bigtable.v2.ReadRowsResponse> resultObserver) |
cancel, cancel, getAsyncResult, getBlockingResult, getExhaustedRetriesException, getNextBackoff, getRunnable, inRetryMode, onError, resetStatusBasedBackoff
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancel
public RetryingReadRowsOperation(io.grpc.stub.StreamObserver<FlatRow> observer, RetryOptions retryOptions, com.google.bigtable.v2.ReadRowsRequest request, BigtableAsyncRpc<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse> retryableRpc, DeadlineGenerator deadlineGenerator, ScheduledExecutorService retryExecutorService, io.grpc.Metadata originalMetadata, com.google.api.core.ApiClock clock)
protected CallController<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse> createCallController()
createCallController
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
public void setResultObserver(io.grpc.stub.StreamObserver<com.google.bigtable.v2.ReadRowsResponse> resultObserver)
protected com.google.bigtable.v2.ReadRowsRequest getRetryRequest()
ReadRowsRequestManager.buildUpdatedRequest()
.getRetryRequest
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
public void run()
AbstractRetryingOperation
BigtableAsyncRpc.newCall(CallOptions)
and BigtableAsyncRpc.start(Object,
io.grpc.ClientCall.Listener, Metadata, ClientCall)
} with this as the listener so that retries
happen correctly.run
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
public void onMessage(com.google.bigtable.v2.ReadRowsResponse message)
onMessage
in class io.grpc.ClientCall.Listener<com.google.bigtable.v2.ReadRowsResponse>
protected void finalizeStats(io.grpc.Status status)
finalizeStats
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
public void onClose(io.grpc.Status status, io.grpc.Metadata trailers)
onClose
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
public void setException(Exception exception)
setException
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
protected boolean isRequestRetryable()
isRequestRetryable
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
protected boolean isStatusRetryable(io.grpc.Status status)
isStatusRetryable
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
protected boolean onOK(io.grpc.Metadata trailers)
onOK
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
protected void performRetry(long nextBackOff)
performRetry
in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>