hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-13649 correct javadoc for compareTimestamps
Date Sat, 09 May 2015 04:32:18 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 70b5c9790 -> bbae9f382


HBASE-13649 correct javadoc for compareTimestamps

Signed-off-by: stack <stack@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bbae9f38
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bbae9f38
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bbae9f38

Branch: refs/heads/master
Commit: bbae9f382613aa821550932d5cf34a4d3363e399
Parents: 70b5c97
Author: Dave Latham <davelatham@yahoo-inc.com>
Authored: Fri May 8 10:15:23 2015 -0700
Committer: stack <stack@apache.org>
Committed: Fri May 8 21:32:06 2015 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/CellComparator.java | 21 ++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bbae9f38/hbase-common/src/main/java/org/apache/hadoop/hbase/CellComparator.java
----------------------------------------------------------------------
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 904d40d..e7ccbde 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<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) {


Mime
View raw message