hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chandrashekhar Kotekar <shekhar.kote...@gmail.com>
Subject Thrift node.js code not working
Date Mon, 24 Aug 2015 12:00:23 GMT
Hi,

I am trying to use following code to test HBase Thrift interface for
Node.js but it is not working.

*var thrift = require('thrift');*
*var hbase = require('./gen-nodejs/THBaseService');*
*var hbaseTypes = require('./gen-nodejs/hbase_types');*

*var connection = thrift.createConnection('nn2', 9090, {*
*  transport: thrift.TBufferedTransport//,*
*  //protocol : thrift.TBinaryProtocol*
*});*
*console.log('connection : ' + connection );*

*var client = thrift.createClient(hbase, connection);*
*for(a in client) {*
*    console.log(a);*
*}*

*connection.on('connect', function(){*
*  console.log('connected to hbase.');*
*  client.get('AD_COMPANY_V1', '028fffac57101a1fa5f9aa53a6d0', 'CF:Id',
null, function(err, data){*
*    console.log(data);*
*  });*
*  connection.end();*
*});*

*connection.on('error', function(err){*
*  console.log('error while connecting : ', err);*
*});*


Whenever I execute this code using "node index.js" command I get following
error :

/home/ubuntu/shekhar/thrift/client/gen-nodejs/THBaseService.js:228
    this.get.write(output);
             ^
TypeError: undefined is not a function
    at Object.THBaseService_get_args.write
(/home/ubuntu/shekhar/thrift/client/gen-nodejs/THBaseService.js:228:14)
    at Object.THBaseServiceClient.send_get
(/home/ubuntu/shekhar/thrift/client/gen-nodejs/THBaseService.js:2652:8)
    at Object.THBaseServiceClient.get
(/home/ubuntu/shekhar/thrift/client/gen-nodejs/THBaseService.js:2642:10)
    at null.<anonymous> (/home/ubuntu/shekhar/thrift/client/index.js:15:10)
    at emit (events.js:104:17)
    at Socket.<anonymous>
(/home/ubuntu/shekhar/thrift/client/node_modules/thrift/lib/thrift/connection.js:73:10)
    at Socket.emit (events.js:129:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1001:10)


Any idea why this error occurs?

Regards,
Chandrash3khar Kotekar
Mobile - +91 8600011455

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