New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ripple-hbase-client

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ripple-hbase-client - npm Package Compare versions

Comparing version 0.1.9-thrift to 0.1.10-thrift

2

package.json
{
"name": "ripple-hbase-client",
"version": "0.1.9-thrift",
"version": "0.1.10-thrift",
"description": "ripple hbase client",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -144,2 +144,3 @@ const thrift = require('thrift')

function HbaseClient(options) {
const self = this
this._prefix = options.prefix || ''

@@ -169,6 +170,2 @@ this.logStats = (options.logLevel && options.logLevel > 3) ? true : false

const timeout = setTimeout(() => {
reject()
}, options.timeout || 30000)
const connection = thrift.createConnection(server.host, server.port, {

@@ -181,3 +178,2 @@ transport: thrift.TFramedTransport,

connection.once('connect', () => {
clearTimeout(timeout)
connection.connection.setKeepAlive(true)

@@ -193,2 +189,3 @@ connection.client = thrift.createClient(HBase, connection)

connection.on('close', () => {
connection.connected = false
reject()

@@ -198,2 +195,3 @@ })

connection.on('timeout', () => {
connection.connected = false
reject()

@@ -203,7 +201,10 @@ })

},
destroy: client => {}
destroy: client => {},
validate: client => {
return client.connected
}
}
const params = {
testOnBorrow: false,
testOnBorrow: true,
max: options.max_sockets || 100,

@@ -221,5 +222,17 @@ min: options.min_sockets || 5,

.then(client => {
client.on('error', reject)
client.on('timeout', reject.bind(this, TIMEOUT_MESSAGE))
client.on('close', reject.bind(this, CLOSE_MESSAGE))
const onError = reject
const onTimeout = reject.bind(this, TIMEOUT_MESSAGE)
const onClose = reject.bind(this, CLOSE_MESSAGE)
client.on('error', onError)
client.on('timeout', onTimeout)
client.on('close', onClose)
client.onRelease = function() {
client.removeListener('error', onError)
client.removeListener('timeout', onTimeout)
client.removeListener('close', onClose)
}
return client

@@ -230,3 +243,3 @@ })

HbaseClient.prototype.release = function(client) {
client.removeAllListeners()
client.onRelease()
this.pool.release(client)

@@ -233,0 +246,0 @@ }

@@ -8,8 +8,12 @@ const Hbase = require('./src/index.js')

host: 'hadoop3-private.wdc01.infra.ripple.com',
//servers: [
// {host:'hadoop1000-private.wdc01.infra.ripple.com', port:9090},
// {host:'hadoop1000-private.wdc01.infra.ripple.com', port:9090}
//],
root: '/hbase',
prefix: 'prod_',
logLevel: 2,
max_sockets: 2,
logLevel: 3,
timeout: 5000,
min_sockets: 2,
timeout: 5000
max_sockets: 2
})

@@ -19,5 +23,5 @@

setInterval(() => {
console.log(++count)
setInterval(check, 10000)
function check() {
hbase.getRow({

@@ -28,6 +32,3 @@ table: 'control',

.then(console.log)
.catch(function(err) {
console.log('err')
console.log(err)
})
.catch(console.log)

@@ -39,10 +40,7 @@

.then(console.log)
.catch(function(err) {
console.log('err')
console.log(err)
})
.catch(console.log)
}
}, 1000)
check()
process.on('unhandledRejection', error => {

@@ -49,0 +47,0 @@ // Will print "unhandledRejection err is not defined"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc