public final class RegexStringComparator extends FilterComparator
Don't use an expensive regular expression, because Java's implementation uses backtracking and matching will happen on the server side, potentially on many many row keys, columns, or values. See Regular Expression Matching Can Be Simple And Fast for more details on regular expression performance (or lack thereof) and what "backtracking" means.
This means you need to be careful about using regular expressions supplied by users as that would allow them to easily DDoS HBase by sending prohibitively expensive regexps that would consume all CPU cycles and cause the entire HBase node to time out.
Only EQUAL and NOT_EQUAL comparisons are valid with this comparator.
Modifier and Type | Field and Description |
---|---|
static int |
kRegexStringComparator |
Constructor and Description |
---|
RegexStringComparator(String expr)
Create a regular expression filter with the specified regular expression.
|
RegexStringComparator(String expr,
Charset charset)
Create a regular expression filter with the specified regular expression
and charset.
|
Modifier and Type | Method and Description |
---|---|
Charset |
charset() |
String |
expression() |
protected String |
getName() |
protected com.google.protobuf.ByteString |
getState() |
String |
toString() |
toComparatorProto, toProtobuf
public static final int kRegexStringComparator
public RegexStringComparator(String expr)
This is equivalent to calling RegexStringComparator(String, Charset)
with the UTF-8 charset in argument.
expr
- The regular expression with which to filter.public String expression()
public Charset charset()
protected com.google.protobuf.ByteString getState()
getState
in class FilterComparator
protected String getName()
getName
in class FilterComparator
Copyright ? 2010-2018, The Async HBase Authors