hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [11/50] [abbrv] hadoop git commit: MAPREDUCE-7108. TestFileOutputCommitter fails on Windows. (Zuoming Zhang via gera)
Date Thu, 14 Jun 2018 16:50:07 GMT
MAPREDUCE-7108. TestFileOutputCommitter fails on Windows. (Zuoming Zhang via gera)


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

Branch: refs/heads/HDDS-48
Commit: 04b74eddc67888142879ed114d21348e8a4aad78
Parents: a16623d
Author: Gera Shegalov <gera@apache.org>
Authored: Tue Jun 12 11:21:51 2018 -0700
Committer: Gera Shegalov <gera@apache.org>
Committed: Tue Jun 12 11:21:51 2018 -0700

----------------------------------------------------------------------
 .../lib/output/TestFileOutputCommitter.java         | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/04b74edd/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
index cd9d44b..fc43dce 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/output/TestFileOutputCommitter.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.RawLocalFileSystem;
+import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.io.LongWritable;
 import org.apache.hadoop.io.MapFile;
 import org.apache.hadoop.io.NullWritable;
@@ -526,16 +527,15 @@ public class TestFileOutputCommitter {
 
     // Ensure getReaders call works and also ignores
     // hidden filenames (_ or . prefixes)
+    MapFile.Reader[] readers = {};
     try {
-      MapFileOutputFormat.getReaders(outDir, conf);
-    } catch (Exception e) {
-      fail("Fail to read from MapFileOutputFormat: " + e);
-      e.printStackTrace();
+      readers = MapFileOutputFormat.getReaders(outDir, conf);
+      // validate output
+      validateMapFileOutputContent(FileSystem.get(job.getConfiguration()), outDir);
+    } finally {
+      IOUtils.cleanupWithLogger(null, readers);
+      FileUtil.fullyDelete(new File(outDir.toString()));
     }
-
-    // validate output
-    validateMapFileOutputContent(FileSystem.get(job.getConfiguration()), outDir);
-    FileUtil.fullyDelete(new File(outDir.toString()));
   }
 
   @Test


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message