HBASE-16705 Eliminate long to Long auto boxing in LongComparator. (binlijin)
Conflicts: hbase-client/src/main/java/org/apache/hadoop/hbase/filter/LongComparator.java
This commit is contained in:
parent
67a43c3059
commit
a3485cc5ab
|
@ -32,18 +32,18 @@ import org.apache.hadoop.hbase.util.Bytes;
|
|||
@InterfaceAudience.Public
|
||||
@InterfaceStability.Stable
|
||||
public class LongComparator extends ByteArrayComparable {
|
||||
private Long longValue;
|
||||
private long longValue;
|
||||
|
||||
public LongComparator(long value) {
|
||||
super(Bytes.toBytes(value));
|
||||
this.longValue = value;
|
||||
}
|
||||
public LongComparator(long value) {
|
||||
super(Bytes.toBytes(value));
|
||||
this.longValue = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(byte[] value, int offset, int length) {
|
||||
Long that = Bytes.toLong(value, offset, length);
|
||||
return this.longValue.compareTo(that);
|
||||
}
|
||||
@Override
|
||||
public int compareTo(byte[] value, int offset, int length) {
|
||||
long that = Bytes.toLong(value, offset, length);
|
||||
return Long.compare(longValue, that);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The comparator serialized using pb
|
||||
|
|
Loading…
Reference in New Issue