hbase-rest-cli
v1.0.1
Published
hbase rest client, bench includes random_write/random_read
Downloads
2
Readme
hbase-rest-cli
feature1: hbase-rest-cli
feature2: bench of random_write/read; cd node_modules/hbase-rest-cli/test/ && node test.js -h
sample
'use strict';
const co = require('co');
const hbaseInit = require('hbase-rest-cli');
const options = { host: '100.84.35.74', port: 48888 };
co(function *() {
try {
let hbase = new hbaseInit(options);
let ret = null;
// 1. --- insert || update
ret = yield hbase.put('test', 'k1', 'cf:ttt', 'val1');
console.log('put ret=', ret);
ret = yield hbase.put('test', 'k1', 'cf:ttt', 'val2');
console.log('put ret=', ret);
// 2. --- get
ret = yield hbase.get('test', 'k1');
console.log('get ret=', ret);
ret = yield hbase.get('test', 'k1', 'cf:ttt');
console.log('get ret=', ret, ret[0].$.length);
// 3-1. delete row
ret = yield hbase.delete('test', 'k1');
console.log('delete row ret=', ret);
// 3-2. delete row-cf:qualifier
ret = yield hbase.delete('test', 'k1', 'cf:ttt');
console.log('delete row-col ret=', ret);
} catch (e) {
console.log(e);
}
});