@InterfaceAudience.Public public class SubstringComparator extends ByteArrayComparable
Only EQUAL or NOT_EQUAL tests are valid with this comparator.
For example:
SingleColumnValueFilter scvf = new SingleColumnValueFilter("col", CompareOp.EQUAL, new SubstringComparator("substr"));
Constructor and Description |
---|
SubstringComparator(String substr)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(byte[] value,
int offset,
int length)
Special compareTo method for subclasses, to avoid
copying byte[] unnecessarily.
|
byte[] |
getValue() |
static SubstringComparator |
parseFrom(byte[] pbBytes) |
byte[] |
toByteArray() |
compareTo, compareTo
public SubstringComparator(String substr)
substr
- the substringpublic byte[] getValue()
getValue
in class ByteArrayComparable
public int compareTo(byte[] value, int offset, int length)
ByteArrayComparable
compareTo
in class ByteArrayComparable
value
- byte[] to compareoffset
- offset into valuelength
- number of bytes to comparepublic byte[] toByteArray()
toByteArray
in class ByteArrayComparable
public static SubstringComparator parseFrom(byte[] pbBytes) throws org.apache.hadoop.hbase.exceptions.DeserializationException
pbBytes
- A pb serialized SubstringComparator
instanceSubstringComparator
made from bytes
org.apache.hadoop.hbase.exceptions.DeserializationException
toByteArray()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.