@InterfaceAudience.Public public class FuzzyRowFilter extends FilterBase
| Modifier and Type | Class and Description |
|---|---|
private static class |
FuzzyRowFilter.Order
Abstracts directional comparisons based on scan direction.
|
private class |
FuzzyRowFilter.RowTracker
If we have multiple fuzzy keys, row tracker should improve overall performance.
|
(package private) static class |
FuzzyRowFilter.SatisfiesCode |
Filter.ReturnCode| Modifier and Type | Field and Description |
|---|---|
private boolean |
done |
private List<Pair<byte[],byte[]>> |
fuzzyKeysData |
private int |
lastFoundIndex
The index of a last successfully found matching fuzzy string (in fuzzyKeysData).
|
private FuzzyRowFilter.RowTracker |
tracker
Row tracker (keeps all next rows after SEEK_NEXT_USING_HINT was returned)
|
private static boolean |
UNSAFE_UNALIGNED |
| Constructor and Description |
|---|
FuzzyRowFilter(List<Pair<byte[],byte[]>> fuzzyKeysData) |
| 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.
|
boolean |
equals(Object obj) |
boolean |
filterAllRemaining()
Filters that never filter all remaining can inherit this implementation that
never stops the filter early.
|
Filter.ReturnCode |
filterCell(Cell c)
A way to filter based on the column family, column qualifier and/or the column value.
|
Filter.ReturnCode |
filterKeyValue(Cell c)
Deprecated.
|
Cell |
getNextCellHint(Cell currentCell)
Filters that are not sure which key must be next seeked to, can inherit
this implementation that, by default, returns a null Cell.
|
(package private) static byte[] |
getNextForFuzzyRule(boolean reverse,
byte[] row,
byte[] fuzzyKeyBytes,
byte[] fuzzyKeyMeta) |
(package private) static byte[] |
getNextForFuzzyRule(boolean reverse,
byte[] row,
int offset,
int length,
byte[] fuzzyKeyBytes,
byte[] fuzzyKeyMeta) |
(package private) static byte[] |
getNextForFuzzyRule(byte[] row,
byte[] fuzzyKeyBytes,
byte[] fuzzyKeyMeta) |
int |
hashCode() |
private boolean |
isPreprocessedMask(byte[] mask) |
static FuzzyRowFilter |
parseFrom(byte[] pbBytes) |
private byte[] |
preprocessMask(byte[] mask)
We need to preprocess mask array, as since we treat 2's as unfixed positions and -1 (0xff) as
fixed positions
|
private void |
preprocessSearchKey(Pair<byte[],byte[]> p) |
(package private) static FuzzyRowFilter.SatisfiesCode |
satisfies(boolean reverse,
byte[] row,
byte[] fuzzyKeyBytes,
byte[] fuzzyKeyMeta) |
(package private) static FuzzyRowFilter.SatisfiesCode |
satisfies(boolean reverse,
byte[] row,
int offset,
int length,
byte[] fuzzyKeyBytes,
byte[] fuzzyKeyMeta) |
(package private) static FuzzyRowFilter.SatisfiesCode |
satisfies(byte[] row,
byte[] fuzzyKeyBytes,
byte[] fuzzyKeyMeta) |
(package private) static FuzzyRowFilter.SatisfiesCode |
satisfiesNoUnsafe(boolean reverse,
byte[] row,
int offset,
int length,
byte[] fuzzyKeyBytes,
byte[] fuzzyKeyMeta) |
byte[] |
toByteArray()
Return length 0 byte array for Filters that don't require special serialization
|
String |
toString()
Return filter's info for debugging and logging purpose.
|
private static byte[] |
trimTrailingZeroes(byte[] result,
byte[] fuzzyKeyMeta,
int toInc)
For forward scanner, next cell hint should not contain any trailing zeroes
unless they are part of fuzzyKeyMeta
hint = '\x01\x01\x01\x00\x00'
will skip valid row '\x01\x01\x01'
|
createFilterFromArguments, filterRow, filterRowCells, filterRowKey, filterRowKey, hasFilterRow, isFamilyEssential, reset, transformCellisReversed, setReversedprivate static final boolean UNSAFE_UNALIGNED
private List<Pair<byte[],byte[]>> fuzzyKeysData
private boolean done
private int lastFoundIndex
private FuzzyRowFilter.RowTracker tracker
public FuzzyRowFilter(List<Pair<byte[],byte[]>> fuzzyKeysData)
private void preprocessSearchKey(Pair<byte[],byte[]> p)
private byte[] preprocessMask(byte[] mask)
mask - private boolean isPreprocessedMask(byte[] mask)
@Deprecated public Filter.ReturnCode filterKeyValue(Cell c)
FilterReturnCode.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 Filterc - the Cell in questionFilter.ReturnCodepublic Filter.ReturnCode filterCell(Cell c)
FilterReturnCode.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 Filterc - the Cell in questionFilter.ReturnCodepublic Cell getNextCellHint(Cell currentCell)
FilterBaseIOException.getNextCellHint in class FilterBasepublic boolean filterAllRemaining()
FilterBaseIOException.filterAllRemaining in class FilterBasepublic byte[] toByteArray()
FilterBasetoByteArray in class FilterBasepublic static FuzzyRowFilter parseFrom(byte[] pbBytes) throws DeserializationException
pbBytes - A pb serialized FuzzyRowFilter instanceFuzzyRowFilter made from bytesDeserializationExceptiontoByteArray()public String toString()
FilterBasetoString in class FilterBasestatic FuzzyRowFilter.SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
static FuzzyRowFilter.SatisfiesCode satisfies(boolean reverse, byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
static FuzzyRowFilter.SatisfiesCode satisfies(boolean reverse, byte[] row, int offset, int length, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
static FuzzyRowFilter.SatisfiesCode satisfiesNoUnsafe(boolean reverse, byte[] row, int offset, int length, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
static byte[] getNextForFuzzyRule(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
static byte[] getNextForFuzzyRule(boolean reverse, byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
static byte[] getNextForFuzzyRule(boolean reverse, byte[] row, int offset, int length, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
private static byte[] trimTrailingZeroes(byte[] result, byte[] fuzzyKeyMeta, int toInc)
result - fuzzyKeyMeta - toInc - - position of incremented byteboolean areSerializedFieldsEqual(Filter o)
FilterBaseareSerializedFieldsEqual in class FilterBaseCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.