public final class FuzzyRowFilter extends ScanFilter
It takes two byte array to match a rowkey, one to hold the fixed value and one to hold a mask indicating which bytes of the rowkey must match the fixed value. The two arrays must have the same length.
Bytes in the mask can take two values, 0 meaning that the corresponding byte in the rowkey must match the corresponding fixed byte and 1 meaning that the corresponding byte in the rowkey can take any value.
One can combine several FuzzyRowFilter.FuzzyFilterPair
to match multiple patterns at
once.
Example : You store logs with this rowkey design : group(3bytes)timestamp(4bytes)severity(1byte) You want to get all FATAL("5") logs : * Build a FuzzyFilterPair with - rowkey : "????????5" - fuzzy mask : "111111110" And CRITICAL("4") logs only for web servers : * Add another FuzzyFilterPair with - rowkey : "web????4" - fuzzy mask : "00011110"
Modifier and Type | Class and Description |
---|---|
static class |
FuzzyRowFilter.FuzzyFilterPair
Holds a pair of (row_key,fuzzy_mask) to use with
FuzzyRowFilter |
Constructor and Description |
---|
FuzzyRowFilter(Collection<FuzzyRowFilter.FuzzyFilterPair> filter_pairs)
Ctor to take a list of filters to apply against row keys
|
FuzzyRowFilter(FuzzyRowFilter.FuzzyFilterPair filter_pair)
Default ctor that applies a single fuzzy filter against all row keys
|
public FuzzyRowFilter(FuzzyRowFilter.FuzzyFilterPair filter_pair)
filter_pair
- A single filter to apply to all row keyspublic FuzzyRowFilter(Collection<FuzzyRowFilter.FuzzyFilterPair> filter_pairs)
filter_pairs
- One or more filter pairs in a collection to apply
against the row keysCopyright © 2010-2017, The Async HBase Authors