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.
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() |
String |
toString() |
toProtobuf
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.