hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1092834 - in /hadoop/mapreduce/branches/MR-279: ./ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/ mr-client/hadoop-mapreduce-client-hs/ mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/...
Date Fri, 15 Apr 2011 22:26:52 GMT
Author: mahadev
Date: Fri Apr 15 22:26:51 2011
New Revision: 1092834

URL: http://svn.apache.org/viewvc?rev=1092834&view=rev
Log:
Add fail count to the command line of the application master. (mahadev)

Modified:
    hadoop/mapreduce/branches/MR-279/CHANGES.txt
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/pom.xml
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/AMLauncher.java

Modified: hadoop/mapreduce/branches/MR-279/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/CHANGES.txt?rev=1092834&r1=1092833&r2=1092834&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/MR-279/CHANGES.txt Fri Apr 15 22:26:51 2011
@@ -21,6 +21,8 @@ Trunk (unreleased changes)
 
     MAPREDUCE-2424. Polish uber-AppMaster: add uber-AM counters and GUI
     indicators.  (Greg Roelofs via mahadev)
+   
+    Add fail count to the command line of the application master. (mahadev)
 
   
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java?rev=1092834&r1=1092833&r2=1092834&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/MRAppMaster.java
Fri Apr 15 22:26:51 2011
@@ -117,11 +117,17 @@ public class MRAppMaster extends Composi
       new JobTokenSecretManager();
 
   private Job job;
-
+  private int failCount = 0;
+  
   public MRAppMaster(ApplicationId applicationId) {
     this(applicationId, new SystemClock());
   }
-
+  
+  public MRAppMaster(ApplicationId applicationId, int failCount) {
+    this(applicationId);
+    this.failCount = failCount;
+  }
+  
   public MRAppMaster(ApplicationId applicationId, Clock clock) {
     super(MRAppMaster.class.getName());
     this.clock = clock;
@@ -496,7 +502,8 @@ public class MRAppMaster extends Composi
       
       applicationId.setClusterTimestamp(Long.valueOf(args[0]));
       applicationId.setId(Integer.valueOf(args[1]));
-      MRAppMaster appMaster = new MRAppMaster(applicationId);
+      int failCount = Integer.valueOf(args[2]);
+      MRAppMaster appMaster = new MRAppMaster(applicationId, failCount);
       YarnConfiguration conf = new YarnConfiguration(new JobConf());
       conf.addResource(new Path(YARNApplicationConstants.JOB_CONF_FILE));
       conf.set(MRJobConfig.USER_NAME, 

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/pom.xml
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/pom.xml?rev=1092834&r1=1092833&r2=1092834&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/pom.xml (original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-hs/pom.xml Fri Apr
15 22:26:51 2011
@@ -32,5 +32,15 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <excludes>
+          </excludes>
+        </configuration>
+      </plugin>
+    </plugins>
+   </build>
 </project>

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java?rev=1092834&r1=1092833&r2=1092834&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java
Fri Apr 15 22:26:51 2011
@@ -335,6 +335,7 @@ public class YARNRunner implements Clien
     vargs.add("org.apache.hadoop.mapreduce.v2.app.MRAppMaster");
     vargs.add(String.valueOf(applicationId.getClusterTimestamp()));
     vargs.add(String.valueOf(applicationId.getId()));
+    vargs.add(YarnConfiguration.AM_FAIL_COUNT_STRING);
     vargs.add("1>logs/stdout");
     vargs.add("2>logs/stderr");
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java?rev=1092834&r1=1092833&r2=1092834&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-common/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
Fri Apr 15 22:26:51 2011
@@ -25,6 +25,8 @@ public class YarnConfiguration extends C
 
   public static final String RM_PREFIX = "yarn.server.resourcemanager.";
   
+  public static final String AM_FAIL_COUNT_STRING = "<FAILCOUNT>";
+  
   public static final String SCHEDULER_ADDRESS = RM_PREFIX
       + "scheduler.address";    
   

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/AMLauncher.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/AMLauncher.java?rev=1092834&r1=1092833&r2=1092834&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/AMLauncher.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/AMLauncher.java
Fri Apr 15 22:26:51 2011
@@ -22,7 +22,9 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 import java.security.PrivilegedAction;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.crypto.SecretKey;
@@ -169,9 +171,17 @@ public class AMLauncher implements Runna
     ContainerLaunchContext container = recordFactory.newRecordInstance(ContainerLaunchContext.class);
     container.addAllCommands(applicationMasterContext.getCommandList());
     StringBuilder mergedCommand = new StringBuilder();
+    String failCount = Integer.toString(master.getFailedCount());
+    List<String> commandList = new ArrayList<String>();
     for (String str : container.getCommandList()) {
-      mergedCommand.append(str).append(" ");
+      String result = str.replaceFirst(YarnConfiguration.AM_FAIL_COUNT_STRING, failCount);
+      mergedCommand.append(result).append(" ");
+      commandList.add(result);
     }
+    container.clearCommands();
+    container.addAllCommands(commandList);
+    /** add the failed count to the app master command line */
+   
     LOG.info("Command to launch container " + 
         containerID + " : " + mergedCommand);
     container.addAllEnv(applicationMasterContext.getAllEnvironment());



Mime
View raw message