accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dlmar...@apache.org
Subject accumulo git commit: ACCUMULO-1755: Make background thread a daemon
Date Mon, 29 Feb 2016 15:40:40 GMT
Repository: accumulo
Updated Branches:
  refs/heads/ACCUMULO-1755 bcbe7417c -> 585fab810


ACCUMULO-1755: Make background thread a daemon


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/585fab81
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/585fab81
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/585fab81

Branch: refs/heads/ACCUMULO-1755
Commit: 585fab810b00e9666e6604733eaf4321f9315b3b
Parents: bcbe741
Author: Dave Marion <dlmarion@apache.org>
Authored: Mon Feb 29 10:39:42 2016 -0500
Committer: Dave Marion <dlmarion@apache.org>
Committed: Mon Feb 29 10:39:42 2016 -0500

----------------------------------------------------------------------
 .../accumulo/core/client/impl/TabletServerBatchWriter.java     | 3 +--
 .../java/org/apache/accumulo/core/util/SimpleThreadPool.java   | 6 ++++++
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/585fab81/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
index 3c848fe..2b586ce 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
@@ -33,7 +33,6 @@ import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.LinkedTransferQueue;
-import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicLong;
@@ -640,7 +639,7 @@ public class TabletServerBatchWriter {
     private static final int MUTATION_BATCH_SIZE = 1 << 17;
     private final ExecutorService sendThreadPool;
     private final LinkedTransferQueue<Runnable> queue = new LinkedTransferQueue<>();
-    private final ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 10L, TimeUnit.SECONDS,
queue);
+    private final SimpleThreadPool executor = new SimpleThreadPool(1, "BinMutations", queue);
     private final Map<String,TabletServerMutations<Mutation>> serversMutations;
     private final Set<String> queued;
     private final Map<String,TabletLocator> locators;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/585fab81/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java b/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
index a406233..8991991 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/SimpleThreadPool.java
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.util;
 
+import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
@@ -30,4 +31,9 @@ public class SimpleThreadPool extends ThreadPoolExecutor {
     allowCoreThreadTimeOut(true);
   }
 
+  public SimpleThreadPool(int max, final String name, BlockingQueue<Runnable> queue)
{
+    super(max, max, 4l, TimeUnit.SECONDS, queue, new NamingThreadFactory(name));
+    allowCoreThreadTimeOut(true);
+  }
+
 }


Mime
View raw message