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 23:15:20 UTC
svn commit: r1357411 - in /hbase/branches/0.92: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/client/HTablePool.java
src/test/java/org/apache/hadoop/hbase/client/TestHTablePool.java
Author: stack
Date: Wed Jul 4 21:15:19 2012
New Revision: 1357411
URL: http://svn.apache.org/viewvc?rev=1357411&view=rev
Log:
HBASE-6322 Unnecessary creation of finalizers in HTablePool
Modified:
hbase/branches/0.92/CHANGES.txt
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/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1357411&r1=1357410&r2=1357411&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Wed Jul 4 21:15:19 2012
@@ -85,7 +85,6 @@ Release 0.92.2 - Unreleased
HBASE-6182 TestStoreFile fails with jdk1.7 (Jimmy Xiang)
HBASE-6200 KeyComparator.compareWithoutRow can be wrong when families have the same prefix (Jieshan)
HBASE-6265 Calling getTimestamp() on a KV in cp.prePut() causes KV not to be flushed
- HBASE-6322 Unnecessary creation of finalizers in HTablePool (Ryan Brush)
HBASE-6281 Assignment need not be called for disabling table regions
during clean cluster start up (Rajesh Babu)
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=1357411&r1=1357410&r2=1357411&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 21:15:19 2012
@@ -320,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) 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=1357411&r1=1357410&r2=1357411&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 21:15:19 2012
@@ -185,6 +185,22 @@ 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 {