From 2ba90c93d71aa2d30ee9ed431750c10c685e5599 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Fri, 21 Aug 2015 10:41:54 +0900 Subject: [PATCH] MAPREDUCE-6357. MultipleOutputs.write() API should document that output committing is not utilized when input path is absolute. Contributed by Dustin Cote. --- hadoop-mapreduce-project/CHANGES.txt | 4 ++++ .../mapreduce/lib/output/MultipleOutputs.java | 14 +++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 43d0fafb77..361a19b695 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -555,6 +555,10 @@ Release 2.8.0 - UNRELEASED MAPREDUCE-5817. Mappers get rescheduled on node transition even after all reducers are completed. (Sangjin Lee via kasha) + MAPREDUCE-6357. MultipleOutputs.write() API should document that output + committing is not utilized when input path is absolute. + (Dustin Cote via aajisaka) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/MultipleOutputs.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/MultipleOutputs.java index c31cab7ddd..a3a0e76ab8 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/MultipleOutputs.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/MultipleOutputs.java @@ -120,7 +120,11 @@ * *

* Use MultipleOutputs.write(KEYOUT key, VALUEOUT value, String baseOutputPath) to write key and - * value to a path specified by baseOutputPath, with no need to specify a named output: + * value to a path specified by baseOutputPath, with no need to specify a named output. + * Warning: when the baseOutputPath passed to MultipleOutputs.write + * is a path that resolves outside of the final job output directory, the + * directory is created immediately and then persists through subsequent + * task retries, breaking the concept of output committing: *

* *
@@ -418,6 +422,10 @@ public  void write(String namedOutput, K key, V value)
    * @param value          the value
    * @param baseOutputPath base-output path to write the record to.
    * Note: Framework will generate unique filename for the baseOutputPath
+   * Warning: when the baseOutputPath is a path that resolves
+   * outside of the final job output directory, the directory is created
+   * immediately and then persists through subsequent task retries, breaking
+   * the concept of output committing.
    */
   @SuppressWarnings("unchecked")
   public  void write(String namedOutput, K key, V value,
@@ -442,6 +450,10 @@ public  void write(String namedOutput, K key, V value,
    * @param value     the value
    * @param baseOutputPath base-output path to write the record to.
    * Note: Framework will generate unique filename for the baseOutputPath
+   * Warning: when the baseOutputPath is a path that resolves
+   * outside of the final job output directory, the directory is created
+   * immediately and then persists through subsequent task retries, breaking
+   * the concept of output committing.
    */
   @SuppressWarnings("unchecked")
   public void write(KEYOUT key, VALUEOUT value, String baseOutputPath)