You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2012/07/04 17:01:37 UTC
svn commit: r1357285 - in /hbase/branches/0.92/src:
main/java/org/apache/hadoop/hbase/client/HTablePool.java
test/java/org/apache/hadoop/hbase/client/TestHTablePool.java
Author: stack
Date: Wed Jul 4 15:01:37 2012
New Revision: 1357285
URL: http://svn.apache.org/viewvc?rev=1357285&view=rev
Log:
HBASE-6322 Unnecessary creation of finalizers in HTablePool
Modified:
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestHTablePool.java
Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java?rev=1357285&r1=1357284&r2=1357285&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java Wed Jul 4 15:01:37 2012
@@ -320,12 +320,11 @@ public class HTablePool implements Close
* wrapped table back to the table pool
*
*/
- class PooledHTable extends HTable {
+ class PooledHTable implements HTableInterface {
private HTableInterface table; // actual table implementation
public PooledHTable(HTableInterface table) throws IOException {
- super(table.getConfiguration(), table.getTableName());
this.table = table;
}
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestHTablePool.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestHTablePool.java?rev=1357285&r1=1357284&r2=1357285&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestHTablePool.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestHTablePool.java Wed Jul 4 15:01:37 2012
@@ -185,22 +185,6 @@ public class TestHTablePool {
Assert.assertTrue("alien table rejected", true);
}
}
-
- @Test
- public void testClassCastException() {
- //this test makes sure that client code that
- //casts the table it got from pool to HTable won't break
- HTablePool pool = new HTablePool(TEST_UTIL.getConfiguration(),
- Integer.MAX_VALUE);
- String tableName = Bytes.toString(TABLENAME);
- try {
- // get table and check if type is HTable
- HTable table = (HTable) pool.getTable(tableName);
- Assert.assertTrue("return type is HTable as expected", true);
- } catch (ClassCastException e) {
- Assert.fail("return type is not HTable");
- }
- }
}
public static class TestHTableReusablePool extends TestHTablePoolType {