@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 byte |
processedWildcardMask |
private FuzzyRowFilter.RowTracker |
tracker
Row tracker (keeps all next rows after SEEK_NEXT_USING_HINT was returned)
|
private static boolean |
UNSAFE_UNALIGNED |
(package private) static byte |
V1_PROCESSED_WILDCARD_MASK |
(package private) static byte |
V2_PROCESSED_WILDCARD_MASK |
Constructor and Description |
---|
FuzzyRowFilter(List<Pair<byte[],byte[]>> fuzzyKeysData) |
FuzzyRowFilter(List<Pair<byte[],byte[]>> fuzzyKeysData,
byte processedWildcardMask) |
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.
|
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() |
(package private) static void |
idempotentMaskShift(byte[] mask) |
private boolean |
isPreprocessedMask(byte[] mask) |
static FuzzyRowFilter |
parseFrom(byte[] pbBytes)
Parse a serialized representation of
FuzzyRowFilter |
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 n * @return mask array
|
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()
Returns The filter serialized using pb
|
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' nn * @param
toInc - position of incremented byte
|
createFilterFromArguments, filterRow, filterRowCells, filterRowKey, filterRowKey, hasFilterRow, isFamilyEssential, reset, transformCell
isReversed, setReversed
private static final boolean UNSAFE_UNALIGNED
static final byte V1_PROCESSED_WILDCARD_MASK
static final byte V2_PROCESSED_WILDCARD_MASK
private final byte processedWildcardMask
private List<Pair<byte[],byte[]>> fuzzyKeysData
private boolean done
private int lastFoundIndex
private FuzzyRowFilter.RowTracker tracker
public FuzzyRowFilter(List<Pair<byte[],byte[]>> fuzzyKeysData)
FuzzyRowFilter(List<Pair<byte[],byte[]>> fuzzyKeysData, byte processedWildcardMask)
private void preprocessSearchKey(Pair<byte[],byte[]> p)
private byte[] preprocessMask(byte[] mask)
private boolean isPreprocessedMask(byte[] mask)
@Deprecated public Filter.ReturnCode filterKeyValue(Cell c)
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 Filter
c
- the Cell in questionFilter.ReturnCode
public Filter.ReturnCode filterCell(Cell c)
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
c
- the Cell in questionFilter.ReturnCode
static void idempotentMaskShift(byte[] mask)
public Cell getNextCellHint(Cell currentCell)
FilterBase
IOException
.getNextCellHint
in class FilterBase
public boolean filterAllRemaining()
FilterBase
IOException
.filterAllRemaining
in class FilterBase
public byte[] toByteArray()
toByteArray
in class FilterBase
public static FuzzyRowFilter parseFrom(byte[] pbBytes) throws DeserializationException
FuzzyRowFilter
pbBytes
- A pb serialized FuzzyRowFilter
instanceFuzzyRowFilter
made from bytes
DeserializationException
- if an error occurredtoByteArray()
public String toString()
FilterBase
toString
in class FilterBase
@InterfaceAudience.Private static FuzzyRowFilter.SatisfiesCode satisfies(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
@InterfaceAudience.Private 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)
@InterfaceAudience.Private static byte[] getNextForFuzzyRule(byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
@InterfaceAudience.Private static byte[] getNextForFuzzyRule(boolean reverse, byte[] row, byte[] fuzzyKeyBytes, byte[] fuzzyKeyMeta)
@InterfaceAudience.Private 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)
boolean areSerializedFieldsEqual(Filter o)
areSerializedFieldsEqual
in class FilterBase
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.