You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@fluo.apache.org by GitBox <gi...@apache.org> on 2018/07/23 16:40:41 UTC

[GitHub] cjmctague commented on a change in pull request #1045: Fixes #1044

cjmctague commented on a change in pull request #1045: Fixes #1044
URL: https://github.com/apache/fluo/pull/1045#discussion_r204474960
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/TableRange.java
 ##########
 @@ -104,21 +105,12 @@ public Range getRange() {
     return new Range(tper, false, ter, true);
   }
 
-  @Override
-  public int compareTo(TableRange o) {
-    if (Objects.equals(getEndRow(), o.getEndRow())) {
-      // this will catch case of both null
-      return 0;
-    }
-
-    if (getEndRow() == null) {
-      return 1;
-    }
+  private static final Comparator<TableRange> TABLE_RANGE_COMPARATOR =
+      Comparator.comparing(TableRange::getPrevEndRow, Comparator.nullsFirst(Bytes::compareTo))
 
 Review comment:
   Thought was to compare the entire object but I see now it's not needed.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services