You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dd...@apache.org on 2011/11/29 00:03:07 UTC

svn commit: r1207685 - in /incubator/ambari/trunk: CHANGES.txt client/src/main/java/org/apache/ambari/common/rest/agent/HeartBeat.java controller/src/main/java/org/apache/ambari/resource/statemachine/RoleImpl.java

Author: ddas
Date: Mon Nov 28 23:03:06 2011
New Revision: 1207685

URL: http://svn.apache.org/viewvc?rev=1207685&view=rev
Log:
AMBARI-143. Fixes an annotation issue in HeartBeat class.

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/HeartBeat.java
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/RoleImpl.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1207685&r1=1207684&r2=1207685&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Mon Nov 28 23:03:06 2011
@@ -2,6 +2,8 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-143. Fixes an annotation issue in HeartBeat class (ddas)
+
   AMBZRI-142. Add cluster must validate if requested nodes are pre-allocated to any other existing cluster (vgogate)
 
   AMBARI-140. Refactors the heartbeat handling w.r.t simplification of 

Modified: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/HeartBeat.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/HeartBeat.java?rev=1207685&r1=1207684&r2=1207685&view=diff
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/HeartBeat.java (original)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/HeartBeat.java Mon Nov 28 23:03:06 2011
@@ -36,7 +36,7 @@ import javax.xml.bind.annotation.XmlType
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "", propOrder = {"responseId","timestamp", 
     "hostname", "hardwareProfile", "installedRoleStates",
-    "actionResults", "idle"})
+    "stateChangeStatus", "actionResults", "idle"})
 public class HeartBeat {
   @XmlElement
   private short responseId = -1;

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/RoleImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/RoleImpl.java?rev=1207685&r1=1207684&r2=1207685&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/RoleImpl.java (original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/resource/statemachine/RoleImpl.java Mon Nov 28 23:03:06 2011
@@ -52,7 +52,7 @@ public class RoleImpl implements RoleFSM
              RoleEventType.START)
              
          .addTransition(RoleState.STARTING, 
-             EnumSet.of(RoleState.ACTIVE, RoleState.STARTING),
+             RoleState.ACTIVE,
              RoleEventType.START_SUCCESS, new SuccessfulStartTransition())
          
          .addTransition(RoleState.ACTIVE, RoleState.ACTIVE,
@@ -125,17 +125,16 @@ public class RoleImpl implements RoleFSM
   }
   
   static class SuccessfulStartTransition implements 
-  MultipleArcTransition<RoleImpl, RoleEvent, RoleState>  {
+  SingleArcTransition<RoleImpl, RoleEvent>  {
 
     @Override
-    public RoleState transition(RoleImpl operand, RoleEvent event) {
+    public void transition(RoleImpl operand, RoleEvent event) {
       ServiceFSM service = operand.getAssociatedService();
+      //if one instance of the role starts up fine, we consider the service
+      //as ready for the 'safe-mode' kinds of checks
       StateMachineInvoker.getAMBARIEventHandler().handle(
           new ServiceEvent(ServiceEventType.ROLE_STARTED, service, 
               operand));
-      //if one instance of the role starts up fine, we consider the service
-      //as ready for the 'safe-mode' kinds of checks
-      return RoleState.ACTIVE;
     }
   }