ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject ambari git commit: AMBARI-13245. RU cluster in hung state while trying to perform downgrade (ncole)
Date Fri, 25 Sep 2015 20:26:05 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1.2 5876b40b6 -> f386e6efd


AMBARI-13245. RU cluster in hung state while trying to perform downgrade (ncole)


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

Branch: refs/heads/branch-2.1.2
Commit: f386e6efd27f26e10ea6b2630abac2d980678112
Parents: 5876b40
Author: Nate Cole <ncole@hortonworks.com>
Authored: Fri Sep 25 16:25:50 2015 -0400
Committer: Nate Cole <ncole@hortonworks.com>
Committed: Fri Sep 25 16:25:50 2015 -0400

----------------------------------------------------------------------
 .../apache/ambari/server/utils/Parallel.java    | 32 +++++++++++---------
 1 file changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f386e6ef/ambari-server/src/main/java/org/apache/ambari/server/utils/Parallel.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/utils/Parallel.java b/ambari-server/src/main/java/org/apache/ambari/server/utils/Parallel.java
index a67ee5c..903be0f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/utils/Parallel.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/utils/Parallel.java
@@ -19,22 +19,21 @@ package org.apache.ambari.server.utils;
 
 import java.util.Arrays;
 import java.util.Collections;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.atomic.AtomicInteger;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.Callable;
 import java.util.concurrent.CompletionService;
-import java.util.concurrent.ExecutorCompletionService;
 import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorCompletionService;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
 import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.ThreadFactory;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,12 +47,12 @@ public class Parallel {
   /**
    * Max pool size
    */
-  private static final int MAX_POOL_SIZE = Math.max(2, Runtime.getRuntime().availableProcessors());
+  private static final int MAX_POOL_SIZE = Math.max(8, Runtime.getRuntime().availableProcessors());
 
   /**
-   * Keep alive time (1 sec)
+   * Keep alive time (15 min)
    */
-  private static final int KEEP_ALIVE_TIME_MILLISECONDS = 1000;
+  private static final int KEEP_ALIVE_TIME_MINUTES = 15;
 
   /**
    * Poll duration (10 secs)
@@ -61,6 +60,11 @@ public class Parallel {
   private static final int POLL_DURATION_MILLISECONDS = 10000;
 
   /**
+   * Core pool size
+   */
+  private static final int CORE_POOL_SIZE = 2;
+
+  /**
    * Logger
    */
   private static final Logger LOG = LoggerFactory.getLogger(Parallel.class);
@@ -81,10 +85,10 @@ public class Parallel {
 
     // Create thread pool
     ThreadPoolExecutor threadPool = new ThreadPoolExecutor(
-        0,                                        // Core pool size
+        CORE_POOL_SIZE,                           // Core pool size
         MAX_POOL_SIZE,                            // Max pool size
-        KEEP_ALIVE_TIME_MILLISECONDS,             // Keep alive time for idle threads
-        TimeUnit.MILLISECONDS,
+        KEEP_ALIVE_TIME_MINUTES,                  // Keep alive time for idle threads
+        TimeUnit.MINUTES,
         blockingQueue,                            // Using synchronous queue
         new ParallelLoopsThreadFactory(),         // Thread pool factory to use
         new ThreadPoolExecutor.CallerRunsPolicy() // Rejected tasks will run on calling thread.


Mime
View raw message