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


##########
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:
   No we do not need that optimization.  The key in this case is not related to 
the data, but is related to the tablet and minor compaction count. So for each 
tablet in the walog it will have the same key until a minor compactoin happens 
at which point the key changes.  Since the key is per tablet in walog,  does 
not seem that further optimization to avoid the initial copy is worthwhile.
   
   Looking into this I realized the problem is more general than what was 
described in the issue.  Can run into this problem even if writing different 
keys to the same tablet.  The problem is more of a function of how many entries 
an individual tablet has in the walog, does not really matter what the data in 
the tablet is.



-- 
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-unsubscr...@accumulo.apache.org

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

Reply via email to