incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r1177147 - in /incubator/ambari/trunk: client/src/main/java/org/apache/ambari/common/rest/entities/agent/ controller/src/main/java/org/apache/ambari/controller/rest/resources/
Date Thu, 29 Sep 2011 01:32:15 GMT
Author: eyang
Date: Thu Sep 29 01:32:14 2011
New Revision: 1177147

URL: http://svn.apache.org/viewvc?rev=1177147&view=rev
Log:
AMBARI-11. Added component field for Action, and ActionResult.

Modified:
    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/ServerStatus.java
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ControllerResource.java

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=1177147&r1=1177146&r2=1177147&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
Thu Sep 29 01:32:14 2011
@@ -40,6 +40,8 @@ public class Action {
   @XmlElement
   public String id;
   @XmlElement
+  public String component;
+  @XmlElement
   public String serverName;
   @XmlElement
   public Signal signal;
@@ -80,10 +82,18 @@ public class Action {
     this.id = id;
   }
   
+  public String getComponent() {
+    return component;
+  }
+  
   public String getServerName() {
     return serverName;
   }
   
+  public void setComponent(String component) {
+    this.component = component;
+  }
+  
   public void setServerName(String serverName) {
     this.serverName = serverName;
   }

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=1177147&r1=1177146&r2=1177147&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
Thu Sep 29 01:32:14 2011
@@ -48,6 +48,8 @@ public class ActionResult {
   @XmlElement
   private List<CommandResult> cleanUpCommandResults;
   @XmlElement
+  private String component;
+  @XmlElement
   private String serverName;
 
   public String getClusterId() {
@@ -91,10 +93,18 @@ public class ActionResult {
     
   }
   
+  public String getComponent() {
+    return this.component;
+  }
+  
   public String getServerName() {
     return serverName;
   }
   
+  public void setComponent(String component) {
+    this.component = component;
+  }
+  
   public void setServerName(String serverName) {
     this.serverName = serverName;
   }

Modified: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ServerStatus.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ServerStatus.java?rev=1177147&r1=1177146&r2=1177147&view=diff
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ServerStatus.java
(original)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/entities/agent/ServerStatus.java
Thu Sep 29 01:32:14 2011
@@ -28,17 +28,27 @@ import javax.xml.bind.annotation.adapter
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "", propOrder = {})
 public class ServerStatus {
+  public String component;
   public String serverName;
   public State state;
   
   public ServerStatus() {  
   }
   
-  public ServerStatus(String serverName, State state) {
+  public ServerStatus(String component, String serverName, State state) {
+    this.component = component;
     this.serverName = serverName;
     this.state = state;
   }
 
+  public String getComponent() {
+    return this.component;
+  }
+
+  public void setComponent(String component) {
+    this.component = component;  
+  }
+  
   public String getServerName() {
     return serverName;
   }

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ControllerResource.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ControllerResource.java?rev=1177147&r1=1177146&r2=1177147&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ControllerResource.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/rest/resources/ControllerResource.java
Thu Sep 29 01:32:14 2011
@@ -82,7 +82,8 @@ public class ControllerResource {
     
     Action action = new Action();
     action.setUser("hdfs");
-    action.setServerName("hadoop.datanode");
+    action.setComponent("hdfs");
+    action.setServerName("datanode");
     action.setKind(Kind.STOP_ACTION);
     action.setSignal(Signal.KILL);
     action.setClusterId("cluster-001");
@@ -95,7 +96,8 @@ public class ControllerResource {
     action2.setClusterId("cluster-002");
     action2.setCommands(commands);
     action2.setCleanUpCommands(cleanUps);
-    action2.setServerName("hadoop.datanode");
+    action2.setComponent("hdfs");
+    action2.setServerName("datanode");
 
     Action action3 = new Action();
     action3.setUser("hdfs");
@@ -144,7 +146,8 @@ public class ControllerResource {
       actionResult2.setCommandResults(commandResults);
       actionResult2.setCleanUpResults(cleanUpResults);
       actionResult2.setKind(Kind.START_ACTION);
-      actionResult2.setServerName("hadoop.datanode");
+      actionResult2.setComponent("hadoop");
+      actionResult2.setServerName("datanode");
 
       actionResults.add(actionResult);
       actionResults.add(actionResult2);
@@ -166,9 +169,9 @@ public class ControllerResource {
       hb.setActionResults(actionResults);
       hb.setHardwareProfile(hp);
       List<ServerStatus> serversStatus = new ArrayList<ServerStatus>();
-      serversStatus.add(new ServerStatus("hadoop.datanode", 
+      serversStatus.add(new ServerStatus("hdfs","datanode", 
           ServerStatus.State.STARTED));
-      serversStatus.add(new ServerStatus("hadoop.tasktracker", 
+      serversStatus.add(new ServerStatus("hdfs","tasktracker", 
           ServerStatus.State.STARTED));
       hb.setServersStatus(serversStatus);
       hb.setIdle(false);
@@ -202,7 +205,8 @@ public class ControllerResource {
     
     Action action = new Action();
     action.setUser("hdfs");
-    action.setServerName("hadoop.datanode");
+    action.setComponent("hdfs");
+    action.setServerName("datanode");
     action.setKind(Kind.STOP_ACTION);
     action.setSignal(Signal.KILL);
     action.setClusterId("cluster-001");
@@ -215,7 +219,8 @@ public class ControllerResource {
     action2.setClusterId("cluster-002");
     action2.setCommands(commands);
     action2.setCleanUpCommands(cleanUps);
-    action2.setServerName("hadoop.datanode");
+    action2.setComponent("hdfs");
+    action2.setServerName("datanode");
     
     List<Action> actions = new ArrayList<Action>();
     actions.add(action);



Mime
View raw message