HBASE-13649 correct javadoc for compareTimestamps

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Dave Latham 2015-05-08 10:15:23 -07:00 committed by stack
parent 70b5c97903
commit bbae9f3826
1 changed files with 11 additions and 10 deletions

View File

@ -507,12 +507,14 @@ public class CellComparator implements Comparator<Cell>, Serializable {
}
/**
* Compare the timestamp of the left and right cell
*
* @param left
* @param right
* @return 0 if equal, -1 if left's ts is less than right's ts, 1 if left's ts
* is greater than right's ts
* Compares cell's timestamps in DESCENDING order.
* The below older timestamps sorting ahead of newer timestamps looks
* wrong but it is intentional. This way, newer timestamps are first
* found when we iterate over a memstore and newer versions are the
* first we trip over when reading from a store file.
* @return 1 if left's timestamp < right's timestamp
* -1 if left's timestamp > right's timestamp
* 0 if both timestamps are equal
*/
public static int compareTimestamps(final Cell left, final Cell right) {
return compareTimestamps(left.getTimestamp(), right.getTimestamp());
@ -594,14 +596,13 @@ public class CellComparator implements Comparator<Cell>, Serializable {
}
/**
* Compares timestamps in DESCENDING order.
* The below older timestamps sorting ahead of newer timestamps looks
* wrong but it is intentional. This way, newer timestamps are first
* found when we iterate over a memstore and newer versions are the
* first we trip over when reading from a store file.
* @param ltimestamp
* @param rtimestamp
* @return 1 if left timestamp > right timestamp
* -1 if left timestamp < right timestamp
* @return 1 if left timestamp < right timestamp
* -1 if left timestamp > right timestamp
* 0 if both timestamps are equal
*/
public static int compareTimestamps(final long ltimestamp, final long rtimestamp) {