简体   繁体   English

使用Thrift Java API Hbase进行范围扫描

[英]Range scan using thrift java api Hbase

I have 10 million rows in hbase and I would like to do range scan for retrieval process. 我在hbase中有一千万行,我想进行范围扫描以进行检索。 Currently we are using java thrift api to connect to hbase. 当前,我们正在使用Java Thrift api连接到hbase。 I know the hbase shell command for range scan 我知道用于范围扫描的hbase shell命令

scan 'tablename', {STARTROW => '639415', ENDROW => '639415'}

Can any one tell me how to achieve this using java thrift api? 谁能告诉我如何使用Java Thrift API实现这一目标?

I wonder why do you use thrift api, not native java api ? 我不知道您为什么要使用Thrift API,而不是本机Java API?

You can find a good tutorial in cloudera blog, explains thrift api, and this link is about Scan https://blog.cloudera.com/blog/2014/04/how-to-use-the-hbase-thrift-interface-part-3-using-scans/ 您可以在cloudera博客中找到一个不错的教程,解释了thrift api,并且此链接与Scan https://blog.cloudera.com/blog/2014/04/how-to-use-the-hbase-thrift-interface-有关第3部分:使用扫描/

By the way, in your example above, start and stop rows are same, since stop row is not included in hbase scan, it won't return any result. 顺便说一下,在上面的示例中,开始行和停止行是相同的,因为停止行未包含在hbase扫描中,所以它不会返回任何结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM