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
This commit is contained in:
Michael Stack 2012-02-17 01:07:01 +00:00
parent b45071a8d0
commit 0a9ab79730
1 changed files with 7 additions and 8 deletions

View File

@ -272,15 +272,13 @@ public class TestHFileOutputFormat {
// verify that the file has the proper FileInfo. // verify that the file has the proper FileInfo.
writer.close(context); writer.close(context);
// the generated file lives 3 directories down and is the only file, // the generated file lives 1 directory down from the attempt directory
// so we traverse the dirs to get to the file // and is the only file, e.g.
// ./_temporary/_attempt__0000_r_000000_0/b/1979617994050536795 // _attempt__0000_r_000000_0/b/1979617994050536795
FileSystem fs = FileSystem.get(conf); FileSystem fs = FileSystem.get(conf);
Path path = HFileOutputFormat.getOutputPath(job); Path attemptDirectory = hof.getDefaultWorkFile(context, "").getParent();
FileStatus[] sub1 = fs.listStatus(path); FileStatus[] sub1 = fs.listStatus(attemptDirectory);
FileStatus[] sub2 = fs.listStatus(sub1[0].getPath()); FileStatus[] file = fs.listStatus(sub1[0].getPath());
FileStatus[] sub3 = fs.listStatus(sub2[0].getPath());
FileStatus[] file = fs.listStatus(sub3[0].getPath());
// open as HFile Reader and pull out TIMERANGE FileInfo. // open as HFile Reader and pull out TIMERANGE FileInfo.
HFile.Reader rd = HFile.createReader(fs, file[0].getPath(), 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 // commit so that the filesystem has one directory per column family
hof.getOutputCommitter(context).commitTask(context); hof.getOutputCommitter(context).commitTask(context);
hof.getOutputCommitter(context).commitJob(context);
for (byte[] family : FAMILIES) { for (byte[] family : FAMILIES) {
String familyStr = new String(family); String familyStr = new String(family);
boolean found = false; boolean found = false;