dlmarion commented on code in PR #5497:
URL: https://github.com/apache/accumulo/pull/5497#discussion_r2056312896
##########
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:
Do we need to optimize for the single key case so as not to copy the
mutations?
--
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]