简体   繁体   中英

The efficiency of InclusiveStopFilter in Hbase Scan

I want to include the endrow in Hbase Scan. Which way is better?

The first way: [start, stop]

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

The second way:

(1). scan [start, stop)

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

(2).then get 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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