AbstractRetryingOperation (Cloud Bigtable HBase Client for Java 1.12.0 API)

com.google.cloud.bigtable.grpc.async

Class AbstractRetryingOperation<RequestT,ResponseT,ResultT>

  • java.lang.Object
    • io.grpc.ClientCall.Listener<ResponseT>
      • com.google.cloud.bigtable.grpc.async.AbstractRetryingOperation<RequestT,ResponseT,ResultT>
    • Method Detail

      • onClose

        public void onClose(io.grpc.Status status,
                            io.grpc.Metadata trailers)
        Overrides:
        onClose in class io.grpc.ClientCall.Listener<ResponseT>
      • finalizeStats

        protected void finalizeStats(io.grpc.Status status)
      • onError

        protected void onError(io.grpc.Status status,
                               io.grpc.Metadata trailers)
      • performRetry

        protected void performRetry(long nextBackOff)
      • getRunnable

        protected Runnable getRunnable()
      • isRequestRetryable

        protected boolean isRequestRetryable()
      • setException

        protected void setException(Exception exception)
      • onOK

        protected abstract 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
        Returns:
        true if the operation was really completed.
      • getNextBackoff

        protected Long getNextBackoff()
      • inRetryMode

        public boolean inRetryMode()
      • resetStatusBasedBackoff

        protected void resetStatusBasedBackoff()
        Either a response was found, or a timeout event occurred. Reset the information relating to Status oriented exception handling.
      • getOperationCallOptions

        protected io.grpc.CallOptions getOperationCallOptions()
        Returns the CallOptions that a user set for the entire Operation, which can span multiple RPCs/retries.
        Returns:
        The CallOptions
      • getRpcCallOptions

        protected io.grpc.CallOptions getRpcCallOptions()
        Create an CallOptions that has a fail safe RPC deadline to make sure that unary operations don't stop responding. This will have to be overridden for streaming RPCs like read rows.

        The logic is as follows:

        1. If the user provides a deadline, use the deadline
        2. Else If this is a streaming read, don't set an explicit deadline. The Watchdog will handle unresponsiveness
        3. Else Set a deadline of UNARY_DEADLINE_MINUTES minutes deadline.

        Returns:
        a CallOptions
        See Also:
        Watchdog which handles unresponsiveness for streaming reads.
      • isStreamingRead

        protected boolean isStreamingRead()
      • getRetryRequest

        protected RequestT getRetryRequest()
      • cancel

        public void cancel()
        Cancels the RPC.
      • getBlockingResult

        public ResultT getBlockingResult()
      • cancel

        protected void cancel(String message)
        Cancels the RPC with a specific message.
        Parameters:
        message -