Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d777dc0
Some connection reuse (for much put). Could still use some more/bette…
Nov 9, 2014
6231b93
Adding ConnectionPool to client
Ran-P Nov 15, 2015
32aecdc
Adding ConnectionPool to client
Ran-P Nov 15, 2015
dd2bb41
Adding ConnectionPool to client
Ran-P Nov 15, 2015
1b9b014
Adding ConnectionPool to client
Ran-P Nov 15, 2015
032495b
Adding ConnectionPool to client
Ran-P Nov 15, 2015
011061e
Adding ConnectionPool to client
Ran-P Nov 15, 2015
80312f8
Adding ConnectionPool to client
Ran-P Nov 16, 2015
85b3f58
Wrap ClientPool with service,
Ran-P Nov 16, 2015
a531370
Wrap ClientPool with service,
Ran-P Nov 16, 2015
53b77d9
Add putRow to service.
Ran-P Nov 16, 2015
453cad1
throw error when missing config in create client
Ran-P Nov 17, 2015
18cc58a
throw error when missing config in create client
Ran-P Nov 18, 2015
eed526e
added hosts to service for monitoring purposes
Ran-P Nov 18, 2015
b51bf1d
added hosts to service for monitoring purposes
Ran-P Nov 18, 2015
44e2df3
added support for timeout
Ran-P Nov 18, 2015
c86d949
added support for timeout
Ran-P Nov 18, 2015
63b9f00
added support for timeout
Ran-P Nov 18, 2015
6da3fd4
added support for timeout
Ran-P Nov 18, 2015
2b83396
destory client on error
Ran-P Nov 18, 2015
d14223d
return callback when acquiring connection for service fails
Ran-P Nov 18, 2015
d05b93e
return callback when acquiring connection for service fails
Ran-P Nov 18, 2015
31232ad
return callback when acquiring connection for service fails
Ran-P Nov 18, 2015
0f7297a
added host to client acquire error
moshewe Nov 29, 2015
0b84d76
Merge remote-tracking branch 'origin/master'
moshewe Nov 29, 2015
f9f6417
added host to client acquire error
moshewe Nov 29, 2015
a508ce5
Promisified the service w/bluebird
moshewe Dec 2, 2015
63ab664
increment added to service
Ran-P Dec 20, 2015
824ae35
Merge remote-tracking branch 'origin/master'
Ran-P Dec 20, 2015
ab7ffa2
fixed bug increment doesn't use amount argument (increment for more t…
moshewe Dec 24, 2015
96f6d92
updated thrift version to 0.9.3
moshewe Dec 24, 2015
26eb611
removed error slicing in client.js
moshewe Dec 29, 2015
d687742
can now increment with 0
Ran-P Apr 5, 2016
918705e
fix pool configurations
Ran-P Apr 18, 2016
b692e08
Merge remote-tracking branch 'origin/master'
moshewe Apr 27, 2016
51f7931
passing Get arguments directly (not only versions)
moshewe May 1, 2016
cb7462a
fixed bug with tGetArgs
moshewe May 3, 2016
0ffcea9
fixed bug with tGetArgs
moshewe May 3, 2016
34806ae
fix require('node-thrift2-hbase') in readme
Ran-P Jul 19, 2016
d5fcc6b
Merge remote-tracking branch 'origin/master'
Ran-P Jul 19, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
514 changes: 514 additions & 0 deletions 0.98.4/hbase.thrift

Large diffs are not rendered by default.

37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

![](http://dailyjs.com/images/posts/nodehbase.png)


#Use thrift2 to CRUD for hbase#
Compiled using Thrift 0.9.3 for HBase version 0.98.4
<br>

##Get ready for start hadoop hbase thrift2
Expand Down Expand Up @@ -31,17 +28,33 @@
##1 . create Hbase instance client##

```javascript
var HBase = require('node-thrift-hbase');
var HBase = require('node-thrift2-hbase');

var config = {

host: 'master',

port: 9090

host: ['host1','host2'],
port: 9090,
timeout:1000
};

var hbaseClient = HBase.client(config);
var hbaseService = HBase(config);
var hbasePool = hbaseService.clientPool;
//acquire client to HBase
hbasePool.acquire(function (err, hbaseClient) {
if(err)
console.log('error:',err);
hbaseClient.getRow('users','row1',['info:name','ecf'],1,function(err,data){ //get users table
if(err){
console.log('error:',err);
//destroy client on error
hbasePool.destroy(hbaseClient);
return;
}
//release client in the end of use.
hbasePool.release(hbaseClient);
console.log(err,data);
});

});

```
#2 . Use get or getRow function to query data
Expand Down Expand Up @@ -109,7 +122,7 @@ hbaseClient.get('users',get,function(err,data){
###getRow( table, rowKey, callback)###

```javascript
hbaseClient.getRow('users','row1',function(err,data){
hbaseService.getRow('users','row1',function(err,data){
//get users table

if(err){
Expand Down
6 changes: 3 additions & 3 deletions examples/scan.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ var scan = hbaseClient.Scan();

//scan.addFamily('info'); //add all family
//
scan.addStartRow('row1'); //start rowKey
scan.setStartRow('row1'); //start rowKey
//
scan.addStopRow('row1p'); //stop rowKey
scan.setStopRow('row1p'); //stop rowKey
//
//scan.addColumn('info','name'); //add family and qualifier
//
//scan.addColumn('ecf','name'); //add other family
//
scan.setMaxVersions(2); //set maxversions

scan.addNumRows(10); //search how much number rows
scan.setLimit(10); //search how much number rows


//or Recommend this function add
Expand Down
Loading