org.apache.hadoop.hbase.filter
Class KeyOnlyFilter

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.KeyOnlyFilter

@InterfaceAudience.Public
@InterfaceStability.Stable
public class KeyOnlyFilter
extends org.apache.hadoop.hbase.filter.FilterBase

A filter that will only return the key component of each KV (the value will be rewritten as empty).

This filter can be used to grab all of the keys without having to also grab the values.


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
KeyOnlyFilter()
           
KeyOnlyFilter(boolean lenAsVal)
           
 
Method Summary
static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
           
static KeyOnlyFilter parseFrom(byte[] pbBytes)
           
 byte[] toByteArray()
          Return length 0 byte array for Filters that don't require special serialization
 Cell transformCell(Cell kv)
          By default no transformation takes place
 
Methods inherited from class org.apache.hadoop.hbase.filter.FilterBase
filterAllRemaining, filterKeyValue, filterRow, filterRow, filterRowCells, filterRowKey, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, reset, toString, transform
 
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

KeyOnlyFilter

public KeyOnlyFilter()

KeyOnlyFilter

public KeyOnlyFilter(boolean lenAsVal)
Method Detail

transformCell

public Cell transformCell(Cell kv)
Description copied from class: org.apache.hadoop.hbase.filter.FilterBase
By default no transformation takes place

Overrides:
transformCell in class org.apache.hadoop.hbase.filter.FilterBase
Parameters:
kv - the KeyValue in question
Returns:
the changed KeyValue
See Also:
The transformed KeyValue is what is eventually returned to the client. Most filters will return the passed KeyValue unchanged., for an example of a transformation. Concrete implementers can signal a failure condition in their code by throwing an {@link IOException}.

createFilterFromArguments

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

toByteArray

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

Overrides:
toByteArray in class org.apache.hadoop.hbase.filter.FilterBase
Returns:
The filter serialized using pb

parseFrom

public static KeyOnlyFilter parseFrom(byte[] pbBytes)
                               throws org.apache.hadoop.hbase.exceptions.DeserializationException
Parameters:
pbBytes - A pb serialized KeyOnlyFilter instance
Returns:
An instance of KeyOnlyFilter made from bytes
Throws:
org.apache.hadoop.hbase.exceptions.DeserializationException
See Also:
toByteArray()


Copyright © 2015 The Apache Software Foundation. All rights reserved.