incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1179920 - in /incubator/ambari/trunk: ./ client/src/main/java/org/apache/ambari/common/rest/entities/agent/ controller/src/main/java/org/apache/ambari/controller/rest/agent/ controller/src/main/java/org/apache/ambari/controller/rest/resour...
Date Fri, 07 Oct 2011 01:54:11 GMT
Author: eyang
Date: Fri Oct  7 01:54:10 2011
New Revision: 1179920

URL: http://svn.apache.org/viewvc?rev=1179920&view=rev
Log:
AMBARI-44. Implemented blueprint name and revision in heartbeat. (Eric Yang)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/Action.java
    incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ActionResult.java
    incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/HeartBeat.java
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/agent/ControllerResource.java
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1179920&r1=1179919&r2=1179920&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Oct  7 01:54:10 2011
@@ -2,6 +2,30 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-44. Implemented blueprint name and revision in heartbeat. (Eric Yang)
+  
+  AMBARI-39. Bridged cluster reference gap between REST API with State machine. (Eric Yang)
+
+  AMBARI-28. Clean up html encoded javadoc. (Eric Yang) 
+
+  AMBARI-23. Renamed agent API to /agent, and public API to /rest. (Eric Yang)
+
+  AMBARI-18. Implemented special command to write configuration file. (Eric Yang)
+
+  AMBARI-17. Added idle state for agent heartbeat. (Eric Yang)
+
+  AMBARI-15. Implemented agent side of authentication hooks. (Eric Yang)
+
+  AMBARI-12. Added transition state STARTING, STOPPING. (Eric Yang)
+
+  AMBARI-11. Implemented Agent to controller heartbeat communication. (Eric Yang)
+
+  AMBARI-7. Updated Jersey to 1.9 for automating wadl generation. (Eric Yang)
+
+  AMBARI-3. Move HMS prototype code to branch 0.0. (Eric Yang)
+
+  AMBARI-2. Added heartbeat/controller response data model, and wadl configuration. (Eric
Yang)
+
   AMBARI-42. Return the latest blueprint revision if revision is not specified as query parameter.
 
   AMBARI-43. Change the API StateMachineInvoker.getStateMachineClusterInstance 

Modified: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/Action.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/Action.java?rev=1179920&r1=1179919&r2=1179920&view=diff
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/Action.java
(original)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/Action.java
Fri Oct  7 01:54:10 2011
@@ -49,6 +49,10 @@ public class Action {
   public List<Command> commands;
   @XmlElement
   public List<Command> cleanUpCommands;
+  @XmlElement
+  public String bluePrintName;
+  @XmlElement
+  public String bluePrintRevision;
   
   public Kind getKind() {
     return kind;
@@ -122,6 +126,22 @@ public class Action {
     this.cleanUpCommands = cleanUpCommands;  
   }
   
+  public String getBluePrintName() {
+    return bluePrintName;
+  }
+  
+  public void setBluePrintName(String bluePrintName) {
+    this.bluePrintName = bluePrintName;
+  }
+  
+  public String getBluePrintRevision() {
+    return bluePrintRevision;
+  }
+  
+  public void setBluePrintRevision(String bluePrintRevision) {
+    this.bluePrintRevision = bluePrintRevision;
+  }
+  
   public static enum Kind {
     RUN_ACTION, START_ACTION, STOP_ACTION, STATUS_ACTION;
     public static class KindAdaptor extends XmlAdapter<String, Kind> {

Modified: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ActionResult.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ActionResult.java?rev=1179920&r1=1179919&r2=1179920&view=diff
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ActionResult.java
(original)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ActionResult.java
Fri Oct  7 01:54:10 2011
@@ -51,6 +51,10 @@ public class ActionResult {
   private String component;
   @XmlElement
   private String role;
+  @XmlElement
+  private String bluePrintName;
+  @XmlElement
+  private String bluePrintRevision;
 
   public String getClusterId() {
     return clusterId;
@@ -108,4 +112,20 @@ public class ActionResult {
   public void setRole(String role) {
     this.role = role;
   }
+  
+  public String getBluePrintName() {
+    return bluePrintName;
+  }
+  
+  public void setBluePrintName(String bluePrintName) {
+    this.bluePrintName = bluePrintName;
+  }
+  
+  public String getBluePrintRevision() {
+    return bluePrintRevision;
+  }
+  
+  public void setBluePrintRevision(String bluePrintRevision) {
+    this.bluePrintRevision = bluePrintRevision;
+  }
 }

Modified: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/HeartBeat.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/HeartBeat.java?rev=1179920&r1=1179919&r2=1179920&view=diff
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/HeartBeat.java
(original)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/HeartBeat.java
Fri Oct  7 01:54:10 2011
@@ -25,9 +25,6 @@ import javax.xml.bind.annotation.XmlAcce
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-import org.apache.ambari.common.rest.entities.agent.Action.Signal;
 
 
 /**
@@ -38,7 +35,7 @@ import org.apache.ambari.common.rest.ent
 @XmlRootElement
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "", propOrder = {"responseId","timestamp", "clusterId", 
-    "hostname", "stackId", "hardwareProfile", 
+    "hostname", "bluePrintName", "bluePrintRevision", "hardwareProfile", 
     "actionResults", "serversStatus", "idle"})
 public class HeartBeat {
   @XmlElement
@@ -50,7 +47,9 @@ public class HeartBeat {
   @XmlElement
   private String hostname;
   @XmlElement
-  private String stackId;
+  private String bluePrintName;
+  @XmlElement
+  private String bluePrintRevision;
   @XmlElement
   private HardwareProfile hardwareProfile;
   @XmlElement
@@ -80,10 +79,14 @@ public class HeartBeat {
     return hostname;
   }
   
-  public String getStackId() {
-    return stackId;
+  public String getBluePrintName() {
+    return bluePrintName;
   }
   
+  public String getBluePrintRevision() {
+    return bluePrintRevision;
+  }
+    
   public boolean getIdle() {
     return idle;
   }
@@ -112,8 +115,12 @@ public class HeartBeat {
     this.hostname = hostname;
   }
   
-  public void setStackId(String stackId) {
-    this.stackId = stackId;
+  public void setBluePrintName(String bluePrintName) {
+    this.bluePrintName = bluePrintName;
+  }
+  
+  public void setBluePrintRevision(String bluePrintRevision) {
+    this.bluePrintRevision = bluePrintRevision;    
   }
   
   public void setActionResults(List<ActionResult> actionResults) {

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/agent/ControllerResource.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/agent/ControllerResource.java?rev=1179920&r1=1179919&r2=1179920&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/agent/ControllerResource.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/agent/ControllerResource.java
Fri Oct  7 01:54:10 2011
@@ -137,11 +137,15 @@ public class ControllerResource {
       List<CommandResult> cleanUpResults = new ArrayList<CommandResult>();
       cleanUpResults.add(new CommandResult(0, "stdout", "stderr"));
       ActionResult actionResult = new ActionResult();
+      actionResult.setBluePrintName("blueprint");
+      actionResult.setBluePrintRevision("0.2");
       actionResult.setId("action-001");
       actionResult.setClusterId("cluster-001");
       actionResult.setKind(Kind.STOP_ACTION);
 
       ActionResult actionResult2 = new ActionResult();
+      actionResult2.setBluePrintName("blueprint");
+      actionResult2.setBluePrintRevision("0.2");
       actionResult2.setClusterId("cluster-002");
       actionResult2.setCommandResults(commandResults);
       actionResult2.setCleanUpResults(cleanUpResults);
@@ -165,7 +169,8 @@ public class ControllerResource {
       hb.setClusterId("cluster-123");
       hb.setTimestamp(System.currentTimeMillis());
       hb.setHostname(addr.getHostName());
-      hb.setStackId(stackId);
+      hb.setBluePrintName("blueprint");
+      hb.setBluePrintRevision("0.1");
       hb.setActionResults(actionResults);
       hb.setHardwareProfile(hp);
       List<ServerStatus> serversStatus = new ArrayList<ServerStatus>();
@@ -184,6 +189,7 @@ public class ControllerResource {
   /**
    * Sample controller to agent response message
    * 
+   * @response.representation.200.example { "a" : "b" }
    * @response.representation.200.doc Print an example of Controller Response to Agent
    * @response.representation.200.mediaType application/json
    * @return ControllerResponse A list of command to execute on agent
@@ -204,6 +210,8 @@ public class ControllerResource {
     cleanUps.add(new Command("hdfs", cleanUpCmd));
     
     Action action = new Action();
+    action.setBluePrintName("blueprint");
+    action.setBluePrintRevision("0.1");
     action.setUser("hdfs");
     action.setComponent("hdfs");
     action.setRole("datanode");
@@ -213,6 +221,8 @@ public class ControllerResource {
     action.setId("action-001");
 
     Action action2 = new Action();
+    action2.setBluePrintName("blueprint");
+    action2.setBluePrintRevision("0.1");
     action2.setUser("hdfs");
     action2.setKind(Kind.START_ACTION);
     action2.setId("action-002");
@@ -223,6 +233,8 @@ public class ControllerResource {
     action2.setRole("datanode");
     
     Action action3 = new Action();
+    action3.setBluePrintName("blueprint");
+    action3.setBluePrintRevision("0.1");
     action3.setUser("hdfs");
     action3.setKind(Kind.RUN_ACTION);
     action3.setId("action-003");

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java?rev=1179920&r1=1179919&r2=1179920&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ClusterResource.java
Fri Oct  7 01:54:10 2011
@@ -76,7 +76,6 @@ public class ClusterResource {
     /** 
      * Update cluster definition.
      * 
-     * @request.representation.example { 'abc' : 'abc' }
      * @response.representation.200.doc Returns cluster definition.
      * 
      * @param   clusterName             Name of the cluster; Each cluster is identified w/
unique name



Mime
View raw message