Search in sources :

Example 1 with ExponentialPollAlgorithm

use of com.google.api.gax.retrying.ExponentialPollAlgorithm in project java-bigtable by googleapis.

the class AwaitReplicationCallable method create.

static AwaitReplicationCallable create(UnaryCallable<GenerateConsistencyTokenRequest, GenerateConsistencyTokenResponse> generateCallable, UnaryCallable<CheckConsistencyRequest, CheckConsistencyResponse> checkCallable, ClientContext clientContext, RetrySettings pollingSettings) {
    RetryAlgorithm<CheckConsistencyResponse> retryAlgorithm = new RetryAlgorithm<>(new PollResultAlgorithm(), new ExponentialPollAlgorithm(pollingSettings, clientContext.getClock()));
    RetryingExecutor<CheckConsistencyResponse> retryingExecutor = new ScheduledRetryingExecutor<>(retryAlgorithm, clientContext.getExecutor());
    return new AwaitReplicationCallable(generateCallable, checkCallable, retryingExecutor);
}
Also used : ScheduledRetryingExecutor(com.google.api.gax.retrying.ScheduledRetryingExecutor) CheckConsistencyResponse(com.google.bigtable.admin.v2.CheckConsistencyResponse) RetryAlgorithm(com.google.api.gax.retrying.RetryAlgorithm) ResultRetryAlgorithm(com.google.api.gax.retrying.ResultRetryAlgorithm) ExponentialPollAlgorithm(com.google.api.gax.retrying.ExponentialPollAlgorithm)

Aggregations

ExponentialPollAlgorithm (com.google.api.gax.retrying.ExponentialPollAlgorithm)1 ResultRetryAlgorithm (com.google.api.gax.retrying.ResultRetryAlgorithm)1 RetryAlgorithm (com.google.api.gax.retrying.RetryAlgorithm)1 ScheduledRetryingExecutor (com.google.api.gax.retrying.ScheduledRetryingExecutor)1 CheckConsistencyResponse (com.google.bigtable.admin.v2.CheckConsistencyResponse)1