You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by vi...@apache.org on 2013/12/17 23:32:39 UTC
svn commit: r1551739 -
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java
Author: vinodkv
Date: Tue Dec 17 22:32:38 2013
New Revision: 1551739
URL: http://svn.apache.org/r1551739
Log:
YARN-1028. Added FailoverProxyProvider capability to ResourceManager to help with RM failover. Contributed by Karthik Kambatla.
Modified:
hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java
Modified: hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java?rev=1551739&r1=1551738&r2=1551739&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java (original)
+++ hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java Tue Dec 17 22:32:38 2013
@@ -68,7 +68,14 @@ public class RetryPolicies {
* </p>
*/
public static final RetryPolicy RETRY_FOREVER = new RetryForever();
-
+
+ /**
+ * <p>
+ * Keep failing over forever
+ * </p>
+ */
+ public static final RetryPolicy FAILOVER_FOREVER = new FailoverForever();
+
/**
* <p>
* Keep trying a limited number of times, waiting a fixed time between attempts,
@@ -166,6 +173,14 @@ public class RetryPolicies {
return RetryAction.RETRY;
}
}
+
+ static class FailoverForever implements RetryPolicy {
+ @Override
+ public RetryAction shouldRetry(Exception e, int retries, int failovers,
+ boolean isIdempotentOrAtMostOnce) throws Exception {
+ return RetryAction.FAILOVER_AND_RETRY;
+ }
+ }
/**
* Retry up to maxRetries.