use of org.apache.ratis.retry.MultipleLinearRandomRetry in project ozone by apache.
the class RequestTypeDependentRetryPolicyCreator method create.
@Override
public RetryPolicy create(ConfigurationSource conf) {
RatisClientConfig ratisClientConfig = conf.getObject(RatisClientConfig.class);
ExponentialBackoffRetry exponentialBackoffRetry = createExponentialBackoffPolicy(ratisClientConfig);
MultipleLinearRandomRetry multipleLinearRandomRetry = MultipleLinearRandomRetry.parseCommaSeparated(ratisClientConfig.getMultilinearPolicy());
return RequestTypeDependentRetryPolicy.newBuilder().setRetryPolicy(RaftProtos.RaftClientRequestProto.TypeCase.WRITE, createExceptionDependentPolicy(exponentialBackoffRetry, multipleLinearRandomRetry, exponentialBackoffRetry)).setRetryPolicy(RaftProtos.RaftClientRequestProto.TypeCase.WATCH, createExceptionDependentPolicy(exponentialBackoffRetry, multipleLinearRandomRetry, RetryPolicies.noRetry())).setTimeout(RaftProtos.RaftClientRequestProto.TypeCase.WRITE, toTimeDuration(ratisClientConfig.getWriteRequestTimeout())).setTimeout(RaftProtos.RaftClientRequestProto.TypeCase.WATCH, toTimeDuration(ratisClientConfig.getWatchRequestTimeout())).build();
}
Aggregations