From bbae9f382613aa821550932d5cf34a4d3363e399 Mon Sep 17 00:00:00 2001 From: Dave Latham Date: Fri, 8 May 2015 10:15:23 -0700 Subject: [PATCH] HBASE-13649 correct javadoc for compareTimestamps Signed-off-by: stack --- .../apache/hadoop/hbase/CellComparator.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparator.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparator.java index 904d40dc365..e7ccbdec6c6 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparator.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparator.java @@ -507,12 +507,14 @@ public class CellComparator implements Comparator, 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, 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) {