org.apache.hadoop.hbase.filter
Class PageFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.FilterBase
      extended by org.apache.hadoop.hbase.filter.PageFilter
All Implemented Interfaces:
Filter, org.apache.hadoop.io.Writable

public class PageFilter
extends FilterBase

Implementation of Filter interface that limits results to a specific page size. It terminates scanning once the number of filter-passed rows is > the given page size.

Note that this filter cannot guarantee that the number of results returned to a client are <= page size. This is because the filter is applied separately on different region servers. It does however optimize the scan of individual HRegions by making sure that the page size is never exceeded locally.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Constructor Summary
PageFilter()
          Default constructor, filters nothing.
PageFilter(long pageSize)
          Constructor that takes a maximum page size.
 
Method Summary
 boolean filterAllRemaining()
          Filters that never filter all remaining can inherit this implementation that never stops the filter early.
 boolean filterRow()
          Filters that never filter by rows based on previously gathered state from FilterBase.filterKeyValue(KeyValue) can inherit this implementation that never filters a row.
 long getPageSize()
           
 void readFields(DataInput in)
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterKeyValue, filterRow, filterRowKey, getNextKeyHint, hasFilterRow, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageFilter

public PageFilter()
Default constructor, filters nothing. Required though for RPC deserialization.


PageFilter

public PageFilter(long pageSize)
Constructor that takes a maximum page size.

Parameters:
pageSize - Maximum result size.
Method Detail

getPageSize

public long getPageSize()

filterAllRemaining

public boolean filterAllRemaining()
Description copied from class: FilterBase
Filters that never filter all remaining can inherit this implementation that never stops the filter early.

Specified by:
filterAllRemaining in interface Filter
Overrides:
filterAllRemaining in class FilterBase
Returns:
true to end scan, false to continue.

filterRow

public boolean filterRow()
Description copied from class: FilterBase
Filters that never filter by rows based on previously gathered state from FilterBase.filterKeyValue(KeyValue) can inherit this implementation that never filters a row.

Specified by:
filterRow in interface Filter
Overrides:
filterRow in class FilterBase
Returns:
true to exclude row, false to include row.

readFields

public void readFields(DataInput in)
                throws IOException
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Throws:
IOException


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.