hadoop-yarn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject svn commit: r1552920 - in /hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn: hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
Date Sat, 21 Dec 2013 16:29:10 GMT
Author: kasha
Date: Sat Dec 21 16:29:10 2013
New Revision: 1552920

URL: http://svn.apache.org/r1552920
Log:
YARN-1028. Addendum patch. Added FailoverProxyProvider capability to ResourceManager to help
with RM failover.

Modified:
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
    hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java?rev=1552920&r1=1552919&r2=1552920&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
Sat Dec 21 16:29:10 2013
@@ -86,9 +86,7 @@ public class TestRMFailover {
     setRpcAddressForRM(RM1_NODE_ID, RM1_PORT_BASE);
     setRpcAddressForRM(RM2_NODE_ID, RM2_PORT_BASE);
 
-    conf.setInt(YarnConfiguration.CLIENT_FAILOVER_MAX_ATTEMPTS, 100);
     conf.setLong(YarnConfiguration.CLIENT_FAILOVER_SLEEPTIME_BASE_MS, 100L);
-    conf.setLong(YarnConfiguration.CLIENT_FAILOVER_SLEEPTIME_MAX_MS, 1000L);
     conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_FIXED_PORTS, true);
     conf.setBoolean(YarnConfiguration.YARN_MINICLUSTER_USE_RPC, true);
 

Modified: hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java?rev=1552920&r1=1552919&r2=1552920&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
(original)
+++ hadoop/common/trunk/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/RMProxy.java
Sat Dec 21 16:29:10 2013
@@ -225,19 +225,17 @@ public class RMProxy<T> {
       int maxFailoverAttempts = conf.getInt(
           YarnConfiguration.CLIENT_FAILOVER_MAX_ATTEMPTS, -1);
 
-      RetryPolicy basePolicy = RetryPolicies.TRY_ONCE_THEN_FAIL;
       if (maxFailoverAttempts == -1) {
         if (waitForEver) {
-          basePolicy = RetryPolicies.FAILOVER_FOREVER;
+          maxFailoverAttempts = Integer.MAX_VALUE;
         } else {
-          basePolicy = new FailoverUptoMaximumTimePolicy(
-              System.currentTimeMillis() + rmConnectWaitMS);
+          maxFailoverAttempts = (int) (rmConnectWaitMS / failoverSleepBaseMs);
         }
-        maxFailoverAttempts = 0;
       }
 
-      return RetryPolicies.failoverOnNetworkException(basePolicy,
-          maxFailoverAttempts, failoverSleepBaseMs, failoverSleepMaxMs);
+      return RetryPolicies.failoverOnNetworkException(
+          RetryPolicies.TRY_ONCE_THEN_FAIL, maxFailoverAttempts,
+          failoverSleepBaseMs, failoverSleepMaxMs);
     }
 
     if (waitForEver) {



Mime
View raw message