MAPREDUCE-7108. TestFileOutputCommitter fails on Windows. (Zuoming Zhang via gera)
This commit is contained in:
parent
a16623df21
commit
04b74eddc6
@ -40,6 +40,7 @@
|
|||||||
import org.apache.hadoop.fs.FileUtil;
|
import org.apache.hadoop.fs.FileUtil;
|
||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.fs.RawLocalFileSystem;
|
import org.apache.hadoop.fs.RawLocalFileSystem;
|
||||||
|
import org.apache.hadoop.io.IOUtils;
|
||||||
import org.apache.hadoop.io.LongWritable;
|
import org.apache.hadoop.io.LongWritable;
|
||||||
import org.apache.hadoop.io.MapFile;
|
import org.apache.hadoop.io.MapFile;
|
||||||
import org.apache.hadoop.io.NullWritable;
|
import org.apache.hadoop.io.NullWritable;
|
||||||
@ -526,16 +527,15 @@ private void testMapFileOutputCommitterInternal(int version)
|
|||||||
|
|
||||||
// Ensure getReaders call works and also ignores
|
// Ensure getReaders call works and also ignores
|
||||||
// hidden filenames (_ or . prefixes)
|
// hidden filenames (_ or . prefixes)
|
||||||
|
MapFile.Reader[] readers = {};
|
||||||
try {
|
try {
|
||||||
MapFileOutputFormat.getReaders(outDir, conf);
|
readers = MapFileOutputFormat.getReaders(outDir, conf);
|
||||||
} catch (Exception e) {
|
// validate output
|
||||||
fail("Fail to read from MapFileOutputFormat: " + e);
|
validateMapFileOutputContent(FileSystem.get(job.getConfiguration()), outDir);
|
||||||
e.printStackTrace();
|
} 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
|
@Test
|
||||||
|
Loading…
Reference in New Issue
Block a user