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 15:59:47 UTC

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

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

 ##########
 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:
   It looks like the new code compares `prevEndRow` in addition to `endRow`. Is there a reason for this?

----------------------------------------------------------------
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