hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1153436 - in /hadoop/common/branches/MR-279/mapreduce: mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/ mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/ yarn/...
Date Wed, 03 Aug 2011 11:37:55 GMT
Author: vinodkv
Date: Wed Aug  3 11:37:52 2011
New Revision: 1153436

URL: http://svn.apache.org/viewvc?rev=1153436&view=rev
Log:
Separating allocated containers from finished containers on the AM side.

Modified:
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerRequestor.java
    hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ams/ApplicationMasterService.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttempt.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptImpl.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/event/RMAppAttemptContainerFinishedEvent.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/NodeManager.java
    hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMCommunicator.java
Wed Aug  3 11:37:52 2011
@@ -51,9 +51,6 @@ import org.apache.hadoop.yarn.api.protoc
 import org.apache.hadoop.yarn.api.records.AMResponse;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
-import org.apache.hadoop.yarn.api.records.ApplicationMaster;
-import org.apache.hadoop.yarn.api.records.ApplicationState;
-import org.apache.hadoop.yarn.api.records.ApplicationStatus;
 import org.apache.hadoop.yarn.api.records.Container;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.api.records.ResourceRequest;

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java
Wed Aug  3 11:37:52 2011
@@ -51,6 +51,7 @@ import org.apache.hadoop.mapreduce.v2.ap
 import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptDiagnosticsUpdateEvent;
 import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptEvent;
 import org.apache.hadoop.mapreduce.v2.app.job.event.TaskAttemptEventType;
+import org.apache.hadoop.yarn.api.records.AMResponse;
 import org.apache.hadoop.yarn.api.records.Container;
 import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.ContainerState;
@@ -410,43 +411,43 @@ public class RMContainerAllocator extend
   
   private List<Container> getResources() throws Exception {
     int headRoom = getAvailableResources() != null ? getAvailableResources().getMemory()
: 0;//first time it would be null
-    List<Container> allContainers = makeRemoteRequest();
+    AMResponse response = makeRemoteRequest();
     int newHeadRoom = getAvailableResources() != null ? getAvailableResources().getMemory()
: 0;
-    if (allContainers.size() > 0 || headRoom != newHeadRoom) {
+    List<Container> newContainers = response.getNewContainerList();
+    List<Container> finishedContainers = response.getFinishedContainerList();
+    if (newContainers.size() + finishedContainers.size() > 0 || headRoom != newHeadRoom)
{
       //something changed
       recalculateReduceSchedule = true;
     }
     
     List<Container> allocatedContainers = new ArrayList<Container>();
-    for (Container cont : allContainers) {
-      if (cont.getState() != ContainerState.COMPLETE) {
+    for (Container cont : newContainers) {
         allocatedContainers.add(cont);
-        LOG.debug("Received Container :" + cont);
+        LOG.debug("Received new Container :" + cont);
+    }
+    for (Container cont : finishedContainers) {
+      LOG.info("Received completed container " + cont);
+      TaskAttemptId attemptID = assignedRequests.get(cont.getId());
+      if (attemptID == null) {
+        LOG.error("Container complete event for unknown container id "
+            + cont.getId());
       } else {
-        LOG.info("Received completed container " + cont);
-        TaskAttemptId attemptID = assignedRequests.get(cont.getId());
-        if (attemptID == null) {
-          LOG.error("Container complete event for unknown container id " +
-              cont.getId());
+        assignedRequests.remove(attemptID);
+        if (attemptID.getTaskId().getTaskType().equals(TaskType.MAP)) {
+          completedMaps++;
         } else {
-          assignedRequests.remove(attemptID);
-          if (attemptID.getTaskId().getTaskType().equals(TaskType.MAP)) {
-            completedMaps++;
-          } else {
-            completedReduces++;
-          }
-          //send the container completed event to Task attempt
-          eventHandler.handle(new TaskAttemptEvent(attemptID,
-              TaskAttemptEventType.TA_CONTAINER_COMPLETED));
-          // Send the diagnostics
-          String diagnostics = cont.getContainerStatus().getDiagnostics();
-          eventHandler.handle(new TaskAttemptDiagnosticsUpdateEvent(
-              attemptID, diagnostics));
+          completedReduces++;
         }
+        // send the container completed event to Task attempt
+        eventHandler.handle(new TaskAttemptEvent(attemptID,
+            TaskAttemptEventType.TA_CONTAINER_COMPLETED));
+        // Send the diagnostics
+        String diagnostics = cont.getContainerStatus().getDiagnostics();
+        eventHandler.handle(new TaskAttemptDiagnosticsUpdateEvent(attemptID,
+            diagnostics));
       }
-      LOG.debug("Received Container :" + cont);
     }
-    return allocatedContainers;
+    return newContainers;
   }
 
   private int getMemLimit() {

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerRequestor.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerRequestor.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerRequestor.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerRequestor.java
Wed Aug  3 11:37:52 2011
@@ -39,6 +39,7 @@ import org.apache.hadoop.yarn.api.protoc
 import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
 import org.apache.hadoop.yarn.api.records.AMResponse;
 import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.Priority;
 import org.apache.hadoop.yarn.api.records.Resource;
 import org.apache.hadoop.yarn.api.records.ResourceRequest;
@@ -111,7 +112,7 @@ public abstract class RMContainerRequest
 
   protected abstract void heartbeat() throws Exception;
 
-  protected List<Container> makeRemoteRequest() throws YarnRemoteException {
+  protected AMResponse makeRemoteRequest() throws YarnRemoteException {
     AllocateRequest allocateRequest = recordFactory
         .newRecordInstance(AllocateRequest.class);
     allocateRequest.setApplicationAttemptId(applicationAttemptId);
@@ -121,17 +122,17 @@ public abstract class RMContainerRequest
     AllocateResponse allocateResponse = scheduler.allocate(allocateRequest);
     AMResponse response = allocateResponse.getAMResponse();
     lastResponseID = response.getResponseId();
-    List<Container> allContainers = response.getContainerList();
     availableResources = response.getAvailableResources();
 
     LOG.info("getResources() for " + applicationId + ":" + " ask="
-        + ask.size() + " release= " + release.size() + " recieved="
-        + allContainers.size()
+        + ask.size() + " release= " + release.size() + " newContainers="
+        + response.getNewContainerCount() + " finishedContainers="
+        + response.getFinishedContainerCount()
         + " resourcelimit=" + availableResources);
 
     ask.clear();
     release.clear();
-    return allContainers;
+    return response;
   }
 
   protected void containerFailedOnHost(String hostName) {

Modified: hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/mr-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/TestRMContainerAllocator.java
Wed Aug  3 11:37:52 2011
@@ -369,7 +369,7 @@ public class TestRMContainerAllocator {
         try {
           AMResponse response = recordFactory.newRecordInstance(AMResponse.class);
           Allocation allocation = resourceScheduler.allocate(status.getApplicationId(), ask,
release);
-          response.addAllContainers(allocation.getContainers());
+          response.addAllNewContainers(allocation.getContainers());
           response.setAvailableResources(allocation.getResourceLimit());
           AllocateResponse allocateResponse = recordFactory.newRecordInstance(AllocateResponse.class);
           allocateResponse.setAMResponse(response);

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/AMResponse.java
Wed Aug  3 11:37:52 2011
@@ -24,18 +24,27 @@ public interface AMResponse {
   public boolean getReboot();
   public int getResponseId();
   
-  public List<Container> getContainerList();
-  public Container getContainer(int index);
-  public int getContainerCount();
+  public List<Container> getNewContainerList();
+  public Container getNewContainer(int index);
+  public int getNewContainerCount();
 
   public void setReboot(boolean reboot);
   public void setResponseId(int responseId);
   
-  public void addAllContainers(List<Container> containers);
-  public void addContainer(Container container);
-  public void removeContainer(int index);
-  public void clearContainers();
+  public void addAllNewContainers(List<Container> containers);
+  public void addNewContainer(Container container);
+  public void removeNewContainer(int index);
+  public void clearNewContainers();
   
   public void setAvailableResources(Resource limit);
   public Resource getAvailableResources();
+
+  public List<Container> getFinishedContainerList();
+  public Container getFinishedContainer(int index);
+  public int getFinishedContainerCount();
+  
+  public void addAllFinishedContainers(List<Container> containers);
+  public void addFinishedContainer(Container container);
+  public void removeFinishedContainer(int index);
+  public void clearFinishedContainers();
 }
\ No newline at end of file

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/java/org/apache/hadoop/yarn/api/records/impl/pb/AMResponsePBImpl.java
Wed Aug  3 11:37:52 2011
@@ -23,7 +23,8 @@ public class AMResponsePBImpl extends Pr
   
   Resource limit;
 
-  private List<Container> containerList = null;
+  private List<Container> newContainersList = null;
+  private List<Container> finishedContainersList = null;
 //  private boolean hasLocalContainerList = false;
   
   
@@ -44,8 +45,15 @@ public class AMResponsePBImpl extends Pr
   }
   
   private void mergeLocalToBuilder() {
-    if (this.containerList != null) {
-      addLocalContainersToProto();
+    if (this.newContainersList != null) {
+      builder.clearNewContainers();
+      Iterable<ContainerProto> iterable = getProtoIterable(this.newContainersList);
+      builder.addAllNewContainers(iterable);
+    }
+    if (this.finishedContainersList != null) {
+      builder.clearFinishedContainers();
+      Iterable<ContainerProto> iterable = getProtoIterable(this.finishedContainersList);
+      builder.addAllFinishedContainers(iterable);
     }
     if (this.limit != null) {
       builder.setLimit(convertToProtoFormat(this.limit));
@@ -113,55 +121,53 @@ public class AMResponsePBImpl extends Pr
   }
 
   @Override
-  public List<Container> getContainerList() {
-    initLocalContainerList();
-    return this.containerList;
+  public List<Container> getNewContainerList() {
+    initLocalNewContainerList();
+    return this.newContainersList;
   }
   
   @Override
-  public Container getContainer(int index) {
-    initLocalContainerList();
-    return this.containerList.get(index);
+  public Container getNewContainer(int index) {
+    initLocalNewContainerList();
+    return this.newContainersList.get(index);
   }
   @Override
-  public int getContainerCount() {
-    initLocalContainerList();
-    return this.containerList.size();
+  public int getNewContainerCount() {
+    initLocalNewContainerList();
+    return this.newContainersList.size();
   }
   
   //Once this is called. containerList will never be null - untill a getProto is called.
-  private void initLocalContainerList() {
-    if (this.containerList != null) {
+  private void initLocalNewContainerList() {
+    if (this.newContainersList != null) {
       return;
     }
     AMResponseProtoOrBuilder p = viaProto ? proto : builder;
-    List<ContainerProto> list = p.getContainersList();
-    containerList = new ArrayList<Container>();
+    List<ContainerProto> list = p.getNewContainersList();
+    newContainersList = new ArrayList<Container>();
 
     for (ContainerProto c : list) {
-      containerList.add(convertFromProtoFormat(c));
+      newContainersList.add(convertFromProtoFormat(c));
     }
   }
 
   @Override
-  public void addAllContainers(final List<Container> containers) {
+  public void addAllNewContainers(final List<Container> containers) {
     if (containers == null) 
       return;
-    initLocalContainerList();
-    containerList.addAll(containers);
+    initLocalNewContainerList();
+    newContainersList.addAll(containers);
   }
 
-  private void addLocalContainersToProto() {
+  private Iterable<ContainerProto> getProtoIterable(
+      final List<Container> newContainersList) {
     maybeInitBuilder();
-    builder.clearContainers();
-    if (containerList == null)
-      return;
-    Iterable<ContainerProto> iterable = new Iterable<ContainerProto>() {
+    return new Iterable<ContainerProto>() {
       @Override
       public Iterator<ContainerProto> iterator() {
         return new Iterator<ContainerProto>() {
 
-          Iterator<Container> iter = containerList.iterator();
+          Iterator<Container> iter = newContainersList.iterator();
 
           @Override
           public boolean hasNext() {
@@ -182,26 +188,84 @@ public class AMResponsePBImpl extends Pr
 
       }
     };
-    builder.addAllContainers(iterable);
   }
   
   @Override
-  public void addContainer(Container containers) {
-    initLocalContainerList();
+  public void addNewContainer(Container containers) {
+    initLocalNewContainerList();
+    if (containers == null) 
+      return;
+    this.newContainersList.add(containers);
+  }
+  
+  @Override
+  public void removeNewContainer(int index) {
+    initLocalNewContainerList();
+    this.newContainersList.remove(index);
+  }
+  @Override
+  public void clearNewContainers() {
+    initLocalNewContainerList();
+    this.newContainersList.clear();
+  }
+
+  //// Finished containers
+  @Override
+  public List<Container> getFinishedContainerList() {
+    initLocalFinishedContainerList();
+    return this.finishedContainersList;
+  }
+  
+  @Override
+  public Container getFinishedContainer(int index) {
+    initLocalFinishedContainerList();
+    return this.finishedContainersList.get(index);
+  }
+  @Override
+  public int getFinishedContainerCount() {
+    initLocalFinishedContainerList();
+    return this.finishedContainersList.size();
+  }
+  
+  //Once this is called. containerList will never be null - untill a getProto is called.
+  private void initLocalFinishedContainerList() {
+    if (this.finishedContainersList != null) {
+      return;
+    }
+    AMResponseProtoOrBuilder p = viaProto ? proto : builder;
+    List<ContainerProto> list = p.getFinishedContainersList();
+    finishedContainersList = new ArrayList<Container>();
+
+    for (ContainerProto c : list) {
+      finishedContainersList.add(convertFromProtoFormat(c));
+    }
+  }
+
+  @Override
+  public void addAllFinishedContainers(final List<Container> containers) {
+    if (containers == null) 
+      return;
+    initLocalFinishedContainerList();
+    finishedContainersList.addAll(containers);
+  }
+  
+  @Override
+  public void addFinishedContainer(Container containers) {
+    initLocalFinishedContainerList();
     if (containers == null) 
       return;
-    this.containerList.add(containers);
+    this.finishedContainersList.add(containers);
   }
   
   @Override
-  public void removeContainer(int index) {
-    initLocalContainerList();
-    this.containerList.remove(index);
+  public void removeFinishedContainer(int index) {
+    initLocalFinishedContainerList();
+    this.finishedContainersList.remove(index);
   }
   @Override
-  public void clearContainers() {
-    initLocalContainerList();
-    this.containerList.clear();
+  public void clearFinishedContainers() {
+    initLocalFinishedContainerList();
+    this.finishedContainersList.clear();
   }
 
   private ContainerPBImpl convertFromProtoFormat(ContainerProto p) {

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-api/src/main/proto/yarn_protos.proto
Wed Aug  3 11:37:52 2011
@@ -155,8 +155,9 @@ message ResourceRequestProto {
 message AMResponseProto {
   optional bool reboot = 1;
   optional int32 response_id = 2;
-  repeated ContainerProto containers = 3;
-  optional ResourceProto limit = 4;
+  repeated ContainerProto new_containers = 3;
+  repeated ContainerProto finished_containers = 4;
+  optional ResourceProto limit = 5;
 }
 
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ams/ApplicationMasterService.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ams/ApplicationMasterService.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ams/ApplicationMasterService.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ams/ApplicationMasterService.java
Wed Aug  3 11:37:52 2011
@@ -43,6 +43,7 @@ import org.apache.hadoop.yarn.api.record
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.ResourceRequest;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.event.EventHandler;
@@ -243,17 +244,10 @@ AMRMProtocol, EventHandler<ApplicationMa
       List<Container> finishedContainers = appAttempt
           .pullJustFinishedContainers();
 
-      // Get the list of newly allocated containers.
-      List<Container> newlyAllocatedContainers = appAttempt
-          .pullNewlyAllocatedContainers();
-
-      // TODO: For now all containers are combined
-      List<Container> allContainers = new ArrayList<Container>(
-          finishedContainers);
-      allContainers.addAll(newlyAllocatedContainers);
-
       AMResponse response = recordFactory.newRecordInstance(AMResponse.class);
-      response.addAllContainers(allContainers);
+      response.addAllNewContainers(appAttempt.pullNewlyAllocatedContainers());
+      response.addAllFinishedContainers(appAttempt
+          .pullJustFinishedContainers());
       response.setResponseId(lastResponse.getResponseId() + 1);
       response.setAvailableResources(rScheduler
           .getResourceLimit(appAttemptId));

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMApp.java
Wed Aug  3 11:37:52 2011
@@ -1,11 +1,8 @@
 package org.apache.hadoop.yarn.server.resourcemanager.rmapp;
 
-import java.util.Set;
-
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationReport;
-import org.apache.hadoop.yarn.api.records.NodeId;
 import org.apache.hadoop.yarn.event.EventHandler;
 import org.apache.hadoop.yarn.server.resourcemanager.recovery.ApplicationsStore.ApplicationStore;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt;
@@ -39,6 +36,4 @@ public interface RMApp extends EventHand
   String getTrackingUrl();
 
   StringBuilder getDiagnostics();
-
-  Set<NodeId> getRanNodes();
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java
Wed Aug  3 11:37:52 2011
@@ -67,6 +67,8 @@ public class RMAppImpl implements RMApp 
   private int maxRetries;
   private RMAppAttempt currentAttempt;
 
+  private static final FinalTransition FINAL_TRANSITION = new FinalTransition();
+
   private static final StateMachineFactory<RMAppImpl,
                                            RMAppState,
                                            RMAppEventType,
@@ -100,7 +102,7 @@ public class RMAppImpl implements RMApp 
 
      // Transitions from RUNNING state
     .addTransition(RMAppState.RUNNING, RMAppState.FINISHED,
-        RMAppEventType.ATTEMPT_FINISHED, new FinalTransition())
+        RMAppEventType.ATTEMPT_FINISHED, FINAL_TRANSITION)
     .addTransition(RMAppState.RUNNING,
         EnumSet.of(RMAppState.RESTARTING, RMAppState.FAILED),
         RMAppEventType.ATTEMPT_FAILED,
@@ -321,21 +323,6 @@ public class RMAppImpl implements RMApp 
   }
 
   @Override
-  public Set<NodeId> getRanNodes() {
-    this.readLock.lock();
-
-    try {
-      Set<NodeId> ranNodes = new HashSet<NodeId>();
-      for (RMAppAttempt attempt : attempts.values()) {
-        ranNodes.addAll(attempt.getRanNodes());
-      }
-      return ranNodes;
-    } finally {
-      this.readLock.unlock();
-    }
-  }
-
-  @Override
   public void handle(RMAppEvent event) {
 
     this.writeLock.lock();
@@ -401,18 +388,26 @@ public class RMAppImpl implements RMApp 
   }
 
   private static class FinalTransition extends RMAppTransition {
+
+    private Set<NodeId> getNodesOnWhichAttemptRan(RMAppImpl app) {
+      Set<NodeId> nodes = new HashSet<NodeId>();
+      for (RMAppAttempt attempt : app.attempts.values()) {
+        nodes.addAll(attempt.getRanNodes());
+      }
+      return nodes;
+    }
+
     public void transition(RMAppImpl app, RMAppEvent event) {
-      Set<NodeId> ranNodes = app.getRanNodes();
-      for (NodeId nodeId : ranNodes) {
+      Set<NodeId> nodes = getNodesOnWhichAttemptRan(app);
+      for (NodeId nodeId : nodes) {
         app.dispatcher.getEventHandler().handle(
             new RMNodeCleanAppEvent(nodeId, app.applicationId));
       }
     };
   }
 
-  private static final class AttemptFailedTransition extends FinalTransition 
-    implements
-      MultipleArcTransition<RMAppImpl, RMAppEvent, RMAppState>  {
+  private static final class AttemptFailedTransition implements
+      MultipleArcTransition<RMAppImpl, RMAppEvent, RMAppState> {
 
     private final RMAppState initialState;
 
@@ -427,6 +422,8 @@ public class RMAppImpl implements RMApp 
         app.diagnostics.append("Application " + app.getApplicationId()
             + " failed " + app.maxRetries
             + " times. Failing the application.");
+        // Inform the node for app-finish
+        FINAL_TRANSITION.transition(app, event);
         return RMAppState.FAILED;
       }
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttempt.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttempt.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttempt.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttempt.java
Wed Aug  3 11:37:52 2011
@@ -6,6 +6,7 @@ import java.util.Set;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
 import org.apache.hadoop.yarn.api.records.Container;
+import org.apache.hadoop.yarn.api.records.ContainerId;
 import org.apache.hadoop.yarn.api.records.NodeId;
 import org.apache.hadoop.yarn.event.EventHandler;
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptImpl.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptImpl.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/RMAppAttemptImpl.java
Wed Aug  3 11:37:52 2011
@@ -87,8 +87,8 @@ public class RMAppAttemptImpl implements
     new HashSet<NodeId>();
   private final List<Container> newlyAllocatedContainers = 
     new ArrayList<Container>();
-  private final List<ContainerId> justFinishedContainers = 
-    new ArrayList<ContainerId>();
+  private final List<Container> justFinishedContainers = 
+    new ArrayList<Container>();
   private Container masterContainer;
 
   private float progress = 0;
@@ -325,12 +325,11 @@ public class RMAppAttemptImpl implements
     this.writeLock.lock();
 
     try {
-      return new ArrayList<Container>();  // TODO: Should just be ContainerId 
-//      List<Container> returnList = new ArrayList<Container>(
-//          this.justFinishedContainers.size());
-//      returnList.addAll(this.justFinishedContainers);
-//      this.justFinishedContainers.clear();
-//      return returnList;
+      List<Container> returnList = new ArrayList<Container>(
+          this.justFinishedContainers.size());
+      returnList.addAll(this.justFinishedContainers);
+      this.justFinishedContainers.clear();
+      return returnList;
     } finally {
       this.writeLock.unlock();
     }
@@ -709,12 +708,11 @@ public class RMAppAttemptImpl implements
 
       RMAppAttemptContainerFinishedEvent containerFinishedEvent
         = (RMAppAttemptContainerFinishedEvent) event;
-      ContainerId containerId = containerFinishedEvent.getContainerId();
+      Container container = containerFinishedEvent.getContainer();
 
       // Is this container the AmContainer? If the finished container is same as
       // the AMContainer, AppAttempt fails
-      if (appAttempt.masterContainer.getId().equals(
-          containerId)) {
+      if (appAttempt.masterContainer.getId().equals(container.getId())) {
         new BaseFinalTransition(RMAppAttemptState.FAILED).transition(
             appAttempt, containerFinishedEvent);
         return RMAppAttemptState.FAILED;
@@ -723,10 +721,10 @@ public class RMAppAttemptImpl implements
       // Normal container.
 
       // Remove it from allContainers list.
-      appAttempt.liveContainers.remove(containerId);
+      appAttempt.liveContainers.remove(container.getId());
 
       // Put it in completedcontainers list
-      appAttempt.justFinishedContainers.add(containerId);
+      appAttempt.justFinishedContainers.add(container);
       return RMAppAttemptState.RUNNING;
     }
   }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/event/RMAppAttemptContainerFinishedEvent.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/event/RMAppAttemptContainerFinishedEvent.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/event/RMAppAttemptContainerFinishedEvent.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/attempt/event/RMAppAttemptContainerFinishedEvent.java
Wed Aug  3 11:37:52 2011
@@ -1,21 +1,21 @@
 package org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event;
 
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
-import org.apache.hadoop.yarn.api.records.ContainerId;
+import org.apache.hadoop.yarn.api.records.Container;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEvent;
 import org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptEventType;
 
 public class RMAppAttemptContainerFinishedEvent extends RMAppAttemptEvent {
 
-  private final ContainerId container;
+  private final Container container;
 
   public RMAppAttemptContainerFinishedEvent(ApplicationAttemptId appAttemptId, 
-      ContainerId containerId) {
+      Container container) {
     super(appAttemptId, RMAppAttemptEventType.CONTAINER_FINISHED);
-    this.container = containerId;
+    this.container = container;
   }
 
-  public ContainerId getContainerId() {
+  public Container getContainer() {
     return this.container;
   }
 

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmcontainer/RMContainerImpl.java
Wed Aug  3 11:37:52 2011
@@ -200,7 +200,7 @@ public class RMContainerImpl implements 
 
       // Inform AppAttempt
       container.eventHandler.handle(new RMAppAttemptContainerFinishedEvent(
-          container.appAttemptId, container.getContainerId()));
+          container.appAttemptId, container.container));
 
       // Inform Scheduler
       container.eventHandler.handle(new ContainerFinishedSchedulerEvent(

Modified: hadoop/common/branches/MR-279/mapreduce/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/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java
Wed Aug  3 11:37:52 2011
@@ -674,16 +674,17 @@ implements ResourceScheduler, CapacitySc
   @Override
   @Lock(Lock.NoLock.class)
   public void recover(RMState state) throws Exception {
-    applications.clear();
-    for (Map.Entry<ApplicationId, ApplicationInfo> entry : state.getStoredApplications().entrySet())
{
-      ApplicationId appId = entry.getKey();
-      ApplicationInfo appInfo = entry.getValue();
-      CSApp app = applications.get(appId);
-      app.allocate(appInfo.getContainers());
-      for (Container c: entry.getValue().getContainers()) {
-        Queue queue = queues.get(appInfo.getApplicationSubmissionContext().getQueue());
-        queue.recoverContainer(clusterResource, applications.get(appId), c);
-      }
-    }
+    // TODO: VINDOKVFIXME
+//    applications.clear();
+//    for (Map.Entry<ApplicationId, ApplicationInfo> entry : state.getStoredApplications().entrySet())
{
+//      ApplicationId appId = entry.getKey();
+//      ApplicationInfo appInfo = entry.getValue();
+//      CSApp app = applications.get(appId);
+//      app.allocate(appInfo.getContainers());
+//      for (Container c: entry.getValue().getContainers()) {
+//        Queue queue = queues.get(appInfo.getApplicationSubmissionContext().getQueue());
+//        queue.recoverContainer(clusterResource, applications.get(appId), c);
+//      }
+//    }
   }
 }

Modified: hadoop/common/branches/MR-279/mapreduce/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/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fifo/FifoScheduler.java
Wed Aug  3 11:37:52 2011
@@ -666,11 +666,11 @@ public class FifoScheduler implements Re
 
   @Override
   public void recover(RMState state) {
-    for (Map.Entry<ApplicationId, ApplicationInfo> entry: state.getStoredApplications().entrySet())
{
-      ApplicationId appId = entry.getKey();
-      ApplicationInfo appInfo = entry.getValue();
-      SchedulerApp app = applications.get(appId);
-      app.allocate(appInfo.getContainers());
-    }
+//    for (Map.Entry<ApplicationId, ApplicationInfo> entry: state.getStoredApplications().entrySet())
{
+//      ApplicationId appId = entry.getKey();
+//      ApplicationInfo appInfo = entry.getValue();
+//      SchedulerApp app = applications.get(appId);
+//      app.allocate(appInfo.getContainers());
+//    }
   }
 }

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/MockRM.java
Wed Aug  3 11:37:52 2011
@@ -8,6 +8,7 @@ import org.apache.hadoop.yarn.api.protoc
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdRequest;
 import org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationIdResponse;
 import org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest;
+import org.apache.hadoop.yarn.api.records.AMResponse;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/NodeManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/NodeManager.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/NodeManager.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/NodeManager.java
Wed Aug  3 11:37:52 2011
@@ -254,7 +254,7 @@ public class NodeManager implements Cont
     RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
     org.apache.hadoop.yarn.server.api.records.NodeStatus nodeStatus = recordFactory.newRecordInstance(org.apache.hadoop.yarn.server.api.records.NodeStatus.class);
     nodeStatus.setNodeId(nodeId);
-    nodeStatus.addAllContainers(containers);
+    nodeStatus.addAllNewContainers(containers);
     NodeHealthStatus nodeHealthStatus = 
       recordFactory.newRecordInstance(NodeHealthStatus.class);
     nodeHealthStatus.setIsNodeHealthy(true);

Modified: hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java?rev=1153436&r1=1153435&r2=1153436&view=diff
==============================================================================
--- hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java
(original)
+++ hadoop/common/branches/MR-279/mapreduce/yarn/yarn-server/yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/TestContainerTokenSecretManager.java
Wed Aug  3 11:37:52 2011
@@ -239,8 +239,8 @@ public class TestContainerTokenSecretMan
     allocateRequest.setApplicationStatus(status);
     allocateRequest.addAllAsks(ask);
     allocateRequest.addAllReleases(release);
-    List<Container> allocatedContainers =
-        scheduler.allocate(allocateRequest).getAMResponse().getContainerList();
+    List<Container> allocatedContainers = scheduler.allocate(allocateRequest)
+        .getAMResponse().getNewContainerList();
 
     waitCounter = 0;
     while ((allocatedContainers == null || allocatedContainers.size() == 0)
@@ -251,7 +251,7 @@ public class TestContainerTokenSecretMan
       allocateRequest.setApplicationStatus(status);
       allocatedContainers =
           scheduler.allocate(allocateRequest).getAMResponse()
-              .getContainerList();
+              .getNewContainerList();
     }
 
     Assert.assertNotNull("Container is not allocted!", allocatedContainers);



Mime
View raw message