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


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/log/LogSorter.java:
##########
@@ -274,12 +274,7 @@ void writeBuffer(String destPath, 
List<Pair<LogFileKey,LogFileValue>> buffer, in
       var logFileKey = pair.getFirst();
       var logFileValue = pair.getSecond();
       Key k = logFileKey.toKey();
-      var list = keyListMap.putIfAbsent(k, logFileValue.mutations);
-      if (list != null) {
-        var muts = new ArrayList<>(list);
-        muts.addAll(logFileValue.mutations);
-        keyListMap.put(logFileKey.toKey(), muts);
-      }
+      keyListMap.computeIfAbsent(k, (key) -> new 
ArrayList<>()).addAll(logFileValue.mutations);

Review Comment:
   This change definitely fixes the problem.  Sorting a log w/ 20M key/values 
stored in 20K log entries w/ the same log file key took 10s.  Before this 
change it took so long that  I killed the test instead of waiting for it. 



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