Comments (5)
Have you tried calling the scan
method?
Can you detail the call and parameters to the scan
method here?
from node-thrift2-hbase.
my code:
var scan = hbaseClient.Scan();
scan.setStartRow(start);
scan.setStopRow(end);
scan.add('p');
scan.setLimit(maxCount);
hbaseClient.scan(tbName, scan, function(err,data){
if(err){
logger.error('scan error:',err);
}
hbasePool.release(hbaseClient);
callback(err, data);
});
but didn't know how to set filter to key .
keys like:
20170309204003AAAA 20170309204004BBBB 20170309204005CCCC ... 20170309204006AAAA
how to scan filter 'AAAA'
and start='20170309204003'
end='20170309204006'
Thanks for your help!
from node-thrift2-hbase.
First, you are using an internal object within the library (lib/client.js
) - if you use the service made available by require('node-thrift2-hbase')
, you can simply call the scan method in the required object and save yourself the pool manupuldation.
Second, your question actually deals with key filtering and design. The "highest" character is ~
, so if you use 20170309204006~
as the stop row key. For the start key, you can use just 20170309204003
.
from node-thrift2-hbase.
Thanks you for your reply!
First, I find scan in lib/service.js:
Service.prototype.scan = function (table, options, callback) {
var hbasePool = this.clientPool;
this.clientPool.acquire(function (err, hbaseClient) {
if (err)
return callback(err);
var scan = hbaseClient.Scan();
hbaseClient.scan(table, scan,
function releaseAndCallback(err, data) {
if (err) {
//destroy client on error
hbasePool.destroy(hbaseClient);
return callback(err);
}
//release client in the end of use.
hbasePool.release(hbaseClient);
return callback(null, data);
})
});
};
parameter options is not effect.
Could you show example code,
and Can you explain what is the best practice? Thank you very much!
Second, when use 20170309204006~ as the stop row key. and 20170309204003 is start row key,
How filter key suffix: 'AAAA', not 'BBBB'? Is there is a simple and efficient way to filter ?
from node-thrift2-hbase.
I've merged your pull request #3 .
Too bad it doesn't integrate into the main library and just adds the filterString, so scans are still not available to everyone. I'll start working on it though.
from node-thrift2-hbase.
Related Issues (13)
- Thrift version configuration for precompiled thrift interfaces HOT 1
- Generating code and using it for HBase: 1.1.2 with Thrift compiler 0.10.0 HOT 9
- Support for Kerberos connection HOT 7
- Taking too long to result HOT 12
- Support for HBase 1.2.6 HOT 3
- Thrift close connection error HOT 10
- Dependency [email protected] has a vulnerable dependency on ws 0.4.3.2 HOT 1
- how to enable SKIP_WAL on put HOT 2
- where is the "create" api HOT 2
- add all callback to set will cause any side effect?
- generic-pool _waitingClients size has been growing HOT 4
- hbase thrift2 Memory has been growing HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-thrift2-hbase.