hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject svn commit: r1484351 - in /hadoop/common/branches/branch-2/hadoop-mapreduce-project: CHANGES.txt hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/launcher/TestContainerLauncherImpl.java
Date Sun, 19 May 2013 21:15:54 GMT
Author: vinodkv
Date: Sun May 19 21:15:54 2013
New Revision: 1484351

URL: http://svn.apache.org/r1484351
Log:
MAPREDUCE-5257. Fix issues in TestContainerLauncherImpl after YARN-617. Contributed by Omkar
Vinit Joshi.
svn merge --ignore-ancestry -c 1484349 ../../trunk/

Modified:
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/launcher/TestContainerLauncherImpl.java

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt?rev=1484351&r1=1484350&r2=1484351&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/CHANGES.txt Sun May 19 21:15:54
2013
@@ -264,6 +264,9 @@ Release 2.0.5-beta - UNRELEASED
     MAPREDUCE-4927. Historyserver 500 error due to NPE when accessing specific
     counters page for failed job. (Ashwin Shankar via jlowe)
 
+    MAPREDUCE-5257. Fix issues in TestContainerLauncherImpl after YARN-617.
+    (Omkar Vinit Joshi via vinodkv)
+
 Release 2.0.4-alpha - 2013-04-25
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/launcher/TestContainerLauncherImpl.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/launcher/TestContainerLauncherImpl.java?rev=1484351&r1=1484350&r2=1484351&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/launcher/TestContainerLauncherImpl.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/test/java/org/apache/hadoop/mapreduce/v2/app/launcher/TestContainerLauncherImpl.java
Sun May 19 21:15:54 2013
@@ -55,12 +55,14 @@ import org.apache.hadoop.yarn.api.protoc
 import org.apache.hadoop.yarn.api.protocolrecords.StopContainerResponse;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.ContainerId;
+import org.apache.hadoop.yarn.api.records.ContainerToken;
 import org.apache.hadoop.yarn.event.Event;
 import org.apache.hadoop.yarn.event.EventHandler;
 import org.apache.hadoop.yarn.exceptions.YarnRemoteException;
 import org.apache.hadoop.yarn.factories.RecordFactory;
 import org.apache.hadoop.yarn.factory.providers.RecordFactoryProvider;
 import org.apache.hadoop.yarn.ipc.YarnRPC;
+import org.apache.hadoop.yarn.security.ContainerTokenIdentifier;
 import org.apache.hadoop.yarn.util.BuilderUtils;
 import org.junit.Before;
 import org.junit.Test;
@@ -172,6 +174,8 @@ public class TestContainerLauncherImpl {
       when(mockLaunchEvent.getTaskAttemptID()).thenReturn(taskAttemptId);
       when(mockLaunchEvent.getContainerMgrAddress()).thenReturn(cmAddress);
       when(mockCM.startContainer(any(StartContainerRequest.class))).thenReturn(startResp);
+      when(mockLaunchEvent.getContainerToken()).thenReturn(
+          createNewContainerToken(contId, cmAddress));
       ut.handle(mockLaunchEvent);
       
       ut.waitForPoolToIdle();
@@ -250,6 +254,8 @@ public class TestContainerLauncherImpl {
       when(mockLaunchEvent.getTaskAttemptID()).thenReturn(taskAttemptId);
       when(mockLaunchEvent.getContainerMgrAddress()).thenReturn(cmAddress);
       when(mockCM.startContainer(any(StartContainerRequest.class))).thenReturn(startResp);
+      when(mockLaunchEvent.getContainerToken()).thenReturn(
+          createNewContainerToken(contId, cmAddress));
       ut.handle(mockLaunchEvent);
       
       ut.waitForPoolToIdle();
@@ -299,6 +305,8 @@ public class TestContainerLauncherImpl {
       when(mockLaunchEvent.getTaskAttemptID()).thenReturn(taskAttemptId);
       when(mockLaunchEvent.getContainerMgrAddress()).thenReturn(cmAddress);
       when(mockCM.startContainer(any(StartContainerRequest.class))).thenReturn(startResp);
+      when(mockLaunchEvent.getContainerToken()).thenReturn(
+          createNewContainerToken(contId, cmAddress));
       ut.handle(mockLaunchEvent);
 
       ut.waitForPoolToIdle();
@@ -356,6 +364,8 @@ public class TestContainerLauncherImpl {
         .thenReturn(contId);
       when(mockLaunchEvent.getTaskAttemptID()).thenReturn(taskAttemptId);
       when(mockLaunchEvent.getContainerMgrAddress()).thenReturn(cmAddress);
+      when(mockLaunchEvent.getContainerToken()).thenReturn(
+          createNewContainerToken(contId, cmAddress));
       ut.handle(mockLaunchEvent);
       
       startLaunchBarrier.await();
@@ -394,6 +404,15 @@ public class TestContainerLauncherImpl {
     }
   }
   
+  private ContainerToken createNewContainerToken(ContainerId contId,
+      String containerManagerAddr) {
+    return BuilderUtils.newContainerToken(BuilderUtils.newNodeId("127.0.0.1",
+        1234), "password".getBytes(), new ContainerTokenIdentifier(
+        contId, containerManagerAddr, "user",
+        BuilderUtils.newResource(1024, 1),
+        System.currentTimeMillis() + 10000L, 123));
+  }
+
   private static class ContainerManagerForTest implements ContainerManager {
 
     private CyclicBarrier startLaunchBarrier;



Mime
View raw message