hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: class cast exception and setting operation timeout on a pooled HTable
Date Wed, 10 Apr 2013 15:02:04 GMT
PooledHTable implements HTableInterface through delegate, table.
I see this method:

     * Expose the wrapped HTable to tests in the same package

     *

     * @return wrapped htable

     */

    HTableInterface getWrappedTable() {

      return table;

    }
If you just want to verify timeout, you can use (I know this is not ideal):

    public String toString() {

      return "PooledHTable{" + ", table=" + table + '}';

    }

On Wed, Apr 10, 2013 at 7:56 AM, Jim the Standing Bear <
standingbear@gmail.com> wrote:

> Hi,
>
> 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");
> System.out.println(((HTable)hti).getOperationTimeout);
>
> I get a class cast exception:
>
> java.lang.ClassCastException:
> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message