ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [09/49] ambari git commit: AMBARI-19714. Perf: start/stop all actions works much slower after few days of testing.(vbrodetskyi)
Date Fri, 27 Jan 2017 18:17:20 GMT
AMBARI-19714. Perf: start/stop all actions works much slower after few days of testing.(vbrodetskyi)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: e3a53ba398d675b62d5ebf8c5324fbce2f3b2f79
Parents: fda3de6
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Thu Jan 26 01:34:23 2017 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Thu Jan 26 01:34:23 2017 +0200

----------------------------------------------------------------------
 .../AmbariManagementControllerImpl.java         | 23 +++++++++++++-------
 contrib/utils/perf/deploy-gce-perf-cluster.py   |  4 ++--
 2 files changed, 17 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3a53ba3/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index d03b2bb..2882db8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.server.controller;
 
+import javax.persistence.RollbackException;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_DRIVER;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_PASSWORD;
 import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AMBARI_DB_RCA_URL;
@@ -64,8 +65,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.concurrent.TimeUnit;
 
-import javax.persistence.RollbackException;
-
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.ClusterNotFoundException;
 import org.apache.ambari.server.DuplicateResourceException;
@@ -2186,7 +2185,9 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
                                 RoleCommand roleCommand,
                                 Map<String, String> commandParamsInp,
                                 ServiceComponentHostEvent event,
-                                boolean skipFailure
+                                boolean skipFailure,
+                                ClusterVersionEntity effectiveClusterVersion,
+                                boolean isUpgradeSuspended
                                 )
                                 throws AmbariException {
 
@@ -2302,7 +2303,6 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         commandParams.put(MAX_DURATION_OF_RETRIES, Integer.toString(retryMaxTime));
         commandParams.put(COMMAND_RETRY_ENABLED, Boolean.toString(retryEnabled));
 
-        ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
         if (effectiveClusterVersion != null) {
          commandParams.put(VERSION, effectiveClusterVersion.getRepositoryVersion().getVersion());
         }
@@ -2360,7 +2360,6 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     // in the context of an upgrade and we should send the repo ID which matches
     // the version being send down
     RepositoryVersionEntity repoVersion = null;
-    ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
     if (null != effectiveClusterVersion) {
       repoVersion = effectiveClusterVersion.getRepositoryVersion();
     } else {
@@ -2426,7 +2425,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     // !!! consistent with where custom commands put variables
     // !!! after-INSTALL hook checks this such that the stack selection tool won't
     // select-all to a version that is not being upgraded, breaking RU
-    if (cluster.isUpgradeSuspended()) {
+    if (isUpgradeSuspended) {
       cluster.addSuspendedUpgradeParameters(commandParams, roleParams);
     }
 
@@ -2561,6 +2560,12 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
       return requestStages;
     }
 
+    // caching effective cluster version
+    ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
+
+    // caching upgrade suspended
+    boolean isUpgradeSuspended = cluster.isUpgradeSuspended();
+
     // smoke test any service that goes from installed to started
     Set<String> smokeTestServices = getServicesForSmokeTests(cluster,
       changedServices, changedScHosts, runSmokeTest);
@@ -2893,7 +2898,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
               scHost.setState(State.INSTALLED);
             } else {
               createHostAction(cluster, stage, scHost, configurations, configurationAttributes,
configTags,
-                roleCommand, requestParameters, event, skipFailure);
+                roleCommand, requestParameters, event, skipFailure, effectiveClusterVersion,
isUpgradeSuspended);
             }
 
           }
@@ -3029,8 +3034,10 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         configurationAttributes =
         new TreeMap<>();
 
+    ClusterVersionEntity effectiveClusterVersion = cluster.getEffectiveClusterVersion();
+    boolean isUpgradeSuspended = cluster.isUpgradeSuspended();
     createHostAction(cluster, stage, scHost, configurations, configurationAttributes, configTags,
-                     roleCommand, null, null, false);
+                     roleCommand, null, null, false, effectiveClusterVersion, isUpgradeSuspended);
     ExecutionCommand ec = stage.getExecutionCommands().get(scHost.getHostName()).get(0).getExecutionCommand();
 
     // createHostAction does not take a hostLevelParams but creates one

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3a53ba3/contrib/utils/perf/deploy-gce-perf-cluster.py
----------------------------------------------------------------------
diff --git a/contrib/utils/perf/deploy-gce-perf-cluster.py b/contrib/utils/perf/deploy-gce-perf-cluster.py
index 565a36d..7e84c40 100644
--- a/contrib/utils/perf/deploy-gce-perf-cluster.py
+++ b/contrib/utils/perf/deploy-gce-perf-cluster.py
@@ -280,13 +280,13 @@ def create_vms(args, number_of_nodes):
   :param number_of_nodes: Number of VMs to request.
   """
   print "Creating server VM {0}-server-{1} with xxlarge nodes on centos6...".format(cluster_prefix,
args.cluster_suffix)
-  execute_command(args, args.controller, "/usr/sbin/gce up {0}-server-{1} 1 --centos6 --xxlarge
--ex --disk-xxlarge".format(cluster_prefix, args.cluster_suffix),
+  execute_command(args, args.controller, "/usr/sbin/gce up {0}-server-{1} 1 --centos6 --xxlarge
--ex --disk-xxlarge --ssd".format(cluster_prefix, args.cluster_suffix),
                   "Failed to create server, probably not enough resources!", "-tt")
   time.sleep(10)
 
   # trying to create cluster with needed params
   print "Creating agent VMs {0}-agent-{1} with {2} xlarge nodes on centos6...".format(cluster_prefix,
args.cluster_suffix, str(number_of_nodes))
-  execute_command(args, args.controller, "/usr/sbin/gce up {0}-agent-{1} {2} --centos6 --xlarge
--ex --disk-large".format(cluster_prefix, args.cluster_suffix, str(number_of_nodes)),
+  execute_command(args, args.controller, "/usr/sbin/gce up {0}-agent-{1} {2} --centos6 --xlarge
--ex --disk-xlarge".format(cluster_prefix, args.cluster_suffix, str(number_of_nodes)),
                   "Failed to create cluster VMs, probably not enough resources!", "-tt")
 
   # VMs are not accessible immediately


Mime
View raw message