Package com.google.api.gax.retrying (2.41.0)

Repository

Settings Classes

Settings classes can be used to configure credentials, endpoints, and retry settings for a Client.

SettingsDescription
com.google.api.gax.retrying.RetrySettingsHolds the parameters for retry or poll logic with jitter, timeout and exponential backoff. Actual implementation of the logic is elsewhere.

The intent of these settings is to be used with a call to a remote server, which could either

com.google.api.gax.retrying.TimedAttemptSettingsTimed attempt execution settings. Defines time-specific properties of a retry attempt.

Classes

ClassDescription
com.google.api.gax.retrying.BasicResultRetryAlgorithmA basic implementation of ResultRetryAlgorithm. Using this implementation would mean that all exceptions should be retried, all responses should be accepted (including null) and no retrying process should ever be canceled.
com.google.api.gax.retrying.DirectRetryingExecutorThe retry executor which executes attempts in the current thread, potentially causing the current thread to sleep for the specified amount of time before execution.

This class is thread-safe.

com.google.api.gax.retrying.ExponentialPollAlgorithmThe timed poll algorithm which uses jittered exponential backoff factor for calculating the next poll execution time and throws PollException in case if total timeout or total number of attempts is reached.
com.google.api.gax.retrying.ExponentialRetryAlgorithmThe timed retry algorithm which uses jittered exponential backoff factor for calculating the next attempt execution time.

This class is thread-safe.

com.google.api.gax.retrying.NonCancellableFutureA future which cannot be cancelled from the external package.

For internal use, public for technical reasons.

com.google.api.gax.retrying.RetryAlgorithmThe retry algorithm, which makes decision based either on the thrown exception or the returned response, and the execution time settings of the previous attempt.

This class is thread-safe.

com.google.api.gax.retrying.RetrySettings.BuilderA base builder class for RetrySettings. See the class documentation of RetrySettings for a description of the different values that can be set.
com.google.api.gax.retrying.ScheduledRetryingExecutorThe retry executor which uses ScheduledExecutorService to schedule an attempt tasks.

This implementation does not manage the lifecycle of the underlying ScheduledExecutorService, so it should be managed outside of this class (like calling the ScheduledExecutorService#shutdown() when the pool is not needed anymore). In a typical usage pattern there are usually multiple instances of this class sharing same instance of the

com.google.api.gax.retrying.SimpleStreamResumptionStrategySimplest implementation of a StreamResumptionStrategy which returns the initial request for unstarted streams.
com.google.api.gax.retrying.RetryAlgorithmThe retry algorithm, which makes decision based either on the thrown exception and the execution time settings of the previous attempt. This extends RetryAlgorithm to take additional information (provided by ServerAttemptCallable) into account.
com.google.api.gax.retrying.TimedAttemptSettings.Builder

Interfaces

InterfaceDescription
com.google.api.gax.retrying.ResultRetryAlgorithmSame as ResultRetryAlgorithmWithContext, but without methods that accept a RetryingContext. Use ResultRetryAlgorithmWithContext instead of this interface when possible.
com.google.api.gax.retrying.ResultRetryAlgorithmWithContextA result retry algorithm is responsible for the following operations (based on the response returned by the previous attempt or on the thrown exception):
    com.google.api.gax.retrying.RetryingContextContext for a retryable operation.

    It provides state to individual RetryingFutures via the RetryingExecutor.

    com.google.api.gax.retrying.RetryingExecutorA retrying executor is responsible for the following operations:
    1. Creating first attempt RetryingFuture, which acts as a facade, hiding from client
    com.google.api.gax.retrying.RetryingExecutorWithContextA RetryingExecutor that accepts a per-operation context. See Also: RetryingExecutor
    com.google.api.gax.retrying.RetryingFutureRepresents a retrying future. This is a facade hiding all the complications of an asynchronous/synchronous execution of a retriable task.

    This interface is for advanced/.

    com.google.api.gax.retrying.StreamResumptionStrategyThis is part of the server retry api. Its implementers are responsible for tracking the progress of the stream and calculating a request to resume it in case of an error.

    Implementations don't have to be threadsafe because all of the calls will be serialized.

    com.google.api.gax.retrying.TimedRetryAlgorithmSame as TimedRetryAlgorithmWithContext, but without methods that accept a RetryingContext. Use TimedRetryAlgorithmWithContext instead of this interface when possible.
    com.google.api.gax.retrying.TimedRetryAlgorithmWithContextA timed retry algorithm is responsible for the following operations, based on the previous attempt settings and current time:

      Exceptions

      ExceptionDescription
      com.google.api.gax.retrying.PollExceptionPollException is thrown when polling algorithm exceeds total timeout or total number of attempts.
      com.google.api.gax.retrying.ServerAttemptExceptionA wrapper exception thrown by ServerAttemptCallable to communicate additional context to the RetryAlgorithm and to pass the original cancellation stack trace to RetryingServerCallable.