incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r1190102 - in /incubator/ambari/trunk: CHANGES.txt controller/src/main/java/org/apache/ambari/components/impl/XmlComponentDefinition.java
Date Fri, 28 Oct 2011 00:26:47 GMT
Author: ddas
Date: Fri Oct 28 00:26:46 2011
New Revision: 1190102

URL: http://svn.apache.org/viewvc?rev=1190102&view=rev
Log:
AMBARI-114. Fix issues in XMLComponentDefinition.

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/impl/XmlComponentDefinition.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1190102&r1=1190101&r2=1190102&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Oct 28 00:26:46 2011
@@ -2,6 +2,8 @@ Ambari Change log
 
 Release 0.1.0 - unreleased
 
+  AMBARI-114. Fix issues in XMLComponentDefinition (ddas)
+
   AMBARI-112. Fixes the blueprint/stack resolution in the Cluster class
   (ddas)
 

Modified: incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/impl/XmlComponentDefinition.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/impl/XmlComponentDefinition.java?rev=1190102&r1=1190101&r2=1190102&view=diff
==============================================================================
--- incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/impl/XmlComponentDefinition.java
(original)
+++ incubator/ambari/trunk/controller/src/main/java/org/apache/ambari/components/impl/XmlComponentDefinition.java
Fri Oct 28 00:26:46 2011
@@ -26,7 +26,7 @@ public class XmlComponentDefinition exte
   @XmlType(name = "component", propOrder = {
       "requires",
       "roles",
-      "preinstall",
+      "prestart",
       "install",
       "configure",
       "start",
@@ -44,7 +44,7 @@ public class XmlComponentDefinition exte
     @XmlElement Configure configure;
     @XmlElement Start start;
     @XmlElement Check check;
-    @XmlElement Preinstall preinstall;
+    @XmlElement Prestart prestart;
     @XmlElement Uninstall uninstall;
   }
   
@@ -87,9 +87,9 @@ public class XmlComponentDefinition exte
   }
   
   @XmlAccessorType(XmlAccessType.FIELD)
-  @XmlType(name = "preinstall")
-  public static class Preinstall extends ScriptCommand {
-    @XmlAttribute String runPreinstallOn;
+  @XmlType(name = "prestart")
+  public static class Prestart extends ScriptCommand {
+    @XmlAttribute String runPrestartOn;
   }
   
   @XmlAccessorType(XmlAccessType.FIELD)
@@ -119,9 +119,9 @@ public class XmlComponentDefinition exte
   private final String uninstallCommand;
   private final String uninstallUser;
   private final String checkRole;
-  private final String preinstallRole;
-  private final String preinstallCommand;
-  private final String preinstallUser;
+  private final String prestartRole;
+  private final String prestartCommand;
+  private final String prestartUser;
   private final String checkCommand;
   private final String checkUser;
   
@@ -200,17 +200,17 @@ public class XmlComponentDefinition exte
   
   @Override
   public String runPreStartRole() throws IOException {
-    return preinstallRole;
+    return prestartRole;
   }
 
   @Override
   public Action preStartAction(String cluster, String role) throws IOException {
-    if (preinstallCommand == null) {
+    if (prestartCommand == null) {
       return null;
     }
     Action result = new Action();
     result.kind = Action.Kind.RUN_ACTION;
-    result.command = new Command(preinstallUser, preinstallCommand, 
+    result.command = new Command(prestartUser, prestartCommand, 
                                  new String[]{cluster, role});
     return result; 
   }
@@ -256,7 +256,7 @@ public class XmlComponentDefinition exte
       } else {
         dependencies = new String[component.requires.size()];
         for(Requires r: component.requires) {
-          dependencies[i] = r.name;
+          dependencies[i++] = r.name;
         }
       }
       i = 0;
@@ -265,7 +265,7 @@ public class XmlComponentDefinition exte
       } else {
         roles = new String[component.roles.size()];
         for(Role r: component.roles) {
-          roles[i] = r.name;
+          roles[i++] = r.name;
         }      
       }
       installCommand = getCommand(component.install);
@@ -276,17 +276,17 @@ public class XmlComponentDefinition exte
       startUser = getUser(component.start, component.user);
       checkCommand = getCommand(component.check);
       checkUser = getUser(component.check, component.user);
-      preinstallCommand = getCommand(component.preinstall);
-      preinstallUser = getUser(component.preinstall, component.user);
+      prestartCommand = getCommand(component.prestart);
+      prestartUser = getUser(component.prestart, component.user);
       if (component.check != null) {
         checkRole = component.check.runOn;
       } else {
         checkRole = null;
       }
-      if (component.preinstall != null) {
-        preinstallRole = component.preinstall.runPreinstallOn;
+      if (component.prestart != null) {
+        prestartRole = component.prestart.runPrestartOn;
       } else {
-        preinstallRole = null;
+        prestartRole = null;
       }
       uninstallCommand = getCommand(component.uninstall);
       uninstallUser = getUser(component.uninstall, component.user);



Mime
View raw message