|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.filter.RegexStringComparator
public class RegexStringComparator
This comparator is for use with ColumnValueFilter, for filtering based on the value of a given column. Use it to test if a given regular expression matches a cell value in the column.
Only EQUAL or NOT_EQUAL tests are valid with this comparator.
For example:
ColumnValueFilter cvf = new ColumnValueFilter("col", ColumnValueFilter.CompareOp.EQUAL, new RegexStringComparator( // v4 IP address "(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3,3}" + "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(\\/[0-9]+)?" + "|" + // v6 IP address "((([\\dA-Fa-f]{1,4}:){7}[\\dA-Fa-f]{1,4})(:([\\d]{1,3}.)" + "{3}[\\d]{1,3})?)(\\/[0-9]+)?"));
Constructor Summary | |
---|---|
RegexStringComparator()
Nullary constructor for Writable |
|
RegexStringComparator(String expr)
Constructor |
Method Summary | |
---|---|
int |
compareTo(byte[] value)
|
void |
readFields(DataInput in)
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RegexStringComparator()
public RegexStringComparator(String expr)
expr
- a valid regular expressionMethod Detail |
---|
public int compareTo(byte[] value)
compareTo
in interface Comparable<byte[]>
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |