phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeffr...@apache.org
Subject [31/36] git commit: Use daemon threads so client doesn't hang
Date Mon, 10 Mar 2014 04:22:02 GMT
Use daemon threads so client doesn't hang


Project: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/commit/3224db8d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/tree/3224db8d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/diff/3224db8d

Branch: refs/heads/4.0
Commit: 3224db8d7c913605daa9911130f8aadbaaeae39f
Parents: 971b792
Author: James Taylor <jamestaylor@apache.org>
Authored: Sun Mar 9 11:31:28 2014 -0700
Committer: James Taylor <jamestaylor@apache.org>
Committed: Sun Mar 9 11:31:28 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/job/JobManager.java | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/3224db8d/phoenix-core/src/main/java/org/apache/phoenix/job/JobManager.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/job/JobManager.java b/phoenix-core/src/main/java/org/apache/phoenix/job/JobManager.java
index 0409b00..e4fdcca 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/job/JobManager.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/job/JobManager.java
@@ -17,7 +17,14 @@
  */
 package org.apache.phoenix.job;
 
-import java.util.concurrent.*;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+import java.util.concurrent.RunnableFuture;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
@@ -56,7 +63,7 @@ public class JobManager<T> extends AbstractRoundRobinQueue<T>
{
         }
         ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat(
 				"phoenix-" + PHOENIX_POOL_INDEX.getAndIncrement()
-						+ "-thread-%s").build();
+						+ "-thread-%s").setDaemon(true).build();
         // For thread pool, set core threads = max threads -- we don't ever want to exceed
core threads, but want to go up to core threads *before* using the queue.
         ThreadPoolExecutor exec = new ThreadPoolExecutor(size, size, keepAliveMs, TimeUnit.MILLISECONDS,
queue, threadFactory) {
             @Override


Mime
View raw message