Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
HBase, mail # user - Thrift2 Asynch Row Mutations


Copy link to this message
-
Thrift2 Asynch Row Mutations
Pankaj Misra 2012-10-30, 12:48
Dear All,

I am trying to build an asynch client (nonblocking mode) using thrift2 implementation of Hbase. My Hbase version in 0.94.1. I am calling HbaseAsynchClient's mutateRow method with a callback implementation. I have also started the thrift2 server in nonblocking mode listening on default HOST and PORT.

        TBinaryProtocol.Factory binProtoFactory=new TBinaryProtocol.Factory();
        TAsyncClientManager clientManager=null;
        TNonblockingSocket nonBlockingSocket=null;

        try {
            clientManager=new TAsyncClientManager();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        try {
            nonBlockingSocket=new TNonblockingSocket(HOST_NAME,PORT_NUMBER);

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        Hbase.AsyncClient client=new Hbase.AsyncClient(binProtoFactory, clientManager, nonBlockingSocket);

        client.mutateRow(ipdrTable, ByteBuffer.wrap(key), mutations, mutationAttributes, new HBaseInsertAsyncHandler());

The handler code is as given below

class HBaseInsertAsyncHandler implements AsyncMethodCallback<mutateRow_call> {
        public void onComplete(mutateRow_call response) {
            System.out.println("Completed:"+response);
        }
        public void onError(Exception exception) {
            System.out.println("Error:"+exception);
        }
    }
When I run this code, it returns with success from the call back handler,
Completed:org.apache.hadoop.hbase.thrift.generated.Hbase$AsyncClient$mutateRow_call@ffeef1

But I do not see any activity in the thrift logs and neither do I see the records being inserted in hbase. I am not sure what could be the issue, and I may be missing something here, for which I would request community's help. I suspect I am not using it properly, would greatly appreciate your help.
Thanks and Regards
Pankaj Misra

________________________________

Impetus Ranked in the Top 50 India's Best Companies to Work For 2012.

Impetus webcast 'Designing a Test Automation Framework for Multi-vendor Interoperable Systems' available at http://lf1.me/0E/.
NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.