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);
}
Aggregations