@InterfaceAudience.Public public class KeyOnlyFilter extends FilterBase
This filter can be used to grab all of the keys without having to also grab the values.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
KeyOnlyFilter.KeyOnlyByteBufferExtendedCell |
(package private) static class |
KeyOnlyFilter.KeyOnlyCell |
Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
lenAsVal |
Constructor and Description |
---|
KeyOnlyFilter() |
KeyOnlyFilter(boolean lenAsVal) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
areSerializedFieldsEqual(Filter o)
Returns true if and only if the fields of the filter that are serialized are equal to the
corresponding fields in other.
|
static Filter |
createFilterFromArguments(ArrayList<byte[]> filterArguments) |
private Cell |
createKeyOnlyCell(Cell c) |
boolean |
equals(Object obj) |
Filter.ReturnCode |
filterCell(Cell ignored)
A way to filter based on the column family, column qualifier and/or the column value.
|
boolean |
filterRowKey(Cell cell)
Filters a row based on the row key.
|
int |
hashCode() |
static KeyOnlyFilter |
parseFrom(byte[] pbBytes)
Parse a serialized representation of
KeyOnlyFilter |
byte[] |
toByteArray()
Returns The filter serialized using pb
|
Cell |
transformCell(Cell cell)
By default no transformation takes place Give the filter a chance to transform the passed KeyValue.
|
filterAllRemaining, filterRow, filterRowCells, getNextCellHint, hasFilterRow, isFamilyEssential, reset, toString
isReversed, setReversed
boolean lenAsVal
public KeyOnlyFilter()
public KeyOnlyFilter(boolean lenAsVal)
public boolean filterRowKey(Cell cell) throws IOException
Filter
Filter.filterCell(Cell)
below. If
Filter.filterAllRemaining()
returns true, then Filter.filterRowKey(Cell)
should also return
true. Concrete implementers can signal a failure condition in their code by throwing an
IOException
.filterRowKey
in class FilterBase
cell
- The first cell coming in the new rowIOException
- in case an I/O or an filter specific failure needs to be signaled.public Cell transformCell(Cell cell)
FilterBase
transformCell
in class FilterBase
cell
- the KeyValue in questionThe 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}.
private Cell createKeyOnlyCell(Cell c)
public Filter.ReturnCode filterCell(Cell ignored) throws IOException
Filter
ReturnCode.NEXT_ROW
, it should return
ReturnCode.NEXT_ROW
until Filter.reset()
is called just in case the caller calls
for the next row. Concrete implementers can signal a failure condition in their code by
throwing an IOException
.filterCell
in class Filter
ignored
- the Cell in questionIOException
- in case an I/O or an filter specific failure needs to be signaled.Filter.ReturnCode
public static Filter createFilterFromArguments(ArrayList<byte[]> filterArguments)
public byte[] toByteArray()
toByteArray
in class FilterBase
public static KeyOnlyFilter parseFrom(byte[] pbBytes) throws DeserializationException
KeyOnlyFilter
pbBytes
- A pb serialized KeyOnlyFilter
instanceKeyOnlyFilter
made from bytes
DeserializationException
- if an error occurredtoByteArray()
boolean areSerializedFieldsEqual(Filter o)
areSerializedFieldsEqual
in class FilterBase
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.