keith-turner commented on code in PR #5786:
URL: https://github.com/apache/accumulo/pull/5786#discussion_r2286120182


##########
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/FateLock.java:
##########
@@ -251,7 +261,7 @@ public void removeEntry(FateLockEntry data, long entry) {
   public static SortedSet<NodeName> validateAndWarn(FateLockPath path, 
List<String> children) {
     log.trace("validating and sorting children at path {}", path);
 
-    SortedSet<NodeName> validChildren = new TreeSet<>();
+    SortedSet<NodeName> validChildren = new 
TreeSet<>(Comparator.comparingLong(nn -> nn.sequence));

Review Comment:
   
   This is the only code that needs to compare NodeName objs and the code only 
cares about the sequence.  Adding compareTo method to the class should compare 
on all fields in the class, which adds a lot of complexity to the code that is 
not needed.  So just went w/ a simpler comparator in the place where its needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to