org.apache.hadoop.hbase.hbql.filter
Class PageFilter

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

public class PageFilter
extends InstrumentedFilter

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
org.apache.hadoop.hbase.filter.Filter.ReturnCode
 
Constructor Summary
PageFilter()
          Default constructor, filters nothing.
PageFilter(long pageSize, org.apache.hadoop.hbase.filter.Filter filter)
          Constructor that takes a maximum page size.
 
Method Summary
 boolean filterAllRemaining()
           
 org.apache.hadoop.hbase.filter.Filter.ReturnCode filterKeyValue(org.apache.hadoop.hbase.KeyValue v)
           
 boolean filterRow()
           
 boolean filterRowKey(byte[] rowKey, int offset, int length)
           
 boolean getVerbose()
           
 void readFields(DataInput in)
           
 void reset()
           
 void setVerbose(boolean verbose)
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterRow, getNextKeyHint, hasFilterRow
 
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,
                  org.apache.hadoop.hbase.filter.Filter filter)
Constructor that takes a maximum page size.

Parameters:
pageSize - Maximum result size.
Method Detail

setVerbose

public void setVerbose(boolean verbose)
Specified by:
setVerbose in class InstrumentedFilter

getVerbose

public boolean getVerbose()
Specified by:
getVerbose in class InstrumentedFilter

reset

public void reset()
Specified by:
reset in interface org.apache.hadoop.hbase.filter.Filter
Overrides:
reset in class org.apache.hadoop.hbase.filter.FilterBase

filterAllRemaining

public boolean filterAllRemaining()
Specified by:
filterAllRemaining in interface org.apache.hadoop.hbase.filter.Filter
Overrides:
filterAllRemaining in class org.apache.hadoop.hbase.filter.FilterBase

filterRowKey

public boolean filterRowKey(byte[] rowKey,
                            int offset,
                            int length)
Specified by:
filterRowKey in interface org.apache.hadoop.hbase.filter.Filter
Overrides:
filterRowKey in class org.apache.hadoop.hbase.filter.FilterBase

filterKeyValue

public org.apache.hadoop.hbase.filter.Filter.ReturnCode filterKeyValue(org.apache.hadoop.hbase.KeyValue v)
Specified by:
filterKeyValue in interface org.apache.hadoop.hbase.filter.Filter
Overrides:
filterKeyValue in class org.apache.hadoop.hbase.filter.FilterBase

filterRow

public boolean filterRow()
Specified by:
filterRow in interface org.apache.hadoop.hbase.filter.Filter
Overrides:
filterRow in class org.apache.hadoop.hbase.filter.FilterBase

readFields

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

write

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


Copyright © 2011. All Rights Reserved.