org.apache.hadoop.hbase.filter
Class PrefixFilter

java.lang.Object
  extended by org.apache.hadoop.hbase.filter.Filter
      extended by org.apache.hadoop.hbase.filter.FilterBase
          extended by org.apache.hadoop.hbase.filter.PrefixFilter

@InterfaceAudience.Public
@InterfaceStability.Stable
public class PrefixFilter
extends FilterBase

Pass results that have same row prefix.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Field Summary
protected  boolean filterRow
           
static int MAX_SKIPPED_COMPARE_ROW_NUM
           
protected  boolean passedPrefix
           
protected  byte[] prefix
           
protected  int skippedCompareRows
           
 
Fields inherited from class org.apache.hadoop.hbase.filter.Filter
reversed
 
Constructor Summary
PrefixFilter(byte[] prefix)
           
 
Method Summary
static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
           
 boolean filterAllRemaining()
          Filters that never filter all remaining can inherit this implementation that never stops the filter early.
 Filter.ReturnCode filterKeyValue(Cell v)
          Filters that dont filter by key value can inherit this implementation that includes all Cells.
 boolean filterRow()
          Filters that never filter by rows based on previously gathered state from FilterBase.filterKeyValue(Cell) can inherit this implementation that never filters a row.
 boolean filterRowKey(byte[] buffer, int offset, int length)
          Filters that do not filter by row key can inherit this implementation that never filters anything.
 byte[] getPrefix()
           
static PrefixFilter parseFrom(byte[] pbBytes)
           
 void reset()
          Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.
 byte[] toByteArray()
          Return length 0 byte array for Filters that don't require special serialization
 String toString()
          Return filter's info for debugging and logging purpose.
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterRow, filterRowCells, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, transform, transformCell
 
Methods inherited from class org.apache.hadoop.hbase.filter.Filter
isReversed, setReversed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_SKIPPED_COMPARE_ROW_NUM

public static final int MAX_SKIPPED_COMPARE_ROW_NUM
See Also:
Constant Field Values

prefix

protected byte[] prefix

passedPrefix

protected boolean passedPrefix

filterRow

protected boolean filterRow

skippedCompareRows

protected int skippedCompareRows
Constructor Detail

PrefixFilter

public PrefixFilter(byte[] prefix)
Method Detail

getPrefix

public byte[] getPrefix()

filterRowKey

public boolean filterRowKey(byte[] buffer,
                            int offset,
                            int length)
Description copied from class: FilterBase
Filters that do not filter by row key can inherit this implementation that never filters anything. (ie: returns false).

Overrides:
filterRowKey in class FilterBase
Parameters:
buffer - buffer containing row key
offset - offset into buffer where row key starts
length - length of the row key
Returns:
true, remove entire row, false, include the row (maybe).

filterKeyValue

public Filter.ReturnCode filterKeyValue(Cell v)
Description copied from class: FilterBase
Filters that dont filter by key value can inherit this implementation that includes all Cells.

Overrides:
filterKeyValue in class FilterBase
Parameters:
v - the Cell in question
Returns:
code as described below
See Also:
Filter.ReturnCode

filterRow

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

Overrides:
filterRow in class FilterBase
Returns:
true to exclude row, false to include row.

reset

public void reset()
Description copied from class: FilterBase
Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.

Overrides:
reset in class FilterBase

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.

Overrides:
filterAllRemaining in class FilterBase
Returns:
true to end scan, false to continue.

createFilterFromArguments

public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)

toByteArray

public byte[] toByteArray()
Description copied from class: FilterBase
Return length 0 byte array for Filters that don't require special serialization

Overrides:
toByteArray in class FilterBase
Returns:
The filter serialized using pb

parseFrom

public static PrefixFilter parseFrom(byte[] pbBytes)
                              throws DeserializationException
Parameters:
pbBytes - A pb serialized PrefixFilter instance
Returns:
An instance of PrefixFilter made from bytes
Throws:
DeserializationException
See Also:
toByteArray()

toString

public String toString()
Description copied from class: FilterBase
Return filter's info for debugging and logging purpose.

Overrides:
toString in class FilterBase


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.