From 0a9ab797308bd724d773e3be774d1ce759ad5f2a Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Fri, 17 Feb 2012 01:07:01 +0000 Subject: [PATCH] HBASE-5346 Fix testColumnFamilyCompression and test_TIMERANGE in TestHFileOutputFormat git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1245280 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/mapreduce/TestHFileOutputFormat.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java b/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java index 140d54fa147..b606fad484e 100644 --- a/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java +++ b/src/test/java/org/apache/hadoop/hbase/mapreduce/TestHFileOutputFormat.java @@ -272,15 +272,13 @@ public class TestHFileOutputFormat { // verify that the file has the proper FileInfo. writer.close(context); - // the generated file lives 3 directories down and is the only file, - // so we traverse the dirs to get to the file - // ./_temporary/_attempt__0000_r_000000_0/b/1979617994050536795 + // the generated file lives 1 directory down from the attempt directory + // and is the only file, e.g. + // _attempt__0000_r_000000_0/b/1979617994050536795 FileSystem fs = FileSystem.get(conf); - Path path = HFileOutputFormat.getOutputPath(job); - FileStatus[] sub1 = fs.listStatus(path); - FileStatus[] sub2 = fs.listStatus(sub1[0].getPath()); - FileStatus[] sub3 = fs.listStatus(sub2[0].getPath()); - FileStatus[] file = fs.listStatus(sub3[0].getPath()); + Path attemptDirectory = hof.getDefaultWorkFile(context, "").getParent(); + FileStatus[] sub1 = fs.listStatus(attemptDirectory); + FileStatus[] file = fs.listStatus(sub1[0].getPath()); // open as HFile Reader and pull out TIMERANGE FileInfo. HFile.Reader rd = HFile.createReader(fs, file[0].getPath(), @@ -601,6 +599,7 @@ public class TestHFileOutputFormat { // commit so that the filesystem has one directory per column family hof.getOutputCommitter(context).commitTask(context); + hof.getOutputCommitter(context).commitJob(context); for (byte[] family : FAMILIES) { String familyStr = new String(family); boolean found = false;