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 2021/09/14 17:07:41 UTC

[GitHub] [accumulo] dlmarion commented on a change in pull request #2269: Improve BatchWriter throughput

dlmarion commented on a change in pull request #2269:
URL: https://github.com/apache/accumulo/pull/2269#discussion_r708471074



##########
File path: core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchWriter.java
##########
@@ -639,6 +590,39 @@ public MutationWriter(int numSendThreads) {
       binningThreadPool =
           ThreadPools.createFixedThreadPool(1, "BinMutations", new SynchronousQueue<>(), false);
       binningThreadPool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+      binningThreadPool.execute(Trace.wrap(new Runnable() {
+        @Override
+        public void run() {
+          while (!closed) {
+            int num = incomingQueue.numMutations();
+            if (num > 0) {
+              try {
+                log.trace("{} - binning {} mutations", Thread.currentThread().getName(), num);
+                // Remove the mutations from the incoming queue
+                final MutationSet copy = new MutationSet();
+                incomingQueue.forEach((table, mutations) -> {
+                  mutations.forEach(mutation -> {
+                    copy.add(table, mutation);
+                    mutations.remove(mutation);
+                  });

Review comment:
       I implemented your suggestion.




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