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