hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iva...@apache.org
Subject git commit: MAPREDUCE-5911. Terasort TeraOutputFormat does not check for output directory existance. Contributed by Bruno P. Kinoshita. (cherry picked from commit 7bbda6ef92e9bf4a28e67b8736067b38defab51e)
Date Sun, 19 Oct 2014 23:12:08 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 9915d5218 -> 767a3fd0b


MAPREDUCE-5911. Terasort TeraOutputFormat does not check for output directory existance. Contributed
by Bruno P. Kinoshita.
(cherry picked from commit 7bbda6ef92e9bf4a28e67b8736067b38defab51e)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/767a3fd0
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/767a3fd0
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/767a3fd0

Branch: refs/heads/branch-2
Commit: 767a3fd0b718a1d0b38c030438f0be4f426ba5b5
Parents: 9915d52
Author: Ivan Mitic <ivanmi@apache.org>
Authored: Sun Oct 19 18:57:48 2014 -0400
Committer: Ivan Mitic <ivanmi@apache.org>
Committed: Sun Oct 19 19:10:31 2014 -0400

----------------------------------------------------------------------
 hadoop-mapreduce-project/CHANGES.txt                           | 3 +++
 .../org/apache/hadoop/examples/terasort/TeraOutputFormat.java  | 6 ++++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/767a3fd0/hadoop-mapreduce-project/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt
index ba8c673..05280f9 100644
--- a/hadoop-mapreduce-project/CHANGES.txt
+++ b/hadoop-mapreduce-project/CHANGES.txt
@@ -219,6 +219,9 @@ Release 2.6.0 - UNRELEASED
     MAPREDUCE-5542. Killing a job just as it finishes can generate an NPE in
     client (Rohith via jlowe)
 
+    MAPREDUCE-5911. Terasort TeraOutputFormat does not check for output
+    directory existance (Bruno P. Kinoshita via ivanmi)
+
 Release 2.5.1 - 2014-09-05
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/767a3fd0/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/TeraOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/TeraOutputFormat.java
b/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/TeraOutputFormat.java
index a4a67fb..ab43d25 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/TeraOutputFormat.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/TeraOutputFormat.java
@@ -24,6 +24,7 @@ import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapred.FileAlreadyExistsException;
 import org.apache.hadoop.mapred.InvalidJobConfException;
 import org.apache.hadoop.mapreduce.JobContext;
 import org.apache.hadoop.mapreduce.OutputCommitter;
@@ -90,6 +91,11 @@ public class TeraOutputFormat extends FileOutputFormat<Text,Text>
{
     // get delegation token for outDir's file system
     TokenCache.obtainTokensForNamenodes(job.getCredentials(),
         new Path[] { outDir }, job.getConfiguration());
+
+    if (outDir.getFileSystem(job.getConfiguration()).exists(outDir)) {
+      throw new FileAlreadyExistsException("Output directory " + outDir + 
+                                           " already exists");
+    }
   }
 
   public RecordWriter<Text,Text> getRecordWriter(TaskAttemptContext job


Mime
View raw message