HBASE-5030 Some tests do not close the HFile.Reader they use, leaving some file descriptors open (N Keywal)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1214519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-12-14 22:52:45 +00:00
parent e85d2d45d3
commit 6b60585fef
7 changed files with 14 additions and 0 deletions

View File

@ -90,6 +90,8 @@ public class TestHalfStoreFileReader {
Reference top = new Reference(midkey, Reference.Range.top);
doTestOfScanAndReseek(p, fs, top, cacheConf);
r.close();
}
private void doTestOfScanAndReseek(Path p, FileSystem fs, Reference bottom,

View File

@ -572,6 +572,7 @@ public class TestHFileBlockIndex {
reader.getTrailer().getUncompressedDataIndexSize());
reader.close();
reader2.close();
}
}

View File

@ -261,6 +261,7 @@ public class TestHFilePerformance extends TestCase {
}
break;
}
reader.close();
} else if("SequenceFile".equals(fileType)){
SequenceFile.Reader reader;

View File

@ -87,6 +87,8 @@ public class TestReseekTo {
scanner.reseekTo(Bytes.toBytes(key));
assertEquals(value, scanner.getValueString());
}
reader.close();
}

View File

@ -93,6 +93,8 @@ public class TestSeekTo extends HBaseTestCase {
assertEquals("i", toRowStr(scanner.getKeyValue()));
assertEquals(true, scanner.seekBefore(toKV("l").getKey()));
assertEquals("k", toRowStr(scanner.getKeyValue()));
reader.close();
}
public void testSeekTo() throws Exception {
@ -113,6 +115,8 @@ public class TestSeekTo extends HBaseTestCase {
assertEquals(1, scanner.seekTo(toKV("l").getKey()));
assertEquals("k", toRowStr(scanner.getKeyValue()));
reader.close();
}
public void testBlockContainingKey() throws Exception {
@ -144,6 +148,8 @@ public class TestSeekTo extends HBaseTestCase {
toKV("k").getKey(), 0, klen));
assertEquals(1, blockIndexReader.rootBlockContainingKey(
toKV("l").getKey(), 0, klen));
reader.close();
}
@org.junit.Rule

View File

@ -296,6 +296,7 @@ public class TestHFileOutputFormat {
"...." + timeRangeTracker.getMaximumTimestamp());
assertEquals(1000, timeRangeTracker.getMinimumTimestamp());
assertEquals(2000, timeRangeTracker.getMaximumTimestamp());
rd.close();
} finally {
if (writer != null && context != null) writer.close(context);
dir.getFileSystem(conf).delete(dir, true);

View File

@ -191,6 +191,7 @@ public class TestLoadIncrementalHFiles {
count++;
} while (scanner.next());
assertTrue(count > 0);
reader.close();
return count;
}