hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r1135852 - /hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
Date Tue, 14 Jun 2011 23:39:37 GMT
Author: ddas
Date: Tue Jun 14 23:39:37 2011
New Revision: 1135852

URL: http://svn.apache.org/viewvc?rev=1135852&view=rev
Log:
Follow up on the previous commit to do with rack-awareness. Contributed by Devaraj Das.

Modified:
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java?rev=1135852&r1=1135851&r2=1135852&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
Tue Jun 14 23:39:37 2011
@@ -51,6 +51,7 @@ import org.apache.hadoop.yarn.api.record
 import org.apache.hadoop.yarn.api.records.ContainerState;
 import org.apache.hadoop.yarn.api.records.Priority;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
+import org.apache.hadoop.yarn.util.RackResolver;
 
 /**
  * Allocates the container from the ResourceManager scheduler.
@@ -136,6 +137,7 @@ public class RMContainerAllocator extend
     maxReducePreemptionLimit = conf.getFloat(
         AMConstants.REDUCE_PREEMPTION_LIMIT,
         AMConstants.DEFAULT_REDUCE_PREEMPTION_LIMIT);
+    RackResolver.init(conf);
   }
 
   @Override
@@ -616,8 +618,7 @@ public class RMContainerAllocator extend
           }
         }
         if (assigned == null) {
-          // TODO: get rack
-          String rack = "";
+          String rack = RackResolver.resolve(host).getNetworkLocation();
           list = mapsRackMapping.get(rack);
           while (list != null && list.size() > 0) {
             TaskAttemptId tId = list.removeFirst();



Mime
View raw message