hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim the Standing Bear <standingb...@gmail.com>
Subject class cast exception and setting operation timeout on a pooled HTable
Date Wed, 10 Apr 2013 14:56:27 GMT

When I use HTablePool to perform some HBase data loading operations, I
encountered a problem where the Put operation seemed to hang forever.
A little bit of digging shows that the default client operation
timeout is something like 2 billion ms.

HTable provides a getter and setter methods on operation time out, but
that method is not exposed in HTableInterface.  In addition, the
HTablePool.getTable actually returns a PooledHTable object although
down-casted as HTableInterface, and PooledHTable extends HTable, so it
seems every piece is there for me to check or to set the operation
timeout, and all I need is just some class casting.

But when I do

HTableInterface hti = hTablePool.getTable("table1");

I get a class cast exception:

org.apache.hadoop.hbase.client.HTablePool$PooledHTable cannot be cast
to org.apache.hadoop.hbase.client.HTable

What am I missing?  Also how can I check or set the operation timeout?
 I know another way is to use the configuration parameter,
hbase.client.operation.timeout, but it doesn't allow me to check an
actual HTable instance to make sure the correct timeout is set.
Please help.

I am using hbase 0.94.4 with security enabled.  Thanks.

-- Jim

View raw message