diff --git a/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java b/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java index 315e0cf7d53..02718832b7f 100644 --- a/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java +++ b/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java @@ -382,6 +382,7 @@ public class RegionSplitter { Thread.sleep(10 * 1000); // sleep } } + table.close(); } LOG.debug("Finished creating table with " + splitCount + " regions"); @@ -566,7 +567,7 @@ public class RegionSplitter { } } } - LOG.debug("All regions have been sucesfully split!"); + LOG.debug("All regions have been successfully split!"); } finally { long tDiff = System.currentTimeMillis() - startTime; LOG.debug("TOTAL TIME = " @@ -576,6 +577,9 @@ public class RegionSplitter { + org.apache.hadoop.util.StringUtils.formatTime(tDiff / splitCount)); splitOut.close(); + if (table != null){ + table.close(); + } } fs.delete(splitFile, false); } diff --git a/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java b/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java index d5ed886af5f..c056b38e1b8 100644 --- a/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java +++ b/src/test/java/org/apache/hadoop/hbase/client/TestHCM.java @@ -140,6 +140,7 @@ public class TestHCM { conn.deleteCachedLocation(TABLE_NAME, ROW); HRegionLocation rl = conn.getCachedLocation(TABLE_NAME, ROW); assertNull("What is this location?? " + rl, rl); + conn.close(); table.close(); } diff --git a/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java b/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java index 06c751a6df5..9212b074565 100644 --- a/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java +++ b/src/test/java/org/apache/hadoop/hbase/filter/TestColumnRangeFilter.java @@ -226,6 +226,7 @@ public class TestColumnRangeFilter { } } long scanTime = System.currentTimeMillis() - timeBeforeScan; + scanner.close(); LOG.info("scan time = " + scanTime + "ms"); LOG.info("found " + results.size() + " results"); LOG.info("Expecting " + rangeMap.get(s).size() + " results"); diff --git a/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java b/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java index 2e7185ff70b..e3061d01f01 100644 --- a/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java +++ b/src/test/java/org/apache/hadoop/hbase/io/TestHalfStoreFileReader.java @@ -116,6 +116,8 @@ public class TestHalfStoreFileReader { int ret = scanner.reseekTo(getLastOnCol(curr).getKey()); //System.out.println("Last reseek: " + ret); assertTrue( ret > 0 ); + + halfreader.close(true); } private KeyValue getLastOnCol(KeyValue curr) { diff --git a/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java b/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java index 9bb507f3d4f..0ffb8113b7a 100644 --- a/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java +++ b/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFileBlockCacheSummary.java @@ -124,6 +124,8 @@ public class TestStoreFileBlockCacheSummary { assertEquals("table", TEST_TABLE2, e.getTable()); assertEquals("cf", TEST_CF, e.getColumnFamily()); + ht.close(); + ht2.close(); } private void addRows(HTable ht, byte[] family) throws IOException { diff --git a/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java b/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java index dfc4cd9d01e..937781d56ca 100644 --- a/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java +++ b/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java @@ -126,7 +126,13 @@ public class TestHBaseFsck { assertNoErrors(doFsck(conf, false)); // comment needed - what is the purpose of this line - new HTable(conf, Bytes.toBytes(table)).getScanner(new Scan()); + HTable t = new HTable(conf, Bytes.toBytes(table)); + ResultScanner s = t.getScanner(new Scan()); + s.close(); + t.close(); + + scanner.close(); + meta.close(); } private HRegionInfo createRegion(Configuration conf, final HTableDescriptor