You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't seem to have the HBase client close all connections and all the Node.js process to exit normally. I've tried iterating the client.servers and calling .close() against each of them but I just receive a message about the connection being closed with no error and the Node.js process stays open (no other code is contained).
Exampe:
varHBase=require('hbase-client');varclient=HBase.create({zookeeperHosts: ['127.0.0.1:2181']});client.getRow('table','rowName',['field'],function(err,row){console.log(row);// How do I close the connection?for(varnameinclient.servers){console.log('Closing connection to '+name+'.');client.servers[name].close();}});
This script, doesn't ever finish executing for me.
The text was updated successfully, but these errors were encountered:
Looking further into this, it appears that the Zookeeper client is still keeping the connection open. The following will work...
var HBase = require('hbase-client');
var client = HBase.create({zookeeperHosts: ['127.0.0.1:2181']});
client.getRow('table', 'rowName', ['field'], function(err, row) {
console.log(row);
// Closing the connection(s)
for (var name in client.servers) {
console.log('Closing connection to ' + name + '.');
client.servers[name].close();
}
client.zk.close();
});
However, I'd like to suggest that this be incorporated into this module rather than having to perform it manually. For example client.close([callback]) could close all the server connections and the Zookeeper connection, finally calling an optional callback when complete.
I can't seem to have the HBase client close all connections and all the Node.js process to exit normally. I've tried iterating the
client.servers
and calling.close()
against each of them but I just receive a message about the connection being closed with no error and the Node.js process stays open (no other code is contained).Exampe:
This script, doesn't ever finish executing for me.
The text was updated successfully, but these errors were encountered: