hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alok Kumar <alok...@gmail.com>
Subject Re: Applying filters to ResultScanner
Date Wed, 18 Apr 2012 16:33:28 GMT

I think you need to recreate "a Filter + attach it to Scan" and make a call
to Hbase again in order to get a new set of results or ResultScanner.

You are right, ResultScanner object need to be released quickly when u r
done with it at middle tier. Below are the text from HBase book...
*10.8.4. Close ResultScanners*

*This isn't so much about improving performance but rather
avoidingperformance problems. If you forget to close
can cause problems on the RegionServers. Always have ResultScanner
processing enclosed in try/catch blocks... *

*Scan scan = new Scan();
// set attrs...
ResultScanner rs = htable.getScanner(scan);
try {
  for (Result r = rs.next(); r != null; r = rs.next()) {
  // process result...
} finally {
  rs.close();  // always close the ResultScanner!


On Wed, Apr 18, 2012 at 7:20 PM, Kevin M <kevin.macksamie@gmail.com> wrote:

> Hello,
> I am running HBase 0.92.0, and I am wondering if there is a way to scan a
> table, cache the ResultScanner, and then continuously filter the
> ResultScanner. The use case is to represent the functionality of a faceted
> search. The client would select an attribute/facet, a scan would be done
> and a ResultScanner would be returned. If the user applied another facet
> (forming a breadcrumb trial), then a filter would need to be applied to the
> ResultScanner and only those rows that passed the filter would remain.
> I am having trouble thinking about how to do this because I read that the
> the ResultScanner instance needs to be released as quickly as possible
> because of the amount of remote resources it holds on the server-side, and
> I don't see a filter mechanism that provides this type of functionality on
> the ResultScanner object. I went through the mailing list but I was unable
> to find a post that resembled this idea.
> Thanks.

Alok Kumar

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message