org.apache.hadoop.hbase.filter
Class FirstKeyOnlyFilter

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

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 interface org.apache.hadoop.hbase.filter.Filter
Filter.ReturnCode
 
Constructor Summary
FirstKeyOnlyFilter()
           
 
Method Summary
 Filter.ReturnCode filterKeyValue(KeyValue v)
          Filters that dont filter by key value can inherit this implementation that includes all KeyValues.
 void readFields(DataInput in)
           
 void reset()
          Filters that are purely stateless and do nothing in their reset() methods can inherit this null/empty implementation.
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterAllRemaining, filterRow, filterRow, filterRowKey, getNextKeyHint, hasFilterRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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.

Specified by:
reset in interface Filter
Overrides:
reset in class FilterBase

filterKeyValue

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

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

write

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

readFields

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


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