incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgog...@apache.org
Subject svn commit: r1221971 - /incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java
Date Thu, 22 Dec 2011 00:36:40 GMT
Author: vgogate
Date: Thu Dec 22 00:36:40 2011
New Revision: 1221971

URL: http://svn.apache.org/viewvc?rev=1221971&view=rev
Log:
AMBARI-170. Update the cluster state after state machine transitions it to final ACTIVE/INACTIVE
state

Modified:
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java?rev=1221971&r1=1221970&r2=1221971&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/Clusters.java
Thu Dec 22 00:36:40 2011
@@ -859,6 +859,18 @@ public class Clusters {
           if (!cdef.getGoalState().equals(ClusterDefinition.GOAL_STATE_ATTIC)) {
               this.updateNodeToRolesAssociation(cdef.getNodes(), cdef.getRoleToNodesMap());
           }
+          
+          /*
+           * Update the state machine
+           */
+          ClusterFSM cs = fsmDriver.createCluster(cls,cls.getLatestRevisionNumber());
+          if (cdef.getGoalState().equals(ClusterState.CLUSTER_STATE_ACTIVE)) {
+              fsmDriver.startCluster(cls.getName());
+          } else if(cdef.getGoalState().equals(ClusterState.CLUSTER_STATE_INACTIVE)) {
+              fsmDriver.stopCluster(cls.getName());
+          } else if(cdef.getGoalState().equals(ClusterState.CLUSTER_STATE_ATTIC)) {
+              fsmDriver.stopCluster(cls.getName());
+          }
       }
   }
   



Mime
View raw message