简体   繁体   English

HBase Scan中InclusiveStopFilter的效率

[英]The efficiency of InclusiveStopFilter in Hbase Scan

I want to include the endrow in Hbase Scan. 我想在Hbase扫描中包括该endrow Which way is better? 哪种方法更好?

The first way: [start, stop] 第一种方式: [start, stop]

Filter filter = new InclusiveStopFilter(stop);
Scan scan = new Scan();
scan.setStartRow(start);
scan.setFilter(filter);

The second way: 第二种方式:

(1). (1)。 scan [start, stop) 扫描[start, stop)

Scan scan = new Scan();
scan.setStartRow(start);
scan.setStopRow(stop);

(2).then get stop : (2)。然后stop

Get get = new Get(stop)

I would prefer the first option as we are setting the filter condition in the scan object itself. 我希望第一个选项是,因为我们正在扫描对象本身中设置过滤条件。 This will make sure that the filter is applied before pulling the data from disk and only the required data are retrieved and sent through the network to client in a single scan request. 这将确保在从磁盘提取数据之前应用过滤器,并且仅在单个扫描请求中检索所需的数据并将其通过网络发送给客户端。

Whereas in the second way, we have to submit two calls to get the required from region server and it involves more disk IO and network utilization. 而在第二种方法中,我们必须提交两个调用才能从区域服务器获取需求,这涉及更多的磁盘IO和网络利用率。

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

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