You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2011/07/08 07:43:59 UTC
svn commit: r1144162 -
/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
Author: tedyu
Date: Fri Jul 8 05:43:58 2011
New Revision: 1144162
URL: http://svn.apache.org/viewvc?rev=1144162&view=rev
Log:
HBASE-4054 extending HTable because HTableInterface does not include
getRegionInfos and setAutoFlush
Modified:
hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java?rev=1144162&r1=1144161&r2=1144162&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java Fri Jul 8 05:43:58 2011
@@ -175,8 +175,11 @@ public class HTablePool implements Close
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 Close
* 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;
}