org.apache.hadoop.hbase.filter
Class FirstKeyOnlyFilter

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.FirstKeyOnlyFilter
Direct Known Subclasses:
FirstKeyValueMatchingQualifiersFilter

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

A filter that will only return the first KV from each row.

This filter can be used to more efficiently perform row count operations.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.filter.Filter
reversed
 
Constructor Summary
FirstKeyOnlyFilter()
           
 
Method Summary
static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
           
 Filter.ReturnCode filterKeyValue(Cell v)
          Filters that dont filter by key value can inherit this implementation that includes all Cells.
protected  boolean hasFoundKV()
           
static FirstKeyOnlyFilter parseFrom(byte[] pbBytes)
           
 void reset()
          Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.
protected  void setFoundKV(boolean value)
           
 byte[] toByteArray()
          Return length 0 byte array for Filters that don't require special serialization
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterAllRemaining, filterRow, filterRow, filterRowCells, filterRowKey, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, toString, 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
 

Constructor Detail

FirstKeyOnlyFilter

public FirstKeyOnlyFilter()
Method Detail

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

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

createFilterFromArguments

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

hasFoundKV

protected boolean hasFoundKV()
Returns:
true if first KV has been found.

setFoundKV

protected void setFoundKV(boolean value)
Parameters:
value - update foundKV flag with value.

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 FirstKeyOnlyFilter parseFrom(byte[] pbBytes)
                                    throws DeserializationException
Parameters:
pbBytes - A pb serialized FirstKeyOnlyFilter instance
Returns:
An instance of FirstKeyOnlyFilter made from bytes
Throws:
DeserializationException
See Also:
toByteArray()


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