incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r1195675 - in /incubator/ambari/trunk: client/src/main/java/org/apache/ambari/common/rest/agent/Action.java controller/src/main/java/org/apache/ambari/controller/HeartbeatHandler.java
Date Mon, 31 Oct 2011 21:17:42 GMT
Author: ddas
Date: Mon Oct 31 21:17:42 2011
New Revision: 1195675

URL: http://svn.apache.org/viewvc?rev=1195675&view=rev
Log:
AMBARI-117. Continuing with the previous commit, the Controller now sets the work directory
that the agent should use for running actions.

Modified:
    incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/Action.java
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/HeartbeatHandler.java

Modified: incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/Action.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/Action.java?rev=1195675&r1=1195674&r2=1195675&view=diff
==============================================================================
--- incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/Action.java
(original)
+++ incubator/ambari/trunk/client/src/main/java/org/apache/ambari/common/rest/agent/Action.java
Mon Oct 31 21:17:42 2011
@@ -52,6 +52,8 @@ public class Action {
   @XmlElement
   public long clusterDefinitionRevision;
   @XmlElement
+  public String workDirComponent;
+  @XmlElement
   public ConfigFile file;
   
   private static AtomicLong globalId = new AtomicLong();
@@ -109,6 +111,14 @@ public class Action {
     this.role = role;
   }
   
+  public void setWorkDirectoryComponent(String workDirComponent) {
+    this.workDirComponent = workDirComponent;
+  }
+  
+  public String getWorkDirectoryComponent() {
+    return workDirComponent;
+  }
+  
   public Signal getSignal() {
     return signal;
   }

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/HeartbeatHandler.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/HeartbeatHandler.java?rev=1195675&r1=1195674&r2=1195675&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/HeartbeatHandler.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/controller/HeartbeatHandler.java
Mon Oct 31 21:17:42 2011
@@ -237,7 +237,7 @@ public class HeartbeatHandler {
       Cluster cluster, String component, String role, ComponentPlugin plugin, 
       List<Action> allActions) throws IOException {
     String clusterId = clusterIdAndRev.getClusterName();
-    long clusterRev = clusterIdAndRev.getRevision();   
+    long clusterRev = clusterIdAndRev.getRevision();
     //action for creating dir structure
     Action action = new Action();
     action.setKind(Kind.CREATE_STRUCTURE_ACTION);
@@ -259,9 +259,11 @@ public class HeartbeatHandler {
         clusterRev, component, role);
   }
   
-  private void fillActionsForDependentComponents(ClusterNameAndRev clusterIdAndRev,
+  private void fillActionsForDependentComponents(
+      ClusterNameAndRev clusterIdAndRev,
       Cluster cluster, String reqdComp, 
-      List<Action> allActions) throws IOException {
+      List<Action> allActions) 
+          throws IOException {
     ComponentPlugin reqPlugin = cluster.getComponentDefinition(reqdComp);
     String[] reqdComps = reqPlugin.getRequiredComponents();
     if (reqdComps == null || reqdComps.length == 0) {
@@ -725,6 +727,9 @@ public class HeartbeatHandler {
     action.setClusterDefinitionRevision(clusterDefRev);
     action.setComponent(component);
     action.setRole(role);
+    String workDir = role.equals(component + "-client") ? 
+        (clusterId + "-client") : (clusterId + "-" + role);
+    action.setWorkDirectoryComponent(workDir);
   }
   
   private void fillDetailsAndAddAction(Action action, List<Action> allActions, 



Mime
View raw message