You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/10/14 15:52:41 UTC

[GitHub] [accumulo] jmark99 commented on a diff in pull request #3021: Change List to SortedSet in RecoveryLogsIterator

jmark99 commented on code in PR #3021:
URL: https://github.com/apache/accumulo/pull/3021#discussion_r995906906


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/log/RecoveryLogsIterator.java:
##########
@@ -77,7 +79,7 @@ public RecoveryLogsIterator(ServerContext context, List<Path> recoveryLogDirs, L
 
     for (Path logDir : recoveryLogDirs) {
       LOG.debug("Opening recovery log dir {}", logDir.getName());
-      List<Path> logFiles = getFiles(vm, logDir);
+      SortedSet<Path> logFiles = getFiles(vm, logDir);

Review Comment:
   @ctubbsii , @dlmarion , would a change such as the following address your concerns?
   
   Replace:
   
       SortedSet logFiles = new TreeSet<>();
   
   within getFiles with:
   
       // Path::getName compares the last component of each Path value. In this case, the last
       // component should always have the format 'part-r-XXXXX.rf', where XXXXX are one-up values.
       SortedSet logFiles = new TreeSet<>(Comparator.comparing(Path::getName));
   
   Therefore, only comparing the 'part-r-xxxxx.rf' portion of the filenames.



-- 
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: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org