public class RegExFilter extends Filter
OptionDescriber.IteratorOptions
Modifier and Type | Field and Description |
---|---|
static String |
COLF_REGEX |
static String |
COLQ_REGEX |
static String |
ENCODING |
static String |
ENCODING_DEFAULT |
static String |
MATCH_SUBSTRING |
static String |
OR_FIELDS |
static String |
ROW_REGEX |
static String |
VALUE_REGEX |
Constructor and Description |
---|
RegExFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Key key,
Value value) |
SortedKeyValueIterator<Key,Value> |
deepCopy(IteratorEnvironment env)
Creates a deep copy of this iterator as though seek had not yet been called.
|
OptionDescriber.IteratorOptions |
describeOptions()
Gets an iterator options object that contains information needed to configure this iterator.
|
void |
init(SortedKeyValueIterator<Key,Value> source,
Map<String,String> options,
IteratorEnvironment env)
Initializes the iterator.
|
static void |
setEncoding(IteratorSetting si,
String encoding)
Set the encoding string to use when interpreting characters
|
static void |
setRegexs(IteratorSetting si,
String rowTerm,
String cfTerm,
String cqTerm,
String valueTerm,
boolean orFields)
Encode the terms to match against in the iterator.
|
static void |
setRegexs(IteratorSetting si,
String rowTerm,
String cfTerm,
String cqTerm,
String valueTerm,
boolean orFields,
boolean matchSubstring)
Encode the terms to match against in the iterator
|
boolean |
validateOptions(Map<String,String> options)
Check to see if an options map contains all options required by an iterator and that the option values are in the expected formats.
|
findTop, next, seek, setNegate
getSource, getTopKey, getTopValue, hasTop, setSource
public static final String ROW_REGEX
public static final String COLF_REGEX
public static final String COLQ_REGEX
public static final String VALUE_REGEX
public static final String OR_FIELDS
public static final String ENCODING
public static final String MATCH_SUBSTRING
public static final String ENCODING_DEFAULT
public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
SortedKeyValueIterator
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException
SortedKeyValueIterator
init
in interface SortedKeyValueIterator<Key,Value>
init
in class Filter
source
- SortedKeyValueIterator source to read data from.options
- Map map of string option names to option values.env
- IteratorEnvironment environment in which iterator is being run.IOException
- unused.public OptionDescriber.IteratorOptions describeOptions()
OptionDescriber
describeOptions
in interface OptionDescriber
describeOptions
in class Filter
public boolean validateOptions(Map<String,String> options)
OptionDescriber
validateOptions
in interface OptionDescriber
validateOptions
in class Filter
options
- a map of option names to option valuespublic static void setRegexs(IteratorSetting si, String rowTerm, String cfTerm, String cqTerm, String valueTerm, boolean orFields)
setRegexs(IteratorSetting, String, String, String, String, boolean, boolean)
with matchSubstring set to falsesi
- ScanIterator config to be updatedrowTerm
- the pattern to match against the Key's row. Not used if null.cfTerm
- the pattern to match against the Key's column family. Not used if null.cqTerm
- the pattern to match against the Key's column qualifier. Not used if null.valueTerm
- the pattern to match against the Key's value. Not used if null.orFields
- if true, any of the non-null terms can match to return the entrypublic static void setRegexs(IteratorSetting si, String rowTerm, String cfTerm, String cqTerm, String valueTerm, boolean orFields, boolean matchSubstring)
si
- ScanIterator config to be updatedrowTerm
- the pattern to match against the Key's row. Not used if null.cfTerm
- the pattern to match against the Key's column family. Not used if null.cqTerm
- the pattern to match against the Key's column qualifier. Not used if null.valueTerm
- the pattern to match against the Key's value. Not used if null.matchSubstring
- if true then search expressions will match on partial stringspublic static void setEncoding(IteratorSetting si, String encoding)
si
- ScanIterator config to be updatedencoding
- the encoding string to use for character interpretation.Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.