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


##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/bulkVer2/LoadFiles.java:
##########
@@ -202,104 +212,127 @@ private Client(HostAndPort server, 
TabletClientService.Client service) {
       }
     }
 
-    private void sendQueued(int threshhold) {
-      if (queuedDataSize > threshhold || threshhold == 0) {
-        var sendTimer = Timer.startNew();
+    private void sendBackground() {
+      var queue = this.backgroundQueue.get();
+      List<Client> clients = new ArrayList<>();
 
-        List<Client> clients = new ArrayList<>();
-        try {
-
-          // Send load messages to tablet servers spinning up work, but do not 
wait on results.
-          loadQueue.forEach((server, tabletFiles) -> {
+      try {
+        var sendTimer = Timer.startNew();
 
-            if (log.isTraceEnabled()) {
-              log.trace("{} asking {} to bulk import {} files for {} tablets", 
fmtTid, server,
-                  tabletFiles.values().stream().mapToInt(Map::size).sum(), 
tabletFiles.size());
-            }
+        // Send load messages to tablet servers spinning up work, but do not 
wait on results.
+        queue.forEach((server, tabletFiles) -> {

Review Comment:
   The foreground thread abandons the map and never uses it again when it sets 
it on the atomic ref.  So when the background thread picks it up its the only 
thread using it.  So synchronization is not 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: notifications-unsubscr...@accumulo.apache.org

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

Reply via email to