RetryUtils.getDefaultRetryPolicy( conf, DFSConfigKeys.DFS_HTTP_CLIENT_RETRY_POLICY_ENABLED_KEY,
RetryUtils.getDefaultRetryPolicy( conf, DFSConfigKeys.DFS_HTTP_CLIENT_RETRY_POLICY_ENABLED_KEY,
/** * 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)); }
/** * 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)); }
/** * 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)); }
RetryUtils.getDefaultRetryPolicy( conf, HdfsClientConfigKeys.HttpClient.RETRY_POLICY_ENABLED_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)); }
/** * 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)); } }
/** * 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)); } }
RetryUtils.getDefaultRetryPolicy( conf, HdfsClientConfigKeys.Retry.POLICY_ENABLED_KEY,
RetryUtils.getDefaultRetryPolicy( conf, DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_ENABLED_KEY,
RetryUtils.getDefaultRetryPolicy( conf, DFSConfigKeys.DFS_CLIENT_RETRY_POLICY_ENABLED_KEY,