You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by hi...@apache.org on 2012/09/13 00:17:29 UTC
svn commit: r1384147 - in /incubator/ambari/branches/AMBARI-666: ./
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/
ambari-server/src/main/java/org/apache/ambari/server/agent/
ambari-server/src/main/java/org/apache/ambari/server/age...
Author: hitesh
Date: Wed Sep 12 22:17:28 2012
New Revision: 1384147
URL: http://svn.apache.org/viewvc?rev=1384147&view=rev
Log:
AMBARI-728. Initial work on ServiceComponentNode FSM. (Contributed by hitesh)
Added:
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeLiveState.java (with props)
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/StackVersion.java (with props)
Modified:
incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/DiskInfo.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeat.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/NodeInfo.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/Register.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/rest/HeartBeatResponse.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/Cluster.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNode.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeImpl.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeState.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobCompletedEvent.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobFailedEvent.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobProgressUpdateEvent.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobType.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/NewJobEvent.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/job/TestJobImpl.java
incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/node/TestNodeImpl.java
Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Wed Sep 12 22:17:28 2012
@@ -12,6 +12,8 @@ AMBARI-666 branch (unreleased changes)
NEW FEATURES
+ AMBARI-728. Initial work on ServiceComponentNode FSM. (hitesh)
+
AMBARI-724. Add tabs, dynamic form generation, validation errors, and info
popovers for Customize Services page in Installer (yusaku)
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java Wed Sep 12 22:17:28 2012
@@ -21,13 +21,13 @@ import java.util.List;
public class ActionDBAccessor {
public void persistAction(HostAction ha) {
-
+
}
-
+
public Stage getAction(String actionId) {
return null;
}
-
+
public List<Stage> getAllStages(String requestId) {
return null;
}
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionManager.java Wed Sep 12 22:17:28 2012
@@ -29,16 +29,16 @@ public class ActionManager {
public void sendActions(List<Stage> stages) {
//Store all these actions to the db
}
-
+
public List<Stage> getRequestStatus(String requestId) {
return null;
}
-
+
public Stage getActionStatus(String actionId) {
//fetch the action information from the db
return null;
}
-
+
public void actionResponse(String hostname, List<CommandReport> report) {
//persist the action response into the db.
}
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionScheduler.java Wed Sep 12 22:17:28 2012
@@ -17,19 +17,19 @@
*/
package org.apache.ambari.server.actionmanager;
-//This class encapsulates the action scheduler thread.
+//This class encapsulates the action scheduler thread.
//Action schedule frequently looks at action database and determines if
//there is an action that can be scheduled.
public class ActionScheduler implements Runnable {
-
+
private final long actionTimeout;
private final long sleepTime;
-
+
public ActionScheduler(long sleepTimeMilliSec, long actionTimeoutMilliSec) {
this.sleepTime = sleepTimeMilliSec;
this.actionTimeout = actionTimeoutMilliSec;
}
-
+
@Override
public void run() {
try {
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/DiskInfo.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/DiskInfo.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/DiskInfo.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/DiskInfo.java Wed Sep 12 22:17:28 2012
@@ -31,7 +31,7 @@ import javax.xml.bind.annotation.XmlType
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {})
-//TODO convert the type safe ints/longs for used/percent/size.
+//TODO convert the type safe ints/longs for used/percent/size.
public class DiskInfo {
@XmlElement
String available;
@@ -45,16 +45,16 @@ public class DiskInfo {
String percent;
@XmlElement
String size;
-
+
/**
* DiskInfo object that tracks information about a disk.
- * @param mountpoint
+ * @param mountpoint
* @param available
* @param used
* @param percent
* @param size
*/
- public DiskInfo(String device, String mountpoint, String available,
+ public DiskInfo(String device, String mountpoint, String available,
String used, String percent, String size) {
this.device = device;
this.mountpoint = mountpoint;
@@ -63,32 +63,32 @@ public class DiskInfo {
this.percent = percent;
this.size = size;
}
-
+
/**
* Needed for JAXB
*/
public DiskInfo() {}
-
+
public String getAvailable() {
return this.available;
}
-
+
public String getMountPoint() {
return this.mountpoint;
}
-
+
public String getUsed() {
return this.used;
}
-
+
public String getPercent() {
return this.percent;
}
-
+
@Override
public String toString() {
return "available=" + this.available + ",mountpoint=" + this.mountpoint
- + ",used=" + this.used + ",percent=" + this.percent + ",size=" +
+ + ",used=" + this.used + ",percent=" + this.percent + ",size=" +
this.size + ",device=" + this.device;
}
}
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeat.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeat.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeat.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeat.java Wed Sep 12 22:17:28 2012
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlType
/**
*
- *
+ *
* Data model for Ambari Agent to send heartbeat to Ambari Server.
*
*/
@@ -44,7 +44,7 @@ public class HeartBeat {
List<ComponentStatus> componentStatus;
//TODO add serialization
NodeStatus nodeStatus;
-
+
@XmlElement
private short responseId = -1;
@XmlElement
@@ -80,8 +80,8 @@ public class HeartBeat {
public boolean getIdle() {
return idle;
- }
-
+ }
+
public int getInstallScriptHash() {
return installScriptHash;
}
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/HeartBeatHandler.java Wed Sep 12 22:17:28 2012
@@ -25,7 +25,7 @@ import org.apache.ambari.server.agent.re
*/
public class HeartBeatHandler {
private String lastCompletedActionId;
-
+
public HeartBeatResponse handleHeartBeat(HeartBeat heartbeat) {
System.out.println(heartbeat.toString());
return null;
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/NodeInfo.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/NodeInfo.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/NodeInfo.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/NodeInfo.java Wed Sep 12 22:17:28 2012
@@ -28,7 +28,7 @@ import javax.xml.bind.annotation.XmlRoot
import javax.xml.bind.annotation.XmlType;
/**
- *
+ *
* Data model for Ambari Agent to send hardware profile to Ambari Server.
*
*/
@@ -99,7 +99,7 @@ public class NodeInfo {
@XmlElement
private long uptime_days;
@XmlElement
- private long uptime_hours;
+ private long uptime_hours;
public String getArchitecture() {
return this.architecture;
@@ -325,7 +325,7 @@ public class NodeInfo {
this.swapsize = swapsize;
}
- public String getTimeZone() {
+ public String getTimeZone() {
return this.timezone;
}
@@ -364,7 +364,7 @@ public class NodeInfo {
}
return ret;
}
-
+
public String toString() {
return "[memory=" + this.memorytotal + "," +
"uptime_hours=" + this.uptime_hours + "," +
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/Register.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/Register.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/Register.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/Register.java Wed Sep 12 22:17:28 2012
@@ -44,7 +44,7 @@ public class Register {
private String hostname;
@XmlElement
private NodeInfo hardwareProfile;
-
+
public short getResponseId() {
return responseId;
}
@@ -60,7 +60,7 @@ public class Register {
public String getHostname() {
return hostname;
}
-
+
public NodeInfo getHardwareProfile() {
return hardwareProfile;
}
@@ -72,9 +72,9 @@ public class Register {
public void setHostname(String hostname) {
this.hostname = hostname;
}
-
+
public void setHardwareProfile(NodeInfo hardwareProfile) {
- this.hardwareProfile = hardwareProfile;
+ this.hardwareProfile = hardwareProfile;
}
@Override
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/rest/HeartBeatResponse.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/rest/HeartBeatResponse.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/rest/HeartBeatResponse.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/agent/rest/HeartBeatResponse.java Wed Sep 12 22:17:28 2012
@@ -38,13 +38,13 @@ import org.apache.ambari.server.agent.Ag
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {})
public class HeartBeatResponse {
-
+
String lastCompletedActionId;
@XmlElement
public short responseId;
@XmlElement
public String clusterId;
-
+
List<AgentCommand> cmds = null;
public short getResponseId() {
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java Wed Sep 12 22:17:28 2012
@@ -51,7 +51,7 @@ public class AmbariServer {
ServletHolder sh = new ServletHolder(ServletContainer.class);
sh.setInitParameter("com.sun.jersey.config.property.resourceConfigClass",
"com.sun.jersey.api.core.PackagesResourceConfig");
- sh.setInitParameter("com.sun.jersey.config.property.packages",
+ sh.setInitParameter("com.sun.jersey.config.property.packages",
"org.apache.ambari.server.api.rest");
root.addServlet(sh, "/api/*");
sh.setInitOrder(2);
@@ -59,7 +59,7 @@ public class AmbariServer {
ServletHolder agent = new ServletHolder(ServletContainer.class);
agent.setInitParameter("com.sun.jersey.config.property.resourceConfigClass",
"com.sun.jersey.api.core.PackagesResourceConfig");
- agent.setInitParameter("com.sun.jersey.config.property.packages",
+ agent.setInitParameter("com.sun.jersey.config.property.packages",
"org.apache.ambari.server.agent.rest");
root.addServlet(agent, "/agent/*");
agent.setInitOrder(3);
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/Cluster.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/Cluster.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/Cluster.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/Cluster.java Wed Sep 12 22:17:28 2012
@@ -53,7 +53,7 @@ public interface Cluster {
* @param nodeName Node name
* @return ServiceComponentNodeState
*/
- public ServiceComponentNodeState getServiceComponentNodeState(String service,
+ public ServiceComponentNodeLiveState getServiceComponentNodeState(String service,
String serviceComponent, String nodeName);
/**
@@ -65,7 +65,7 @@ public interface Cluster {
*/
public void setServiceComponentNodeState(String service,
String serviceComponent, String nodeName,
- ServiceComponentNodeState state);
+ ServiceComponentNodeLiveState state);
/**
* Send an Event to a given ServiceComponentNode
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNode.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNode.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNode.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNode.java Wed Sep 12 22:17:28 2012
@@ -20,7 +20,6 @@ package org.apache.ambari.server.state.l
import java.util.List;
-import org.apache.ambari.server.state.ConfigVersion;
import org.apache.ambari.server.state.fsm.InvalidStateTransitonException;
import org.apache.ambari.server.state.live.job.Job;
@@ -39,13 +38,6 @@ public interface ServiceComponentNode {
*/
public String getNodeName();
-
- /**
- * Get the Config Version
- * @return ConfigVersion
- */
- public ConfigVersion getConfigVersion();
-
/**
* Get the list of Jobs that are currently being tracked at the
* ServiceComponentNode level
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeImpl.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeImpl.java Wed Sep 12 22:17:28 2012
@@ -19,205 +19,268 @@
package org.apache.ambari.server.state.live;
import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
-import org.apache.ambari.server.state.ConfigVersion;
import org.apache.ambari.server.state.fsm.InvalidStateTransitonException;
import org.apache.ambari.server.state.fsm.StateMachine;
import org.apache.ambari.server.state.fsm.StateMachineFactory;
import org.apache.ambari.server.state.live.job.Job;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class ServiceComponentNodeImpl implements ServiceComponentNode {
+ private static final Log LOG =
+ LogFactory.getLog(ServiceComponentNodeImpl.class);
+
+ private final Lock readLock;
+ private final Lock writeLock;
+
+ private ServiceComponentNodeState state;
+
+ private final String serviceComponentName;
+ private final String hostName;
+
private static final StateMachineFactory
- <ServiceComponentNodeImpl, ServiceComponentNodeState,
+ <ServiceComponentNodeImpl, ServiceComponentNodeLiveState,
ServiceComponentNodeEventType, ServiceComponentNodeEvent>
daemonStateMachineFactory
= new StateMachineFactory<ServiceComponentNodeImpl,
- ServiceComponentNodeState, ServiceComponentNodeEventType,
+ ServiceComponentNodeLiveState, ServiceComponentNodeEventType,
ServiceComponentNodeEvent>
- (ServiceComponentNodeState.INIT)
+ (ServiceComponentNodeLiveState.INIT)
- // define the state machine of a NodeServiceComponent
+ // define the state machine of a NodeServiceComponent for runnable
+ // components
- .addTransition(ServiceComponentNodeState.INIT,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INIT,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_INSTALL)
- .addTransition(ServiceComponentNodeState.INSTALLING,
- ServiceComponentNodeState.INSTALLED,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLING,
+ ServiceComponentNodeLiveState.INSTALLED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_SUCCEEDED)
- .addTransition(ServiceComponentNodeState.INSTALLING,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLING,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_IN_PROGRESS)
- .addTransition(ServiceComponentNodeState.INSTALLING,
- ServiceComponentNodeState.INSTALL_FAILED,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLING,
+ ServiceComponentNodeLiveState.INSTALL_FAILED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_FAILED)
- .addTransition(ServiceComponentNodeState.INSTALL_FAILED,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALL_FAILED,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_RESTART)
- .addTransition(ServiceComponentNodeState.INSTALLED,
- ServiceComponentNodeState.STARTING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLED,
+ ServiceComponentNodeLiveState.STARTING,
ServiceComponentNodeEventType.NODE_SVCCOMP_START)
- .addTransition(ServiceComponentNodeState.INSTALLED,
- ServiceComponentNodeState.UNINSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLED,
+ ServiceComponentNodeLiveState.UNINSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_UNINSTALL)
- .addTransition(ServiceComponentNodeState.INSTALLED,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLED,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_INSTALL)
- .addTransition(ServiceComponentNodeState.STARTING,
- ServiceComponentNodeState.STARTING,
+ .addTransition(ServiceComponentNodeLiveState.STARTING,
+ ServiceComponentNodeLiveState.STARTING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_IN_PROGRESS)
- .addTransition(ServiceComponentNodeState.STARTING,
- ServiceComponentNodeState.STARTED,
+ .addTransition(ServiceComponentNodeLiveState.STARTING,
+ ServiceComponentNodeLiveState.STARTED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_SUCCEEDED)
- .addTransition(ServiceComponentNodeState.STARTING,
- ServiceComponentNodeState.START_FAILED,
+ .addTransition(ServiceComponentNodeLiveState.STARTING,
+ ServiceComponentNodeLiveState.START_FAILED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_FAILED)
- .addTransition(ServiceComponentNodeState.START_FAILED,
- ServiceComponentNodeState.STARTING,
+ .addTransition(ServiceComponentNodeLiveState.START_FAILED,
+ ServiceComponentNodeLiveState.STARTING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_RESTART)
- .addTransition(ServiceComponentNodeState.STARTED,
- ServiceComponentNodeState.STOPPING,
+ .addTransition(ServiceComponentNodeLiveState.STARTED,
+ ServiceComponentNodeLiveState.STOPPING,
ServiceComponentNodeEventType.NODE_SVCCOMP_STOP)
- .addTransition(ServiceComponentNodeState.STOPPING,
- ServiceComponentNodeState.STOPPING,
+ .addTransition(ServiceComponentNodeLiveState.STOPPING,
+ ServiceComponentNodeLiveState.STOPPING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_IN_PROGRESS)
- .addTransition(ServiceComponentNodeState.STOPPING,
- ServiceComponentNodeState.INSTALLED,
+ .addTransition(ServiceComponentNodeLiveState.STOPPING,
+ ServiceComponentNodeLiveState.INSTALLED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_SUCCEEDED)
- .addTransition(ServiceComponentNodeState.STOPPING,
- ServiceComponentNodeState.STOP_FAILED,
+ .addTransition(ServiceComponentNodeLiveState.STOPPING,
+ ServiceComponentNodeLiveState.STOP_FAILED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_FAILED)
- .addTransition(ServiceComponentNodeState.STOP_FAILED,
- ServiceComponentNodeState.STOPPING,
+ .addTransition(ServiceComponentNodeLiveState.STOP_FAILED,
+ ServiceComponentNodeLiveState.STOPPING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_RESTART)
- .addTransition(ServiceComponentNodeState.UNINSTALLING,
- ServiceComponentNodeState.UNINSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLING,
+ ServiceComponentNodeLiveState.UNINSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_IN_PROGRESS)
- .addTransition(ServiceComponentNodeState.UNINSTALLING,
- ServiceComponentNodeState.UNINSTALLED,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLING,
+ ServiceComponentNodeLiveState.UNINSTALLED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_SUCCEEDED)
- .addTransition(ServiceComponentNodeState.UNINSTALLING,
- ServiceComponentNodeState.UNINSTALL_FAILED,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLING,
+ ServiceComponentNodeLiveState.UNINSTALL_FAILED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_FAILED)
- .addTransition(ServiceComponentNodeState.UNINSTALL_FAILED,
- ServiceComponentNodeState.UNINSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALL_FAILED,
+ ServiceComponentNodeLiveState.UNINSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_RESTART)
- .addTransition(ServiceComponentNodeState.UNINSTALLED,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLED,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_INSTALL)
- .addTransition(ServiceComponentNodeState.UNINSTALLED,
- ServiceComponentNodeState.INIT,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLED,
+ ServiceComponentNodeLiveState.INIT,
ServiceComponentNodeEventType.NODE_SVCCOMP_WIPEOUT)
.installTopology();
private static final StateMachineFactory
- <ServiceComponentNodeImpl, ServiceComponentNodeState,
+ <ServiceComponentNodeImpl, ServiceComponentNodeLiveState,
ServiceComponentNodeEventType, ServiceComponentNodeEvent>
clientStateMachineFactory
= new StateMachineFactory<ServiceComponentNodeImpl,
- ServiceComponentNodeState, ServiceComponentNodeEventType,
+ ServiceComponentNodeLiveState, ServiceComponentNodeEventType,
ServiceComponentNodeEvent>
- (ServiceComponentNodeState.INIT)
+ (ServiceComponentNodeLiveState.INIT)
- // define the state machine of a NodeServiceComponent
+ // define the state machine of a NodeServiceComponent for client only
+ // components
- .addTransition(ServiceComponentNodeState.INIT,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INIT,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_INSTALL)
- .addTransition(ServiceComponentNodeState.INSTALLING,
- ServiceComponentNodeState.INSTALLED,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLING,
+ ServiceComponentNodeLiveState.INSTALLED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_SUCCEEDED)
- .addTransition(ServiceComponentNodeState.INSTALLING,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLING,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_IN_PROGRESS)
- .addTransition(ServiceComponentNodeState.INSTALLING,
- ServiceComponentNodeState.INSTALL_FAILED,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLING,
+ ServiceComponentNodeLiveState.INSTALL_FAILED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_FAILED)
- .addTransition(ServiceComponentNodeState.INSTALL_FAILED,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALL_FAILED,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_RESTART)
- .addTransition(ServiceComponentNodeState.INSTALLED,
- ServiceComponentNodeState.UNINSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLED,
+ ServiceComponentNodeLiveState.UNINSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_UNINSTALL)
- .addTransition(ServiceComponentNodeState.INSTALLED,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.INSTALLED,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_INSTALL)
- .addTransition(ServiceComponentNodeState.UNINSTALLING,
- ServiceComponentNodeState.UNINSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLING,
+ ServiceComponentNodeLiveState.UNINSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_IN_PROGRESS)
- .addTransition(ServiceComponentNodeState.UNINSTALLING,
- ServiceComponentNodeState.UNINSTALLED,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLING,
+ ServiceComponentNodeLiveState.UNINSTALLED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_SUCCEEDED)
- .addTransition(ServiceComponentNodeState.UNINSTALLING,
- ServiceComponentNodeState.UNINSTALL_FAILED,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLING,
+ ServiceComponentNodeLiveState.UNINSTALL_FAILED,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_FAILED)
- .addTransition(ServiceComponentNodeState.UNINSTALL_FAILED,
- ServiceComponentNodeState.UNINSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALL_FAILED,
+ ServiceComponentNodeLiveState.UNINSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_OP_RESTART)
- .addTransition(ServiceComponentNodeState.UNINSTALLED,
- ServiceComponentNodeState.INSTALLING,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLED,
+ ServiceComponentNodeLiveState.INSTALLING,
ServiceComponentNodeEventType.NODE_SVCCOMP_INSTALL)
- .addTransition(ServiceComponentNodeState.UNINSTALLED,
- ServiceComponentNodeState.INIT,
+ .addTransition(ServiceComponentNodeLiveState.UNINSTALLED,
+ ServiceComponentNodeLiveState.INIT,
ServiceComponentNodeEventType.NODE_SVCCOMP_WIPEOUT)
.installTopology();
- private final StateMachine<ServiceComponentNodeState,
+ private final StateMachine<ServiceComponentNodeLiveState,
ServiceComponentNodeEventType, ServiceComponentNodeEvent> stateMachine;
- public ServiceComponentNodeImpl(boolean isClient) {
+ public ServiceComponentNodeImpl(String serviceComponentName,
+ String hostName, boolean isClient) {
super();
if (isClient) {
this.stateMachine = clientStateMachineFactory.make(this);
} else {
this.stateMachine = daemonStateMachineFactory.make(this);
}
+ ReadWriteLock rwLock = new ReentrantReadWriteLock();
+ this.readLock = rwLock.readLock();
+ this.writeLock = rwLock.writeLock();
+ this.serviceComponentName = serviceComponentName;
+ this.hostName = hostName;
}
@Override
public ServiceComponentNodeState getState() {
- // TODO Auto-generated method stub
- return null;
+ try {
+ readLock.lock();
+ return state;
+ }
+ finally {
+ readLock.unlock();
+ }
}
@Override
public void setState(ServiceComponentNodeState state) {
- // TODO Auto-generated method stub
+ try {
+ writeLock.lock();
+ this.state = state;
+ stateMachine.setCurrentState(state.getLiveState());
+ }
+ finally {
+ writeLock.unlock();
+ }
}
@Override
public void handleEvent(ServiceComponentNodeEvent event)
throws InvalidStateTransitonException {
- // TODO
- stateMachine.doTransition(event.getType(), event);
- }
-
- @Override
- public ConfigVersion getConfigVersion() {
- // TODO Auto-generated method stub
- return null;
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Handling ServiceComponentNodeEvent event,"
+ + " eventType=" + event.getType().name()
+ + ", event=" + event.toString());
+ }
+ ServiceComponentNodeState oldState = getState();
+ try {
+ writeLock.lock();
+ try {
+ stateMachine.doTransition(event.getType(), event);
+ state.setState(stateMachine.getCurrentState());
+ } catch (InvalidStateTransitonException e) {
+ LOG.error("Can't handle ServiceComponentNodeEvent event at"
+ + " current state"
+ + ", serviceComponentName=" + this.getServiceComponentName()
+ + ", hostName=" + this.getNodeName()
+ + ", currentState=" + oldState
+ + ", eventType=" + event.getType()
+ + ", event=" + event);
+ throw e;
+ }
+ }
+ finally {
+ writeLock.unlock();
+ }
+ if (oldState.getLiveState() != getState().getLiveState()) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("ServiceComponentNode transitioned to a new state"
+ + ", serviceComponentName=" + this.getServiceComponentName()
+ + ", hostName=" + this.getNodeName()
+ + ", oldState=" + oldState
+ + ", currentState=" + getState()
+ + ", eventType=" + event.getType().name()
+ + ", event=" + event);
+ }
+ }
}
@Override
@@ -228,14 +291,13 @@ public class ServiceComponentNodeImpl im
@Override
public String getServiceComponentName() {
- // TODO Auto-generated method stub
- return null;
+ return serviceComponentName;
}
@Override
public String getNodeName() {
- // TODO Auto-generated method stub
- return null;
+ return hostName;
}
+
}
Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeLiveState.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeLiveState.java?rev=1384147&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeLiveState.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeLiveState.java Wed Sep 12 22:17:28 2012
@@ -0,0 +1,70 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.state.live;
+
+public enum ServiceComponentNodeLiveState {
+ /**
+ * Initial/Clean state
+ */
+ INIT,
+ /**
+ * In the process of installing.
+ */
+ INSTALLING,
+ /**
+ * Install failed
+ */
+ INSTALL_FAILED,
+ /**
+ * State when install completed successfully
+ */
+ INSTALLED,
+ /**
+ * In the process of starting.
+ */
+ STARTING,
+ /**
+ * Start failed.
+ */
+ START_FAILED,
+ /**
+ * State when start completed successfully.
+ */
+ STARTED,
+ /**
+ * In the process of stopping.
+ */
+ STOPPING,
+ /**
+ * Stop failed
+ */
+ STOP_FAILED,
+ /**
+ * In the process of uninstalling.
+ */
+ UNINSTALLING,
+ /**
+ * Uninstall failed.
+ */
+ UNINSTALL_FAILED,
+ /**
+ * State when uninstall completed successfully.
+ */
+ UNINSTALLED
+}
Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeLiveState.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeState.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeState.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeState.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/ServiceComponentNodeState.java Wed Sep 12 22:17:28 2012
@@ -18,53 +18,56 @@
package org.apache.ambari.server.state.live;
-public enum ServiceComponentNodeState {
- /**
- * Initial/Clean state
- */
- INIT,
- /**
- * In the process of installing.
- */
- INSTALLING,
- /**
- * Install failed
- */
- INSTALL_FAILED,
- /**
- * State when install completed successfully
- */
- INSTALLED,
- /**
- * In the process of starting.
- */
- STARTING,
- /**
- * Start failed.
- */
- START_FAILED,
+import org.apache.ambari.server.state.ConfigVersion;
+
+public class ServiceComponentNodeState {
+
+ private ConfigVersion configVersion;
+ private StackVersion stackVersion;
+ private ServiceComponentNodeLiveState state;
+
+ public ServiceComponentNodeState(ConfigVersion configVersion,
+ StackVersion stackVersion, ServiceComponentNodeLiveState state) {
+ super();
+ this.configVersion = configVersion;
+ this.stackVersion = stackVersion;
+ this.state = state;
+ }
+
/**
- * State when start completed successfully.
+ * @return the configVersion
*/
- STARTED,
+ public ConfigVersion getConfigVersion() {
+ return configVersion;
+ }
/**
- * In the process of stopping.
+ * @param configVersion the configVersion to set
*/
- STOPPING,
+ public void setConfigVersion(ConfigVersion configVersion) {
+ this.configVersion = configVersion;
+ }
/**
- * Stop failed
+ * @return the stackVersion
*/
- STOP_FAILED,
+ public StackVersion getStackVersion() {
+ return stackVersion;
+ }
/**
- * In the process of uninstalling.
+ * @param stackVersion the stackVersion to set
*/
- UNINSTALLING,
+ public void setStackVersion(StackVersion stackVersion) {
+ this.stackVersion = stackVersion;
+ }
/**
- * Uninstall failed.
+ * @return the state
*/
- UNINSTALL_FAILED,
+ public ServiceComponentNodeLiveState getLiveState() {
+ return state;
+ }
/**
- * State when uninstall completed successfully.
+ * @param state the state to set
*/
- UNINSTALLED
+ public void setState(ServiceComponentNodeLiveState state) {
+ this.state = state;
+ }
}
Added: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/StackVersion.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/StackVersion.java?rev=1384147&view=auto
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/StackVersion.java (added)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/StackVersion.java Wed Sep 12 22:17:28 2012
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.state.live;
+
+public class StackVersion {
+ private String stackVersion;
+
+ public StackVersion(String stackVersion) {
+ super();
+ this.stackVersion = stackVersion;
+ }
+
+ /**
+ * @return the stackVersion
+ */
+ public String getStackVersion() {
+ return stackVersion;
+ }
+
+ /**
+ * @param stackVersion the stackVersion to set
+ */
+ public void setStackVersion(String stackVersion) {
+ this.stackVersion = stackVersion;
+ }
+}
Propchange: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/StackVersion.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobCompletedEvent.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobCompletedEvent.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobCompletedEvent.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobCompletedEvent.java Wed Sep 12 22:17:28 2012
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ambari.server.state.live.job;
public class JobCompletedEvent extends JobEvent {
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobFailedEvent.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobFailedEvent.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobFailedEvent.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobFailedEvent.java Wed Sep 12 22:17:28 2012
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ambari.server.state.live.job;
public class JobFailedEvent extends JobEvent {
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobProgressUpdateEvent.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobProgressUpdateEvent.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobProgressUpdateEvent.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobProgressUpdateEvent.java Wed Sep 12 22:17:28 2012
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ambari.server.state.live.job;
public class JobProgressUpdateEvent extends JobEvent {
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobType.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobType.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobType.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/JobType.java Wed Sep 12 22:17:28 2012
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ambari.server.state.live.job;
public class JobType {
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/NewJobEvent.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/NewJobEvent.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/NewJobEvent.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/main/java/org/apache/ambari/server/state/live/job/NewJobEvent.java Wed Sep 12 22:17:28 2012
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ambari.server.state.live.job;
public class NewJobEvent extends JobEvent {
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/job/TestJobImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/job/TestJobImpl.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/job/TestJobImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/job/TestJobImpl.java Wed Sep 12 22:17:28 2012
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ambari.server.state.live.job;
import org.junit.Assert;
Modified: incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/node/TestNodeImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/node/TestNodeImpl.java?rev=1384147&r1=1384146&r2=1384147&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/node/TestNodeImpl.java (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-server/src/test/java/org/apache/ambari/server/state/live/node/TestNodeImpl.java Wed Sep 12 22:17:28 2012
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.ambari.server.state.live.node;
import static org.junit.Assert.fail;