@InterfaceAudience.Public @InterfaceStability.Stable public class FirstKeyValueMatchingQualifiersFilter extends FirstKeyOnlyFilter
Note : It may emit KVs which do not have the given columns in them, if
these KVs happen to occur before a KV which does have a match. Given this
caveat, this filter is only useful for special cases
like RowCounter
.
Filter.ReturnCode
Modifier and Type | Field and Description |
---|---|
private Set<byte[]> |
qualifiers |
Constructor and Description |
---|
FirstKeyValueMatchingQualifiersFilter(Set<byte[]> qualifiers)
Constructor which takes a set of columns.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
areSerializedFieldsEqual(Filter o)
Default implementation so that writers of custom filters aren't forced to implement.
|
Filter.ReturnCode |
filterKeyValue(Cell v)
A way to filter based on the column family, column qualifier and/or the column value.
|
private boolean |
hasOneMatchingQualifier(Cell v) |
static FirstKeyValueMatchingQualifiersFilter |
parseFrom(byte[] pbBytes) |
byte[] |
toByteArray()
Return length 0 byte array for Filters that don't require special serialization
|
createFilterFromArguments, hasFoundKV, reset, setFoundKV, transformCell
filterAllRemaining, filterRow, filterRowCells, filterRowKey, getNextCellHint, getNextKeyHint, hasFilterRow, isFamilyEssential, toString, transform
isReversed, setReversed
private Set<byte[]> qualifiers
public FirstKeyValueMatchingQualifiersFilter(Set<byte[]> qualifiers)
qualifiers
- the set of columns to me matched.public Filter.ReturnCode filterKeyValue(Cell v)
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
.filterKeyValue
in class FirstKeyOnlyFilter
v
- the Cell in questionFilter.ReturnCode
private boolean hasOneMatchingQualifier(Cell v)
public byte[] toByteArray()
FilterBase
toByteArray
in class FirstKeyOnlyFilter
public static FirstKeyValueMatchingQualifiersFilter parseFrom(byte[] pbBytes) throws DeserializationException
pbBytes
- A pb serialized FirstKeyValueMatchingQualifiersFilter
instanceFirstKeyValueMatchingQualifiersFilter
made from bytes
DeserializationException
toByteArray()
boolean areSerializedFieldsEqual(Filter o)
FilterBase
areSerializedFieldsEqual
in class FirstKeyOnlyFilter
other
- Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.