|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.iterators.WrappingIterator org.apache.accumulo.core.iterators.Filter org.apache.accumulo.core.iterators.user.RegExFilter
public class RegExFilter
A Filter that matches entries based on Java regular expressions.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.accumulo.core.iterators.OptionDescriber |
---|
OptionDescriber.IteratorOptions |
Field Summary | |
---|---|
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
|
Fields inherited from class org.apache.accumulo.core.iterators.Filter |
---|
NEGATE |
Constructor Summary | |
---|---|
RegExFilter()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.apache.accumulo.core.iterators.Filter |
---|
findTop, next, seek, setNegate |
Methods inherited from class org.apache.accumulo.core.iterators.WrappingIterator |
---|
getSource, getTopKey, getTopValue, hasTop, setSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public RegExFilter()
Method Detail |
---|
public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env)
SortedKeyValueIterator
deepCopy
in interface SortedKeyValueIterator<Key,Value>
deepCopy
in class Filter
env
- IteratorEnvironment environment in which iterator is being run.
public boolean accept(Key key, Value value)
accept
in class Filter
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 values
public 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 false
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.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |