Search in sources :

Example 1 with MultipleLinearRandomRetry

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();
}
Also used : MultipleLinearRandomRetry(org.apache.ratis.retry.MultipleLinearRandomRetry) RatisClientConfig(org.apache.hadoop.hdds.ratis.conf.RatisClientConfig) ExponentialBackoffRetry(org.apache.ratis.retry.ExponentialBackoffRetry)

Aggregations

RatisClientConfig (org.apache.hadoop.hdds.ratis.conf.RatisClientConfig)1 ExponentialBackoffRetry (org.apache.ratis.retry.ExponentialBackoffRetry)1 MultipleLinearRandomRetry (org.apache.ratis.retry.MultipleLinearRandomRetry)1