HBASE-4167 Potential leak of HTable instances when using HTablePool with

PoolType.ThreadLocal (Karthick Sankarachary)


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1160437 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-08-22 21:09:29 +00:00
parent ecd5fcf0d4
commit d0de098625
2 changed files with 4 additions and 0 deletions

View File

@ -206,6 +206,8 @@ Release 0.91.0 - Unreleased
HBASE-4008 Problem while stopping HBase (Akash Ashok)
HBASE-4065 TableOutputFormat ignores failure to create table instance
(Brock Noland)
HBASE-4167 Potential leak of HTable instances when using HTablePool with
PoolType.ThreadLocal (Karthick Sankarachary)
IMPROVEMENTS
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)

View File

@ -259,6 +259,7 @@ public class HTablePool implements Closeable {
String tableName = Bytes.toString(table.getTableName());
if (tables.size(tableName) >= maxSize) {
// release table instance since we're not reusing it
this.tables.remove(tableName, table);
this.tableFactory.releaseHTableInterface(table);
return;
}
@ -309,6 +310,7 @@ public class HTablePool implements Closeable {
for (String tableName : tables.keySet()) {
closeTablePool(tableName);
}
this.tables.clear();
}
int getCurrentPoolSize(String tableName) {