asfgit closed pull request #348: ACCUMULO-4774 Made conditional writer thread 
into daemon
URL: https://github.com/apache/accumulo/pull/348
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
 
b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index 4812378ea7..2199ad241e 100644
--- 
a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ 
b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -36,6 +36,7 @@
 import java.util.concurrent.Delayed;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
@@ -96,7 +97,18 @@
 
 class ConditionalWriterImpl implements ConditionalWriter {
 
-  private static ThreadPoolExecutor cleanupThreadPool = new 
ThreadPoolExecutor(1, 1, 10, TimeUnit.SECONDS, new 
LinkedBlockingQueue<Runnable>());
+  private static class CleanupThreadFactory implements ThreadFactory {
+
+    @Override
+    public Thread newThread(Runnable r) {
+      Thread t = new Thread(r, "Conditional Writer Cleanup Thread ");
+      t.setDaemon(true);
+      return t;
+    }
+  }
+
+  private static ThreadPoolExecutor cleanupThreadPool = new 
ThreadPoolExecutor(1, 1, 3, TimeUnit.SECONDS, new 
LinkedBlockingQueue<Runnable>(),
+      new CleanupThreadFactory());
 
   static {
     cleanupThreadPool.allowCoreThreadTimeOut(true);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to