You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/09/26 18:44:09 UTC

ambari git commit: AMBARI-22062. Stack selection page does not load the HDP stacks (Redux) (ncole)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 0fbefbc2e -> eb387261c


AMBARI-22062. Stack selection page does not load the HDP stacks (Redux) (ncole)


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

Branch: refs/heads/branch-2.6
Commit: eb387261cfc05511c0066e6796a37bde11c50eaf
Parents: 0fbefbc
Author: Nate Cole <nc...@hortonworks.com>
Authored: Tue Sep 26 12:25:34 2017 -0400
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Tue Sep 26 12:26:21 2017 -0400

----------------------------------------------------------------------
 .../ambari/server/api/services/AmbariMetaInfo.java   |  2 +-
 .../org/apache/ambari/server/stack/StackContext.java | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb387261/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
index d03081f..4ac8574 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
@@ -1420,7 +1420,7 @@ public class AmbariMetaInfo {
   /**
    * Ensures that the map of version definition files is populated
    */
-  private void ensureVersionDefinitions() {
+  private synchronized void ensureVersionDefinitions() {
     if (null != versionDefinitions) {
       return;
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/eb387261/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
index e201e57..8ca8068 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/stack/StackContext.java
@@ -69,7 +69,7 @@ public class StackContext {
   private static final String REPOSITORY_XML_PROPERTY_BASEURL = "baseurl";
 
   private final static Logger LOG = LoggerFactory.getLogger(StackContext.class);
-  private static final int THREAD_COUNT = 5;
+  private static final int THREAD_COUNT = 10;
 
 
   /**
@@ -195,7 +195,7 @@ public class StackContext {
      */
     public void execute() {
 
-      long l = System.nanoTime();
+      long currentTime = System.nanoTime();
       List<Future<Map<StackModule, RepoUrlInfoResult>>> results = new ArrayList<>();
 
       // !!! first, load the *_urlinfo.json files and block for completion
@@ -205,7 +205,7 @@ public class StackContext {
         LOG.warn("Could not load urlinfo as the executor was interrupted", e);
         return;
       } finally {
-        LOG.info("Loaded urlinfo in " + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - l) + "ms");
+        LOG.info("Loaded urlinfo in " + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - currentTime) + "ms");
       }
 
       List<Map<StackModule, RepoUrlInfoResult>> urlInfoResults = new ArrayList<>();
@@ -218,6 +218,7 @@ public class StackContext {
         }
       }
 
+      currentTime = System.nanoTime();
       for (Map<StackModule, RepoUrlInfoResult> urlInfoResult : urlInfoResults) {
         for (Entry<StackModule, RepoUrlInfoResult> entry : urlInfoResult.entrySet()) {
           StackModule stackModule = entry.getKey();
@@ -240,6 +241,14 @@ public class StackContext {
       }
 
       executor.shutdown();
+
+      try {
+        executor.awaitTermination(2,  TimeUnit.MINUTES);
+      } catch (InterruptedException e) {
+        LOG.warn("Loading all VDF was interrupted", e.getCause());
+      } finally {
+        LOG.info("Loaded all VDF in " + TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - currentTime) + "ms");
+      }
     }