getMultipleLinearRandomRetry( conf, retryPolicyEnabledKey, defaultRetryPolicyEnabled,
RetryUtils.getDefaultRetryPolicy( conf, DFSConfigKeys.DFS_HTTP_CLIENT_RETRY_POLICY_ENABLED_KEY,
RetryUtils.getDefaultRetryPolicy( conf, DFSConfigKeys.DFS_HTTP_CLIENT_RETRY_POLICY_ENABLED_KEY,
getMultipleLinearRandomRetry( conf, retryPolicyEnabledKey, defaultRetryPolicyEnabled,
/** * Verify that the default retry policy correctly retries * a RetriableException wrapped in a RemoteException when * defaultRetryPolicyEnabled is enabled. * * @throws IOException */ @Test public void testWithWrappedRetriable() throws Exception { Configuration conf = new Configuration(); RetryPolicy policy = RetryUtils.getDefaultRetryPolicy( conf, "Test.No.Such.Key", true, // defaultRetryPolicyEnabled = true "Test.No.Such.Key", "10000,6", null); RetryPolicy.RetryAction action = policy.shouldRetry( new RemoteException(RetriableException.class.getName(), "Dummy exception"), 0, 0, true); assertThat(action.action, is(RetryPolicy.RetryAction.RetryDecision.RETRY)); }
getMultipleLinearRandomRetry( conf, retryPolicyEnabledKey, defaultRetryPolicyEnabled,
/** * Verify that the default retry policy correctly retries * a RetriableException wrapped in a RemoteException when * defaultRetryPolicyEnabled is enabled. * * @throws IOException */ @Test public void testWithWrappedRetriable() throws Exception { Configuration conf = new Configuration(); RetryPolicy policy = RetryUtils.getDefaultRetryPolicy( conf, "Test.No.Such.Key", true, // defaultRetryPolicyEnabled = true "Test.No.Such.Key", "10000,6", null); RetryPolicy.RetryAction action = policy.shouldRetry( new RemoteException(RetriableException.class.getName(), "Dummy exception"), 0, 0, true); assertThat(action.action, is(RetryPolicy.RetryAction.RetryDecision.RETRY)); }
getMultipleLinearRandomRetry( conf, retryPolicyEnabledKey, defaultRetryPolicyEnabled,
RetryUtils.getDefaultRetryPolicy( conf, HdfsClientConfigKeys.HttpClient.RETRY_POLICY_ENABLED_KEY,
public RemoteWasbDelegationTokenManager(Configuration conf) throws IOException { RetryPolicy retryPolicy = RetryUtils.getMultipleLinearRandomRetry(conf, DT_MANAGER_HTTP_CLIENT_RETRY_POLICY_ENABLED_KEY, DT_MANAGER_HTTP_CLIENT_RETRY_POLICY_ENABLED_DEFAULT, DT_MANAGER_HTTP_CLIENT_RETRY_POLICY_SPEC_KEY, DT_MANAGER_HTTP_CLIENT_RETRY_POLICY_SPEC_DEFAULT); this.isSpnegoTokenCacheEnabled = conf.getBoolean(Constants.AZURE_ENABLE_SPNEGO_TOKEN_CACHE, true); remoteCallHelper = new SecureWasbRemoteCallHelper(retryPolicy, true, isSpnegoTokenCacheEnabled); this.dtServiceUrls = conf.getTrimmedStrings(KEY_DELEGATION_TOKEN_SERVICE_URLS); if (this.dtServiceUrls == null || this.dtServiceUrls.length <= 0) { throw new IOException( KEY_DELEGATION_TOKEN_SERVICE_URLS + " config not set" + " in configuration."); } }
/** * Verify that the default retry policy does *not* retry * RetriableException when defaultRetryPolicyEnabled is disabled. * * @throws IOException */ @Test public void testWithRetriableAndRetryDisabled() throws Exception { Configuration conf = new Configuration(); RetryPolicy policy = RetryUtils.getDefaultRetryPolicy( conf, "Test.No.Such.Key", false, // defaultRetryPolicyEnabled = false "Test.No.Such.Key", "10000,6", null); RetryPolicy.RetryAction action = policy.shouldRetry( new RetriableException("Dummy exception"), 0, 0, true); assertThat(action.action, is(RetryPolicy.RetryAction.RetryDecision.FAIL)); } }
@Override public void init(Configuration conf) throws IOException { LOG.debug("Initializing RemoteWasbAuthorizerImpl instance"); this.isKerberosSupportEnabled = conf.getBoolean(Constants.AZURE_KERBEROS_SUPPORT_PROPERTY_NAME, false); this.isSpnegoTokenCacheEnabled = conf.getBoolean(Constants.AZURE_ENABLE_SPNEGO_TOKEN_CACHE, true); this.commaSeparatedUrls = conf.getTrimmedStrings(KEY_REMOTE_AUTH_SERVICE_URLS); if (this.commaSeparatedUrls == null || this.commaSeparatedUrls.length <= 0) { throw new IOException(KEY_REMOTE_AUTH_SERVICE_URLS + " config not set" + " in configuration."); } this.retryPolicy = RetryUtils.getMultipleLinearRandomRetry(conf, AUTHORIZER_HTTP_CLIENT_RETRY_POLICY_ENABLED_KEY, true, AUTHORIZER_HTTP_CLIENT_RETRY_POLICY_SPEC_SPEC, AUTHORIZER_HTTP_CLIENT_RETRY_POLICY_SPEC_DEFAULT); if (isKerberosSupportEnabled && UserGroupInformation.isSecurityEnabled()) { this.remoteCallHelper = new SecureWasbRemoteCallHelper(retryPolicy, false, isSpnegoTokenCacheEnabled); } else { this.remoteCallHelper = new WasbRemoteCallHelper(retryPolicy); } this.cache = new CachingAuthorizer<>( conf.getTimeDuration(AUTHORIZATION_CACHEENTRY_EXPIRY_PERIOD, 5L, TimeUnit.MINUTES), "AUTHORIZATION" ); this.cache.init(conf); }
/** * Verify that the default retry policy does *not* retry * RetriableException when defaultRetryPolicyEnabled is disabled. * * @throws IOException */ @Test public void testWithRetriableAndRetryDisabled() throws Exception { Configuration conf = new Configuration(); RetryPolicy policy = RetryUtils.getDefaultRetryPolicy( conf, "Test.No.Such.Key", false, // defaultRetryPolicyEnabled = false "Test.No.Such.Key", "10000,6", null); RetryPolicy.RetryAction action = policy.shouldRetry( new RetriableException("Dummy exception"), 0, 0, true); assertThat(action.action, is(RetryPolicy.RetryAction.RetryDecision.FAIL)); } }
getMultipleLinearRandomRetry( conf, retryPolicyEnabledKey, defaultRetryPolicyEnabled,
/** * Verify that the default retry policy correctly retries * RetriableException when defaultRetryPolicyEnabled is enabled. * * @throws IOException */ @Test public void testWithRetriable() throws Exception { Configuration conf = new Configuration(); RetryPolicy policy = RetryUtils.getDefaultRetryPolicy( conf, "Test.No.Such.Key", true, // defaultRetryPolicyEnabled = true "Test.No.Such.Key", "10000,6", null); RetryPolicy.RetryAction action = policy.shouldRetry( new RetriableException("Dummy exception"), 0, 0, true); assertThat(action.action, is(RetryPolicy.RetryAction.RetryDecision.RETRY)); }
this.retryPolicy = RetryUtils.getMultipleLinearRandomRetry(conf, SAS_KEY_GENERATOR_HTTP_CLIENT_RETRY_POLICY_ENABLED_KEY, true, SAS_KEY_GENERATOR_HTTP_CLIENT_RETRY_POLICY_SPEC_KEY,
/** * Verify that the default retry policy correctly retries * RetriableException when defaultRetryPolicyEnabled is enabled. * * @throws IOException */ @Test public void testWithRetriable() throws Exception { Configuration conf = new Configuration(); RetryPolicy policy = RetryUtils.getDefaultRetryPolicy( conf, "Test.No.Such.Key", true, // defaultRetryPolicyEnabled = true "Test.No.Such.Key", "10000,6", null); RetryPolicy.RetryAction action = policy.shouldRetry( new RetriableException("Dummy exception"), 0, 0, true); assertThat(action.action, is(RetryPolicy.RetryAction.RetryDecision.RETRY)); }
private void performop(HttpClient mockHttpClient) throws Throwable { Path testPath = new Path("/", "test.dat"); RemoteWasbAuthorizerImpl authorizer = new RemoteWasbAuthorizerImpl(); authorizer.init(fs.getConf()); WasbRemoteCallHelper mockWasbRemoteCallHelper = new WasbRemoteCallHelper( RetryUtils.getMultipleLinearRandomRetry(new Configuration(), EMPTY_STRING, true, EMPTY_STRING, "1000,3,10000,2")); mockWasbRemoteCallHelper.updateHttpClient(mockHttpClient); authorizer.updateWasbRemoteCallHelper(mockWasbRemoteCallHelper); fs.updateWasbAuthorizer(authorizer); fs.create(testPath); ContractTestUtils.assertPathExists(fs, "testPath was not created", testPath); fs.delete(testPath, false); }
RetryUtils.getDefaultRetryPolicy( conf, HdfsClientConfigKeys.Retry.POLICY_ENABLED_KEY,
RetryUtils.getDefaultRetryPolicy( conf, DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_ENABLED_KEY,