When u new Get(row) first,HBase client cache the connection to the
appropriate region server,after u restart HBase(I think u run
standalone?),when u do Get(row) again,HBase client still use the
cached connection to do this,so throw the Exception.

But it seems should not throws the exception a lot of times,can u post
the exception stack?

2011/3/10 King JKing <[email protected]>:
> Dear all,
>
> When I stop and start HBase server, HTable (org.apache.hadoop.hbase.client)
> throw exception.
> Here is my code test:
>            HTable ht = new HTable(config, "T1");
>            byte[] row = Bytes.toBytes(1);
>
>            Get get = new Get(row);
>            Result result = ht.get(get);
>
> System.out.println(Bytes.toString(result.getValue("F1".getBytes(),
> "C1".getBytes())));
>
>            try {
>                Thread.sleep(60000);
>            } catch (InterruptedException ex) {
>                ex.printStackTrace();
>            }
>
>            get = new Get(row);
>            result = ht.get(get);
>
> System.out.println(Bytes.toString(result.getValue("F1".getBytes(),
> "C1".getBytes())));
>
> First I start HBase and run my code. After that I stop and start HBase. And
> exception "Exception closing session to sun.nio.ch.SelectionKeyImpl" throws
> a lot of times.
>
> Could you help me to fix this problem?
> Thank a lot for support.
>



-- 
=============================
|     BlueDavy                                      |
|     http://www.bluedavy.com                |
=============================

Reply via email to