ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stoa...@apache.org
Subject ambari git commit: AMBARI-18302.Desired state of client component should not be changed in case configuration changes are applied through a "Restart.(Laszlo Puskas via stoader)"
Date Wed, 07 Sep 2016 13:18:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 3461a5c7c -> 6d13be5b9


AMBARI-18302.Desired state of client component should not be changed in case configuration
changes are applied through a "Restart.(Laszlo Puskas via stoader)"


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

Branch: refs/heads/trunk
Commit: 6d13be5b9ab6aa129bc1a71fc2eb57ccf7bbe6cd
Parents: 3461a5c
Author: Toader, Sebastian <stoader@hortonworks.com>
Authored: Wed Sep 7 15:18:25 2016 +0200
Committer: Toader, Sebastian <stoader@hortonworks.com>
Committed: Wed Sep 7 15:18:25 2016 +0200

----------------------------------------------------------------------
 .../AmbariCustomCommandExecutionHelper.java      | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6d13be5b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 8c8ae10..a671f0c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -465,15 +465,20 @@ public class AmbariCustomCommandExecutionHelper {
   private void applyCustomCommandBackendLogic(Cluster cluster, String serviceName, String
componentName, String commandName, String hostname) throws AmbariException {
     switch (commandName) {
       case "RESTART":
-        ServiceComponentHost serviceComponentHost = cluster.getService(
-            serviceName).getServiceComponent(componentName).getServiceComponentHost(hostname);
-
+        ServiceComponent serviceComponent = cluster.getService(serviceName).getServiceComponent(componentName);
+        ServiceComponentHost serviceComponentHost = serviceComponent.getServiceComponentHost(hostname);
         State currentDesiredState = serviceComponentHost.getDesiredState();
-        if (currentDesiredState != State.STARTED) {
-          LOG.info("Updating desired state to {} on RESTART for {}/{} because it was {}",
-              State.STARTED, serviceName, componentName, currentDesiredState);
 
-          serviceComponentHost.setDesiredState(State.STARTED);
+        if( !serviceComponent.isClientComponent()) {
+          if (currentDesiredState != State.STARTED) {
+            LOG.info("Updating desired state to {} on RESTART for {}/{} because it was {}",
+                State.STARTED, serviceName, componentName, currentDesiredState);
+
+            serviceComponentHost.setDesiredState(State.STARTED);
+          }
+        } else {
+          LOG.debug("Desired state for client components should not be updated on RESTART.
Service/Component {}/{}",
+              serviceName, componentName);
         }
 
         break;


Mime
View raw message