|
@@ -224,19 +224,20 @@ public class RMProxy<T> {
|
|
failoverSleepBaseMs, failoverSleepMaxMs);
|
|
failoverSleepBaseMs, failoverSleepMaxMs);
|
|
}
|
|
}
|
|
|
|
|
|
- if (waitForEver) {
|
|
|
|
- return RetryPolicies.RETRY_FOREVER;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (rmConnectionRetryIntervalMS < 0) {
|
|
if (rmConnectionRetryIntervalMS < 0) {
|
|
throw new YarnRuntimeException("Invalid Configuration. " +
|
|
throw new YarnRuntimeException("Invalid Configuration. " +
|
|
YarnConfiguration.RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS +
|
|
YarnConfiguration.RESOURCEMANAGER_CONNECT_RETRY_INTERVAL_MS +
|
|
" should not be negative.");
|
|
" should not be negative.");
|
|
}
|
|
}
|
|
|
|
|
|
- RetryPolicy retryPolicy =
|
|
|
|
- RetryPolicies.retryUpToMaximumTimeWithFixedSleep(rmConnectWaitMS,
|
|
|
|
- rmConnectionRetryIntervalMS, TimeUnit.MILLISECONDS);
|
|
|
|
|
|
+ RetryPolicy retryPolicy = null;
|
|
|
|
+ if (waitForEver) {
|
|
|
|
+ retryPolicy = RetryPolicies.RETRY_FOREVER;
|
|
|
|
+ } else {
|
|
|
|
+ retryPolicy =
|
|
|
|
+ RetryPolicies.retryUpToMaximumTimeWithFixedSleep(rmConnectWaitMS,
|
|
|
|
+ rmConnectionRetryIntervalMS, TimeUnit.MILLISECONDS);
|
|
|
|
+ }
|
|
|
|
|
|
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
|
|
Map<Class<? extends Exception>, RetryPolicy> exceptionToPolicyMap =
|
|
new HashMap<Class<? extends Exception>, RetryPolicy>();
|
|
new HashMap<Class<? extends Exception>, RetryPolicy>();
|