Package org.apache.hadoop.hbase.filter
Class BitComparator
java.lang.Object
org.apache.hadoop.hbase.filter.ByteArrayComparable
org.apache.hadoop.hbase.filter.BitComparator
- All Implemented Interfaces:
Comparable<byte[]>
A bit comparator which performs the specified bitwise operation on each of the bytes with the
specified byte array. Then returns whether the result is non-zero.
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.apache.hadoop.hbase.filter.ByteArrayComparable
value
-
Constructor Summary
ConstructorDescriptionBitComparator
(byte[] value, BitComparator.BitwiseOp bitOperator) Constructor -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
Returns true if and only if the fields of the comparator that are serialized are equal to the corresponding fields in other.int
compareTo
(byte[] value, int offset, int length) Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.int
compareTo
(ByteBuffer value, int offset, int length) Special compareTo method for subclasses, to avoid copying bytes unnecessarily.Returns the bitwise operatorstatic BitComparator
parseFrom
(byte[] pbBytes) Parse a serialized representation ofBitComparator
byte[]
Returns The comparator serialized using pbMethods inherited from class org.apache.hadoop.hbase.filter.ByteArrayComparable
compareTo, getValue
-
Field Details
-
bitOperator
-
-
Constructor Details
-
BitComparator
Constructor- Parameters:
value
- valuebitOperator
- operator to use on the bit comparison
-
-
Method Details
-
getOperator
Returns the bitwise operator -
toByteArray
Returns The comparator serialized using pb- Specified by:
toByteArray
in classByteArrayComparable
-
parseFrom
Parse a serialized representation ofBitComparator
- Parameters:
pbBytes
- A pb serializedBitComparator
instance- Returns:
- An instance of
BitComparator
made frombytes
- Throws:
DeserializationException
- if an error occurred- See Also:
-
areSerializedFieldsEqual
Returns true if and only if the fields of the comparator that are serialized are equal to the corresponding fields in other. Used for testing.- Overrides:
areSerializedFieldsEqual
in classByteArrayComparable
-
compareTo
Description copied from class:ByteArrayComparable
Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.- Specified by:
compareTo
in classByteArrayComparable
- Parameters:
value
- byte[] to compareoffset
- offset into valuelength
- number of bytes to compare- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-
compareTo
Description copied from class:ByteArrayComparable
Special compareTo method for subclasses, to avoid copying bytes unnecessarily.- Overrides:
compareTo
in classByteArrayComparable
- Parameters:
value
- bytes to compare within a ByteBufferoffset
- offset into valuelength
- number of bytes to compare- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
-