From 40c3b7f0b2d0e5bfcdc748bddb3de6a8dd3648d4 Mon Sep 17 00:00:00 2001 From: Jason Darrell Lowe Date: Fri, 21 Dec 2012 23:05:54 +0000 Subject: [PATCH] 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/trunk@1425177 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../main/java/org/apache/hadoop/streaming/StreamJob.java | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 4544eb5b58..cf61ae62df 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -635,6 +635,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 diff --git a/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java b/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java index 7076b94547..ec8d72e22a 100644 --- a/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java +++ b/hadoop-tools/hadoop-streaming/src/main/java/org/apache/hadoop/streaming/StreamJob.java @@ -306,7 +306,13 @@ void parseArgv() { 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_); }