RetryingReadRowsOperation (Cloud Bigtable HBase Client for Java 1.12.0 API)

com.google.cloud.bigtable.grpc.scanner

Class RetryingReadRowsOperation

  • All Implemented Interfaces:
    ScanHandler


    @NotThreadSafe
    public class RetryingReadRowsOperation
    extends AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
    implements ScanHandler
    An extension of 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 .
    Author:
    sduskis
    • Constructor Detail

      • RetryingReadRowsOperation

        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,
                                         io.grpc.CallOptions callOptions,
                                         ScheduledExecutorService retryExecutorService,
                                         io.grpc.Metadata originalMetadata,
                                         com.google.api.core.ApiClock clock)
    • Method Detail

      • setResultObserver

        public void setResultObserver(io.grpc.stub.StreamObserver<com.google.bigtable.v2.ReadRowsResponse> resultObserver)
      • getRetryRequest

        protected com.google.bigtable.v2.ReadRowsRequest getRetryRequest()
        Updates the original request via ReadRowsRequestManager.buildUpdatedRequest().
        Overrides:
        getRetryRequest in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
      • onMessage

        public void onMessage(com.google.bigtable.v2.ReadRowsResponse message)
        Overrides:
        onMessage in class io.grpc.ClientCall.Listener<com.google.bigtable.v2.ReadRowsResponse>
      • onClose

        public void onClose(io.grpc.Status status,
                            io.grpc.Metadata trailers)
        Overrides:
        onClose in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
      • isRequestRetryable

        protected boolean isRequestRetryable()
        All read rows requests are retryable.
        Overrides:
        isRequestRetryable in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
      • onOK

        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. If a subclass has to retry, due to the message, this method will return false
        Specified by:
        onOK in class AbstractRetryingOperation<com.google.bigtable.v2.ReadRowsRequest,com.google.bigtable.v2.ReadRowsResponse,String>
        Returns:
        true if the operation was really completed.