hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1103290 - in /hadoop/mapreduce/branches/MR-279: ./ mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/ mr-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapre...
Date Sun, 15 May 2011 07:53:24 GMT
Author: mahadev
Date: Sun May 15 07:53:23 2011
New Revision: 1103290

URL: http://svn.apache.org/viewvc?rev=1103290&view=rev
Log:
Fix for clearing container requests on an AM failure and add tostring methods to taskids and
taskattemptids for better grep support. (mahadev)

Modified:
    hadoop/mapreduce/branches/MR-279/CHANGES.txt
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java
    hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java
    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-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerIdPBImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Application.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/NodeManagerImpl.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/YarnScheduler.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMLaunchFailure.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRMRPCResponseId.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRestart.java
    hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestSchedulerNegotiator.java

Modified: hadoop/mapreduce/branches/MR-279/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/CHANGES.txt?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/CHANGES.txt (original)
+++ hadoop/mapreduce/branches/MR-279/CHANGES.txt Sun May 15 07:53:23 2011
@@ -3,6 +3,8 @@ Hadoop MapReduce Change Log
 Trunk (unreleased changes)
 
   MAPREDUCE-279
+    Fix for clearing container requests on an AM failure and add tostring methods
+    to taskids and taskattemptids for better grep support. (mahadev)
    
     Support fail-fast for MR jobs. (ddas)
    

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java
Sun May 15 07:53:23 2011
@@ -1,8 +1,11 @@
 package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
 
 
+import java.text.NumberFormat;
+
 import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId;
 import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskType;
 import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptIdProto;
 import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptIdProtoOrBuilder;
 import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskIdProto;
@@ -16,6 +19,17 @@ public class TaskAttemptIdPBImpl extends
   boolean viaProto = false;
   
   private TaskId taskId = null;
+  protected static final NumberFormat idFormat = NumberFormat.getInstance();
+  static {
+    idFormat.setGroupingUsed(false);
+    idFormat.setMinimumIntegerDigits(6);
+  }
+  
+  protected static final NumberFormat jobidFormat = NumberFormat.getInstance();
+  static {
+    jobidFormat.setGroupingUsed(false);
+    jobidFormat.setMinimumIntegerDigits(4);
+  }
   
   
   public TaskAttemptIdPBImpl() {
@@ -95,4 +109,16 @@ public class TaskAttemptIdPBImpl extends
   private TaskIdProto convertToProtoFormat(TaskId t) {
     return ((TaskIdPBImpl)t).getProto();
   }
+  
+  @Override
+  public String toString() {
+    String identifier = (getTaskId() == null) ? "none":
+      getTaskId().getJobId().getAppId().getClusterTimestamp() + "_" +
+      jobidFormat.format(getTaskId().getJobId().getAppId().getId()) + "_" +
+      ((getTaskId().getTaskType() == TaskType.MAP) ? "m" : "r") + "_" +
+      idFormat.format(getTaskId().getId()) + "_" +
+       getId();
+      
+    return "attempt_" + identifier;
+  }
 }  

Modified: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java
(original)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java
Sun May 15 07:53:23 2011
@@ -1,6 +1,8 @@
 package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
 
 
+import java.text.NumberFormat;
+
 import org.apache.hadoop.mapreduce.v2.api.records.JobId;
 import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
 import org.apache.hadoop.mapreduce.v2.api.records.TaskType;
@@ -17,6 +19,18 @@ public class TaskIdPBImpl extends ProtoB
   TaskIdProto proto = TaskIdProto.getDefaultInstance();
   TaskIdProto.Builder builder = null;
   boolean viaProto = false;
+  protected static final NumberFormat idFormat = NumberFormat.getInstance();
+  static {
+    idFormat.setGroupingUsed(false);
+    idFormat.setMinimumIntegerDigits(6);
+  }
+  
+  protected static final NumberFormat jobidFormat = NumberFormat.getInstance();
+  static {
+    jobidFormat.setGroupingUsed(false);
+    jobidFormat.setMinimumIntegerDigits(4);
+  }
+  
   
   private JobId jobId = null;
   
@@ -125,4 +139,13 @@ public class TaskIdPBImpl extends ProtoB
     return MRProtoUtils.convertFromProtoFormat(e);
   }
 
+  
+  @Override
+  public String toString() {
+    String jobIdentifier =  (jobId == null) ? "none":
+      jobId.getAppId().getClusterTimestamp() + "_" + 
+      jobidFormat.format(jobId.getAppId().getId()) + "_" + 
+      ((getTaskType() == TaskType.MAP) ? "m":"r") + "_" + idFormat.format(getId());
+    return "task_" + jobIdentifier;
+  }
 }  

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=1103290&r1=1103289&r2=1103290&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
Sun May 15 07:53:23 2011
@@ -322,7 +322,7 @@ public class YARNRunner implements Clien
     Vector<CharSequence> vargs = new Vector<CharSequence>(8);
     vargs.add(javaHome + "/bin/java");
     vargs.add(conf.get(YARNApplicationConstants.MR_APPMASTER_COMMAND_OPTS,
-        "-Dhadoop.root.logger=DEBUG,console -Xmx1024m"));
+        "-Dhadoop.root.logger=INFO,console -Xmx1024m"));
 
     // Add { job jar, MR app jar } to classpath.
     Map<String, String> environment = new HashMap<String, String>();

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerIdPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerIdPBImpl.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerIdPBImpl.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/ContainerIdPBImpl.java
Sun May 15 07:53:23 2011
@@ -1,6 +1,8 @@
 package org.apache.hadoop.yarn.api.records.impl.pb;
 
 
+import java.text.NumberFormat;
+
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.ProtoBase;
@@ -16,6 +18,18 @@ public class ContainerIdPBImpl extends P
   boolean viaProto = false;
   
   private ApplicationId applicationId = null;
+  protected static final NumberFormat idFormat = NumberFormat.getInstance();
+  static {
+    idFormat.setGroupingUsed(false);
+    idFormat.setMinimumIntegerDigits(4);
+  }
+  
+  protected static final NumberFormat counterFormat = NumberFormat.getInstance();
+  static {
+    counterFormat.setGroupingUsed(false);
+    counterFormat.setMinimumIntegerDigits(6);
+  }
+  
   
   public ContainerIdPBImpl() {
     builder = ContainerIdProto.newBuilder();
@@ -117,5 +131,11 @@ public class ContainerIdPBImpl extends P
     }
     
   }
-
+  
+  @Override
+  public String toString() {
+    String id = (this.getAppId() != null) ? this.getAppId().getClusterTimestamp() + "_" +
+        idFormat.format(this.getAppId().getId()): "none";
+    return "containerid_" + id + "_" + counterFormat.format(getId());
+  }
 }  

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Application.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/scheduler/Application.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Application.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Application.java
Sun May 15 07:53:23 2011
@@ -135,6 +135,13 @@ public class Application {
   }
 
   /**
+   * Clear any pending requests from this application.
+   */
+  public synchronized void clearRequests() {
+    requests.clear();
+  }
+  
+  /**
    * the currently acquired/allocated containers  by the application masters.
    * @return the current containers being used by the application masters.
    */

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/NodeManagerImpl.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/scheduler/NodeManagerImpl.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/NodeManagerImpl.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/NodeManagerImpl.java
Sun May 15 07:53:23 2011
@@ -71,11 +71,7 @@ public class NodeManagerImpl implements 
   
   public static final String ANY = "*";  
   /* set of containers that are allocated containers */
-  private final Map<ContainerId, Container> allocatedContainers = 
-    new TreeMap<ContainerId, Container>();
-    
-  /* set of containers that are currently active on a node manager */
-  private final Map<ContainerId, Container> activeContainers =
+  private final Map<ContainerId, Container> runningContainers = 
     new TreeMap<ContainerId, Container>();
   
   /* set of containers that need to be cleaned */
@@ -165,14 +161,9 @@ public class NodeManagerImpl implements 
     List<ApplicationId> lastfinishedApplications = new ArrayList<ApplicationId>();
     
     for (Container container : containers) {
-      if (allocatedContainers.remove(container.getId()) != null) {
-        activeContainers.put(container.getId(), container);
-        LOG.info("Activated container " + container.getId() + " on node " + 
-         getNodeAddress());
-      }
-
+    
       if (container.getState() == ContainerState.COMPLETE) {
-        if (activeContainers.remove(container.getId()) != null) {
+        if (runningContainers.remove(container.getId()) != null) {
           updateResource(container);
           LOG.info("Completed container " + container);
         }
@@ -181,8 +172,7 @@ public class NodeManagerImpl implements 
             getNodeAddress());
       }
       else if (container.getState() != ContainerState.COMPLETE && 
-          (!allocatedContainers.containsKey(container.getId())) && 
-          !activeContainers.containsKey(container.getId())) {
+          (!runningContainers.containsKey(container.getId()))) {
         containersToCleanUp.add(container);
       }
     }
@@ -199,7 +189,7 @@ public class NodeManagerImpl implements 
     deductAvailableResource(container.getResource());
     ++numContainers;
     
-    allocatedContainers.put(container.getId(), container);
+    runningContainers.put(container.getId(), container);
     LOG.info("Allocated container " + container.getId() + 
         " to node " + getNodeAddress());
     
@@ -211,7 +201,7 @@ public class NodeManagerImpl implements 
   }
 
   private synchronized boolean isValidContainer(Container c) {    
-    if (activeContainers.containsKey(c.getId()) || allocatedContainers.containsKey(c.getId()))
+    if (runningContainers.containsKey(c.getId()))
       return true;
     return false;
   }
@@ -236,8 +226,7 @@ public class NodeManagerImpl implements 
     /* remove the containers from the nodemanger */
     
     // Was this container launched?
-    activeContainers.remove(container.getId());
-    allocatedContainers.remove(container.getId());
+    runningContainers.remove(container.getId());
     containersToClean.add(container);
     updateResource(container);
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/YarnScheduler.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/scheduler/YarnScheduler.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/YarnScheduler.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/YarnScheduler.java
Sun May 15 07:53:23 2011
@@ -68,7 +68,7 @@ public interface YarnScheduler {
    * @param finishApplication true if the application is completed and the
    * scheduler needs to notify other components of application completion.
    */
-  public void removeApplication(ApplicationId applicationId, boolean finishApplication)
+  public void doneApplication(ApplicationId applicationId, boolean finishApplication)
   throws IOException;
 
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.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/scheduler/capacity/CapacityScheduler.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
Sun May 15 07:53:23 2011
@@ -261,7 +261,7 @@ implements ResourceScheduler, CapacitySc
   }
 
   @Override
-  public void removeApplication(ApplicationId applicationId, boolean finishApplication)
+  public void doneApplication(ApplicationId applicationId, boolean finishApplication)
   throws IOException {
     Application application = getApplication(applicationId);
 
@@ -271,16 +271,18 @@ implements ResourceScheduler, CapacitySc
       LOG.info("Unknown application " + applicationId + " has completed!");
       return;
     }
-
-    // Inform the queue
-    Queue queue = queues.get(application.getQueue().getQueueName());
-    LOG.info("DEBUG --- removeApplication - appId: " + applicationId + " queue: " + queue);
-    queue.finishApplication(application, queue.getQueueName());
-
-    // Release containers and update queue capacities
+    /*
+     * release all the containes and make sure we clean up the pending 
+     * requests for this application
+     */
     processReleasedContainers(application, application.getCurrentContainers());
+    application.clearRequests();
+    /** The application can be retried. So only remove it from scheduler data
+     * structures if the finishapplication flag is set.
+     */
     if (finishApplication) {
-      // Inform all NodeManagers about completion of application
+      Queue queue = queues.get(application.getQueue().getQueueName());
+      queue.finishApplication(application, queue.getQueueName());
       finishedApplication(applicationId, 
           application.getAllNodesForApplication());
       // Remove from our data-structure
@@ -472,7 +474,7 @@ implements ResourceScheduler, CapacitySc
       break;
     case REMOVE:
       try {
-        removeApplication(event.getAppContext().getApplicationID(), true);
+        doneApplication(event.getAppContext().getApplicationID(), true);
       } catch(IOException ie) {
         LOG.error("Error in removing application", ie);
         //TODO have to be shutdown the RM in case of this.
@@ -484,7 +486,7 @@ implements ResourceScheduler, CapacitySc
         /** do not remove the application. Just do everything else exception 
          * removing the application
          */
-        removeApplication(event.getAppContext().getApplicationID(), false);
+        doneApplication(event.getAppContext().getApplicationID(), false);
       } catch(IOException ie) {
         LOG.error("Error in removing application", ie);
         //TODO have to be shutdown the RM in case of this.

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.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/scheduler/fifo/FifoScheduler.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
Sun May 15 07:53:23 2011
@@ -240,7 +240,7 @@ public class FifoScheduler implements Re
   }
 
   @Override
-  public synchronized void removeApplication(ApplicationId applicationId, boolean finishApplication)
+  public synchronized void doneApplication(ApplicationId applicationId, boolean finishApplication)
   throws IOException {
     Application application = getApplication(applicationId);
     if (application == null) {
@@ -250,11 +250,11 @@ public class FifoScheduler implements Re
 
     // Release current containers
     releaseContainers(application, application.getCurrentContainers());
-
+    application.clearRequests();
     // Update metrics
-    metrics.finishApp(application);
-    application.finish();
     if (finishApplication) {
+      metrics.finishApp(application);
+      application.finish();
       // Let the cluster know that the applications are done
       finishedApplication(applicationId, 
           application.getAllNodesForApplication());
@@ -525,14 +525,14 @@ public class FifoScheduler implements Re
       break;
     case REMOVE:
       try {
-        removeApplication(event.getAppContext().getApplicationID(), true);
+        doneApplication(event.getAppContext().getApplicationID(), true);
       } catch(IOException ie) {
         LOG.error("Unable to remove application " + event.getAppContext().getApplicationID(),
ie);
       }
       break;  
     case EXPIRE:
       try {
-        removeApplication(event.getAppContext().getApplicationID(), false);
+        doneApplication(event.getAppContext().getApplicationID(), false);
       } catch(IOException ie) {
         LOG.error("Unable to remove application " + event.getAppContext().getApplicationID(),
ie);
       }
@@ -585,7 +585,8 @@ public class FifoScheduler implements Re
   public synchronized void releaseContainer(ApplicationId applicationId, 
       Container container) {
     // Reap containers
-    LOG.info("Application " + applicationId + " released container " + container);
+    LOG.info("Application " + applicationId + " released container " +
+        container.getId());
     clusterTracker.releaseContainer(container);
   }
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMLaunchFailure.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMLaunchFailure.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMLaunchFailure.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMLaunchFailure.java
Sun May 15 07:53:23 2011
@@ -77,7 +77,7 @@ public class TestAMLaunchFailure extends
     }
 
     @Override
-    public void removeApplication(ApplicationId applicationId, boolean finishApplication)
+    public void doneApplication(ApplicationId applicationId, boolean finishApplication)
         throws IOException {
     }
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRMRPCResponseId.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRMRPCResponseId.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRMRPCResponseId.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRMRPCResponseId.java
Sun May 15 07:53:23 2011
@@ -87,7 +87,7 @@ public class TestAMRMRPCResponseId exten
     }
 
     @Override
-    public void removeApplication(ApplicationId applicationId, boolean finishApplication)
+    public void doneApplication(ApplicationId applicationId, boolean finishApplication)
         throws IOException {
     }
 

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRestart.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRestart.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRestart.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestAMRestart.java
Sun May 15 07:53:23 2011
@@ -175,7 +175,7 @@ public class TestAMRestart extends TestC
     }
 
     @Override
-    public void removeApplication(ApplicationId applicationId, boolean finishApplication)
+    public void doneApplication(ApplicationId applicationId, boolean finishApplication)
         throws IOException {
     }
     @Override

Modified: hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestSchedulerNegotiator.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestSchedulerNegotiator.java?rev=1103290&r1=1103289&r2=1103290&view=diff
==============================================================================
--- hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestSchedulerNegotiator.java
(original)
+++ hadoop/mapreduce/branches/MR-279/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/applicationsmanager/TestSchedulerNegotiator.java
Sun May 15 07:53:23 2011
@@ -98,7 +98,7 @@ public class TestSchedulerNegotiator ext
     }
    
     @Override
-    public void removeApplication(ApplicationId applicationId, boolean finishApplication)
+    public void doneApplication(ApplicationId applicationId, boolean finishApplication)
         throws IOException {
     }
     @Override



Mime
View raw message