public class SubstringComparator extends WritableByteArrayComparable
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()
Nullary constructor for Writable, do not use
|
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() |
void |
readFields(DataInput in) |
void |
write(DataOutput out) |
compareTo
public SubstringComparator()
public SubstringComparator(String substr)
substr
- the substringpublic byte[] getValue()
getValue
in class WritableByteArrayComparable
public int compareTo(byte[] value, int offset, int length)
WritableByteArrayComparable
compareTo
in class WritableByteArrayComparable
value
- byte[] to compareoffset
- offset into valuelength
- number of bytes to comparepublic void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class WritableByteArrayComparable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class WritableByteArrayComparable
IOException
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.