HBASE-4054 extending HTable because HTableInterface does not include

getRegionInfos and setAutoFlush


git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1144162 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-07-08 05:43:58 +00:00
parent 24c84bd22c
commit c08fe0f40e
1 changed files with 8 additions and 4 deletions

View File

@ -175,8 +175,11 @@ public class HTablePool implements Closeable {
HTableInterface table = findOrCreateTable(tableName);
// return a proxy table so when user closes the proxy, the actual table
// will be returned to the pool
return new PooledHTable(table);
try {
return new PooledHTable(table);
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}
}
/**
@ -317,11 +320,12 @@ public class HTablePool implements Closeable {
* wrapped table back to the table pool
*
*/
class PooledHTable implements HTableInterface {
class PooledHTable extends HTable {
private HTableInterface table; // actual table implementation
public PooledHTable(HTableInterface table) {
public PooledHTable(HTableInterface table) throws IOException {
super(table.getConfiguration(), table.getTableName());
this.table = table;
}