Class OperationTimedPollAlgorithm (2.48.0)

public class OperationTimedPollAlgorithm extends ExponentialRetryAlgorithm

Operation timed polling algorithm, which uses exponential backoff factor for determining when the next polling operation should be executed. If the polling exceeds the total timeout this algorithm cancels polling.

Inheritance

java.lang.Object > ExponentialRetryAlgorithm > OperationTimedPollAlgorithm

Static Methods

create(RetrySettings globalSettings)

public static OperationTimedPollAlgorithm create(RetrySettings globalSettings)

Creates the polling algorithm, using the default NanoClock for time computations.

Parameter
Name Description
globalSettings RetrySettings

the settings

Returns
Type Description
OperationTimedPollAlgorithm

timed poll algorithm

create(RetrySettings globalSettings, ApiClock clock)

public static OperationTimedPollAlgorithm create(RetrySettings globalSettings, ApiClock clock)
Parameters
Name Description
globalSettings RetrySettings
clock ApiClock
Returns
Type Description
OperationTimedPollAlgorithm

Methods

shouldRPCTerminate(long timeLeftMs)

protected boolean shouldRPCTerminate(long timeLeftMs)
Parameter
Name Description
timeLeftMs long
Returns
Type Description
boolean
Overrides

shouldRetry(TimedAttemptSettings nextAttemptSettings)

public boolean shouldRetry(TimedAttemptSettings nextAttemptSettings)

Returns true if another poll operation should be made or throws CancellationException otherwise.

Parameter
Name Description
nextAttemptSettings TimedAttemptSettings

attempt settings, which will be used for the next attempt, if accepted

Returns
Type Description
boolean

true if more attempts should be made, never returns false (throws CancellationException instead)

Overrides
Exceptions
Type Description
CancellationException

if no more attempts should be made