use of org.apache.hadoop.hdds.scm.proxy.SCMSecurityProtocolFailoverProxyProvider in project ozone by apache.
the class HddsServerUtil method getScmSecurityClientWithFixedDuration.
public static SCMSecurityProtocolClientSideTranslatorPB getScmSecurityClientWithFixedDuration(OzoneConfiguration conf) throws IOException {
// As for OM during init, we need to wait for specific duration so that
// we can give response to user performed operation init in a definite
// period, instead of stuck for ever.
OzoneConfiguration configuration = new OzoneConfiguration(conf);
long duration = conf.getTimeDuration(OZONE_SCM_INFO_WAIT_DURATION, OZONE_SCM_INFO_WAIT_DURATION_DEFAULT, TimeUnit.SECONDS);
SCMClientConfig scmClientConfig = conf.getObject(SCMClientConfig.class);
int retryCount = (int) (duration / (scmClientConfig.getRetryInterval() / 1000));
// retry count.
if (retryCount > scmClientConfig.getRetryCount()) {
scmClientConfig.setRetryCount(retryCount);
configuration.setFromObject(scmClientConfig);
}
return new SCMSecurityProtocolClientSideTranslatorPB(new SCMSecurityProtocolFailoverProxyProvider(configuration, UserGroupInformation.getCurrentUser()));
}
use of org.apache.hadoop.hdds.scm.proxy.SCMSecurityProtocolFailoverProxyProvider in project ozone by apache.
the class HddsServerUtil method getScmSecurityClientWithMaxRetry.
public static SCMSecurityProtocolClientSideTranslatorPB getScmSecurityClientWithMaxRetry(OzoneConfiguration conf) throws IOException {
// Certificate from SCM is required for DN startup to succeed, so retry
// for ever. In this way DN start up is resilient to SCM service running
// status.
OzoneConfiguration configuration = new OzoneConfiguration(conf);
SCMClientConfig scmClientConfig = conf.getObject(SCMClientConfig.class);
int retryCount = Integer.MAX_VALUE;
scmClientConfig.setRetryCount(retryCount);
configuration.setFromObject(scmClientConfig);
return new SCMSecurityProtocolClientSideTranslatorPB(new SCMSecurityProtocolFailoverProxyProvider(configuration, UserGroupInformation.getCurrentUser()));
}
Aggregations