Browse Source

svn merge -c 1425177 FIXES: MAPREDUCE-4793. Problem with adding resources when using both -files and -file to hadoop streaming. Contributed by Jason Lowe

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1425182 13f79535-47bb-0310-9956-ffa450edef68
Jason Darrell Lowe 12 năm trước cách đây
mục cha
commit
5b67de316d

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -43,6 +43,9 @@ Release 0.23.6 - UNRELEASED
     MAPREDUCE-4833. Task can get stuck in FAIL_CONTAINER_CLEANUP (Robert
     Parker via jlowe)
 
+    MAPREDUCE-4793. Problem with adding resources when using both -files and
+    -file to hadoop streaming (jlowe)
+
 Release 0.23.5 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 7 - 1
hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java

@@ -306,7 +306,13 @@ public class StreamJob implements Tool {
             throw new IllegalArgumentException(e);
           }
         }
-        config_.set("tmpfiles", config_.get("tmpfiles", "") + fileList);
+        String tmpFiles = config_.get("tmpfiles", "");
+        if (tmpFiles.isEmpty()) {
+          tmpFiles = fileList.toString();
+        } else {
+          tmpFiles = tmpFiles + "," + fileList;
+        }
+        config_.set("tmpfiles", tmpFiles);
         validate(packageFiles_);
       }