tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject svn commit: r1478188 - /incubator/tez/branches/TEZ-1/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfigUtil.java
Date Wed, 01 May 2013 21:04:10 GMT
Author: sseth
Date: Wed May  1 21:04:10 2013
New Revision: 1478188

URL: http://svn.apache.org/r1478188
Log:
Some properties are missed when extracting an intermediate stage conf from a larger MR conf.
(sseth)

Modified:
    incubator/tez/branches/TEZ-1/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfigUtil.java

Modified: incubator/tez/branches/TEZ-1/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfigUtil.java
URL: http://svn.apache.org/viewvc/incubator/tez/branches/TEZ-1/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfigUtil.java?rev=1478188&r1=1478187&r2=1478188&view=diff
==============================================================================
--- incubator/tez/branches/TEZ-1/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfigUtil.java
(original)
+++ incubator/tez/branches/TEZ-1/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/MultiStageMRConfigUtil.java
Wed May  1 21:04:10 2013
@@ -158,23 +158,33 @@ public class MultiStageMRConfigUtil {
   // TODO MRR FIXME based on conf format.
   private static Configuration getBasicIntermediateStageConfInternal(
       Configuration baseConf, String prefix, boolean remove, boolean stageOnly) {
+    Configuration strippedConf = new Configuration(false);
     Configuration conf = new Configuration(false);
     Iterator<Entry<String, String>> confEntries = baseConf.iterator();
     while (confEntries.hasNext()) {
       Entry<String, String> entry = confEntries.next();
       String key = entry.getKey();
       if (key.startsWith(prefix)) {
-        conf.set(key.replace(prefix, ""), entry.getValue());
         if (remove) {
           baseConf.unset(key);
         }
+        String newKey = key.replace(prefix, "");
+        strippedConf.set(newKey, entry.getValue());
       } else if (!stageOnly) {
         conf.set(key, entry.getValue());
       }
     }
+    // Replace values from strippedConf into the finalConf. Override values
+    // which may have been copied over from the baseConf root level.
+    if (stageOnly) {
+      conf = strippedConf;
+    } else {
+      Iterator<Entry<String, String>> entries = strippedConf.iterator();
+      while (entries.hasNext()) {
+        Entry<String, String> entry = entries.next();
+        conf.set(entry.getKey(), entry.getValue());
+      }
+    }
     return conf;
   }
-
-
-  
 }



Mime
View raw message