accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ctubbsii commented on a change in pull request #501: Improve some comparators using Java 8
Date Wed, 30 May 2018 16:47:47 GMT
ctubbsii commented on a change in pull request #501: Improve some comparators using Java 8
URL: https://github.com/apache/accumulo/pull/501#discussion_r191841536
 
 

 ##########
 File path: core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java
 ##########
 @@ -383,32 +384,14 @@ public static Mutation getPrevRowUpdateMutation(KeyExtent ke) {
     return m;
   }
 
+  private static final Comparator<KeyExtent> COMPARATOR = Comparator
+      .comparing(KeyExtent::getTableId)
+      .thenComparing(KeyExtent::getEndRow, Comparator.nullsLast(Text::compareTo))
 
 Review comment:
   Oh, I think I understand now. How about something like:
   ```java
   // The last tablet in a table has no end row, so null sorts last for end row; similarly,
the first tablet has no previous end row, so null sorts first for previous end row
   ```

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

Mime
View raw message