hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vino...@apache.org
Subject [1/2] hadoop git commit: YARN-3684. Changed ContainerExecutor's primary lifecycle methods to use a more extensible mechanism of context objects. Contributed by Sidharta Seethana.
Date Thu, 21 May 2015 22:50:52 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 4fc942a84 -> 53fafcf06


http://git-wip-us.apache.org/repos/asf/hadoop/blob/53fafcf0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutor.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutor.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutor.java
index 723ac92..58debc9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutor.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutor.java
@@ -60,6 +60,11 @@ import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.Signal;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ContainerLocalizer;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.ResourceLocalizationService;
+import org.apache.hadoop.yarn.server.nodemanager.executor.ContainerReacquisitionContext;
+import org.apache.hadoop.yarn.server.nodemanager.executor.ContainerSignalContext;
+import org.apache.hadoop.yarn.server.nodemanager.executor.ContainerStartContext;
+import org.apache.hadoop.yarn.server.nodemanager.executor.DeletionAsUserContext;
+import org.apache.hadoop.yarn.server.nodemanager.executor.LocalizerStartContext;
 import org.apache.hadoop.yarn.server.nodemanager.util.LCEResourcesHandler;
 import org.junit.After;
 import org.junit.Assert;
@@ -208,7 +213,10 @@ public class TestLinuxContainerExecutor {
       Path usercachedir = new Path(dir, ContainerLocalizer.USERCACHE);
       Path userdir = new Path(usercachedir, user);
       Path appcachedir = new Path(userdir, ContainerLocalizer.APPCACHE);
-      exec.deleteAsUser(user, appcachedir);
+      exec.deleteAsUser(new DeletionAsUserContext.Builder()
+          .setUser(user)
+          .setSubDir(appcachedir)
+          .build());
       FileContext.getLocalFSFileContext().delete(usercachedir, true);
     }
   }
@@ -218,7 +226,10 @@ public class TestLinuxContainerExecutor {
     for (String dir : localDirs) {
       Path filecache = new Path(dir, ContainerLocalizer.FILECACHE);
       Path filedir = new Path(filecache, user);
-      exec.deleteAsUser(user, filedir);
+      exec.deleteAsUser(new DeletionAsUserContext.Builder()
+          .setUser(user)
+          .setSubDir(filedir)
+          .build());
     }
   }
 
@@ -229,7 +240,10 @@ public class TestLinuxContainerExecutor {
       String containerId = "CONTAINER_" + (id - 1);
       Path appdir = new Path(dir, appId);
       Path containerdir = new Path(appdir, containerId);
-      exec.deleteAsUser(user, containerdir);
+      exec.deleteAsUser(new DeletionAsUserContext.Builder()
+          .setUser(user)
+          .setSubDir(containerdir)
+          .build());
     }
   }
 
@@ -244,7 +258,11 @@ public class TestLinuxContainerExecutor {
     for (String file : files) {
       File f = new File(workSpace, file);
       if (f.exists()) {
-        exec.deleteAsUser(user, new Path(file), ws);
+        exec.deleteAsUser(new DeletionAsUserContext.Builder()
+            .setUser(user)
+            .setSubDir(new Path(file))
+            .setBasedirs(ws)
+            .build());
       }
     }
   }
@@ -310,9 +328,16 @@ public class TestLinuxContainerExecutor {
     Path pidFile = new Path(workDir, "pid.txt");
 
     exec.activateContainer(cId, pidFile);
-    return exec.launchContainer(container, scriptPath, tokensPath,
-      appSubmitter, appId, workDir, dirsHandler.getLocalDirs(),
-      dirsHandler.getLogDirs());
+    return exec.launchContainer(new ContainerStartContext.Builder()
+        .setContainer(container)
+        .setNmPrivateContainerScriptPath(scriptPath)
+        .setNmPrivateTokensPath(tokensPath)
+        .setUser(appSubmitter)
+        .setAppId(appId)
+        .setContainerWorkDir(workDir)
+        .setLocalDirs(dirsHandler.getLocalDirs())
+        .setLogDirs(dirsHandler.getLogDirs())
+        .build());
   }
 
   @Test
@@ -345,8 +370,14 @@ public class TestLinuxContainerExecutor {
     };
     exec.setConf(conf);
 
-    exec.startLocalizer(nmPrivateContainerTokensPath, nmAddr, appSubmitter,
-      appId, locId, dirsHandler);
+    exec.startLocalizer(new LocalizerStartContext.Builder()
+        .setNmPrivateContainerTokens(nmPrivateContainerTokensPath)
+        .setNmAddr(nmAddr)
+        .setUser(appSubmitter)
+        .setAppId(appId)
+        .setLocId(locId)
+        .setDirsHandler(dirsHandler)
+        .build());
 
     String locId2 = "container_01_02";
     Path nmPrivateContainerTokensPath2 =
@@ -355,8 +386,16 @@ public class TestLinuxContainerExecutor {
               + Path.SEPARATOR
               + String.format(ContainerLocalizer.TOKEN_FILE_NAME_FMT, locId2));
     files.create(nmPrivateContainerTokensPath2, EnumSet.of(CREATE, OVERWRITE));
-    exec.startLocalizer(nmPrivateContainerTokensPath2, nmAddr, appSubmitter,
-      appId, locId2, dirsHandler);
+    exec.startLocalizer(new LocalizerStartContext.Builder()
+            .setNmPrivateContainerTokens(nmPrivateContainerTokensPath2)
+            .setNmAddr(nmAddr)
+            .setUser(appSubmitter)
+            .setAppId(appId)
+            .setLocId(locId2)
+            .setDirsHandler(dirsHandler)
+            .build());
+
+
     cleanupUserAppCache(appSubmitter);
   }
 
@@ -429,7 +468,11 @@ public class TestLinuxContainerExecutor {
     assertNotNull(pid);
 
     LOG.info("Going to killing the process.");
-    exec.signalContainer(appSubmitter, pid, Signal.TERM);
+    exec.signalContainer(new ContainerSignalContext.Builder()
+        .setUser(appSubmitter)
+        .setPid(pid)
+        .setSignal(Signal.TERM)
+        .build());
     LOG.info("sleeping for 100ms to let the sleep be killed");
     Thread.sleep(100);
 
@@ -586,7 +629,10 @@ public class TestLinuxContainerExecutor {
     } catch (IOException e) {
       // expected if LCE isn't setup right, but not necessary for this test
     }
-    lce.reacquireContainer("foouser", cid);
+    lce.reacquireContainer(new ContainerReacquisitionContext.Builder()
+        .setUser("foouser")
+        .setContainerId(cid)
+        .build());
     assertTrue("postExec not called after reacquisition",
         TestResourceHandler.postExecContainers.contains(cid));
   }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/53fafcf0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
index dce2cd3..d48ce13 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/TestLinuxContainerExecutorWithMocks.java
@@ -49,6 +49,10 @@ import org.apache.hadoop.yarn.api.records.ContainerLaunchContext;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.Container;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.container.ContainerDiagnosticsUpdateEvent;
+import org.apache.hadoop.yarn.server.nodemanager.executor.ContainerSignalContext;
+import org.apache.hadoop.yarn.server.nodemanager.executor.ContainerStartContext;
+import org.apache.hadoop.yarn.server.nodemanager.executor.DeletionAsUserContext;
+import org.apache.hadoop.yarn.server.nodemanager.executor.LocalizerStartContext;
 import org.junit.Assert;
 import org.junit.After;
 import org.junit.Before;
@@ -130,9 +134,16 @@ public class TestLinuxContainerExecutorWithMocks {
     Path pidFile = new Path(workDir, "pid.txt");
 
     mockExec.activateContainer(cId, pidFile);
-    int ret = mockExec.launchContainer(container, scriptPath, tokensPath,
-        appSubmitter, appId, workDir, dirsHandler.getLocalDirs(),
-        dirsHandler.getLogDirs());
+    int ret = mockExec.launchContainer(new ContainerStartContext.Builder()
+        .setContainer(container)
+        .setNmPrivateContainerScriptPath(scriptPath)
+        .setNmPrivateTokensPath(tokensPath)
+        .setUser(appSubmitter)
+        .setAppId(appId)
+        .setContainerWorkDir(workDir)
+        .setLocalDirs(dirsHandler.getLocalDirs())
+        .setLogDirs(dirsHandler.getLogDirs())
+        .build());
     assertEquals(0, ret);
     assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
         appSubmitter, cmd, appId, containerId,
@@ -185,7 +196,15 @@ public class TestLinuxContainerExecutorWithMocks {
     Path nmPrivateCTokensPath= new Path("file:///bin/nmPrivateCTokensPath");
  
     try {
-      mockExec.startLocalizer(nmPrivateCTokensPath, address, "test", "application_0", "12345",
dirsHandler);
+      mockExec.startLocalizer(new LocalizerStartContext.Builder()
+          .setNmPrivateContainerTokens(nmPrivateCTokensPath)
+          .setNmAddr(address)
+          .setUser("test")
+          .setAppId("application_0")
+          .setLocId("12345")
+          .setDirsHandler(dirsHandler)
+          .build());
+
       List<String> result=readMockParams();
       Assert.assertEquals(result.size(), 18);
       Assert.assertEquals(result.get(0), YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER);
@@ -278,9 +297,17 @@ public class TestLinuxContainerExecutorWithMocks {
     Path pidFile = new Path(workDir, "pid.txt");
 
     mockExec.activateContainer(cId, pidFile);
-    int ret = mockExec.launchContainer(container, scriptPath, tokensPath,
-        appSubmitter, appId, workDir, dirsHandler.getLocalDirs(),
-        dirsHandler.getLogDirs());
+    int ret = mockExec.launchContainer(new ContainerStartContext.Builder()
+        .setContainer(container)
+        .setNmPrivateContainerScriptPath(scriptPath)
+        .setNmPrivateTokensPath(tokensPath)
+        .setUser(appSubmitter)
+        .setAppId(appId)
+        .setContainerWorkDir(workDir)
+        .setLocalDirs(dirsHandler.getLocalDirs())
+        .setLogDirs(dirsHandler.getLogDirs())
+        .build());
+
     Assert.assertNotSame(0, ret);
     assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
         appSubmitter, cmd, appId, containerId,
@@ -308,7 +335,11 @@ public class TestLinuxContainerExecutorWithMocks {
     ContainerExecutor.Signal signal = ContainerExecutor.Signal.QUIT;
     String sigVal = String.valueOf(signal.getValue());
     
-    mockExec.signalContainer(appSubmitter, "1000", signal);
+    mockExec.signalContainer(new ContainerSignalContext.Builder()
+        .setUser(appSubmitter)
+        .setPid("1000")
+        .setSignal(signal)
+        .build());
     assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
         appSubmitter, cmd, "1000", sigVal),
         readMockParams());
@@ -324,24 +355,41 @@ public class TestLinuxContainerExecutorWithMocks {
     Path baseDir0 = new Path("/grid/0/BaseDir");
     Path baseDir1 = new Path("/grid/1/BaseDir");
 
-    mockExec.deleteAsUser(appSubmitter, dir);
-    assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
-        appSubmitter, cmd, "/tmp/testdir"),
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .setSubDir(dir)
+        .build());
+    assertEquals(
+        Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
+            appSubmitter, cmd, "/tmp/testdir"),
         readMockParams());
 
-    mockExec.deleteAsUser(appSubmitter, null);
-    assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
-        appSubmitter, cmd, ""),
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .build());
+    assertEquals(
+        Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
+            appSubmitter, cmd, ""),
         readMockParams());
 
-    mockExec.deleteAsUser(appSubmitter, testFile, baseDir0, baseDir1);
-    assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
-        appSubmitter, cmd, testFile.toString(), baseDir0.toString(), baseDir1.toString()),
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .setSubDir(testFile)
+        .setBasedirs(baseDir0, baseDir1)
+        .build());
+    assertEquals(
+        Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
+            appSubmitter, cmd, testFile.toString(), baseDir0.toString(),
+            baseDir1.toString()),
         readMockParams());
 
-    mockExec.deleteAsUser(appSubmitter, null, baseDir0, baseDir1);
-    assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
-        appSubmitter, cmd, "", baseDir0.toString(), baseDir1.toString()),
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .setBasedirs(baseDir0, baseDir1)
+        .build());
+    assertEquals(
+        Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
+            appSubmitter, cmd, "", baseDir0.toString(), baseDir1.toString()),
         readMockParams());
 
     File f = new File("./src/test/resources/mock-container-executer-with-error");
@@ -353,22 +401,38 @@ public class TestLinuxContainerExecutorWithMocks {
     conf.set(YarnConfiguration.NM_LINUX_CONTAINER_EXECUTOR_PATH, executorPath);
     mockExec.setConf(conf);
 
-    mockExec.deleteAsUser(appSubmitter, dir);
-    assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
-        appSubmitter, cmd, "/tmp/testdir"),
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .setSubDir(dir)
+        .build());
+    assertEquals(
+        Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
+            appSubmitter, cmd, "/tmp/testdir"),
         readMockParams());
 
-    mockExec.deleteAsUser(appSubmitter, null);
-    assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
-        appSubmitter, cmd, ""),
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .build());
+    assertEquals(
+        Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
+            appSubmitter, cmd, ""),
         readMockParams());
 
-    mockExec.deleteAsUser(appSubmitter, testFile, baseDir0, baseDir1);
-    assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
-        appSubmitter, cmd, testFile.toString(), baseDir0.toString(), baseDir1.toString()),
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .setSubDir(testFile)
+        .setBasedirs(baseDir0, baseDir1)
+        .build());
+    assertEquals(
+        Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
+            appSubmitter, cmd, testFile.toString(), baseDir0.toString(),
+            baseDir1.toString()),
         readMockParams());
 
-    mockExec.deleteAsUser(appSubmitter, null, baseDir0, baseDir1);
+    mockExec.deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(appSubmitter)
+        .setBasedirs(baseDir0, baseDir1)
+        .build());
     assertEquals(Arrays.asList(YarnConfiguration.DEFAULT_NM_NONSECURE_MODE_LOCAL_USER,
         appSubmitter, cmd, "", baseDir0.toString(), baseDir1.toString()),
         readMockParams());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/53fafcf0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
index 968c010..a8e723d 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/BaseContainerManagerTest.java
@@ -26,6 +26,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.hadoop.yarn.server.nodemanager.executor.DeletionAsUserContext;
 import org.junit.Assert;
 
 import org.apache.commons.logging.Log;
@@ -255,8 +256,11 @@ public abstract class BaseContainerManagerTest {
     if (containerManager != null) {
       containerManager.stop();
     }
-    createContainerExecutor().deleteAsUser(user,
-        new Path(localDir.getAbsolutePath()), new Path[] {});
+    createContainerExecutor().deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(user)
+        .setSubDir(new Path(localDir.getAbsolutePath()))
+        .setBasedirs(new Path[] {})
+        .build());
   }
 
   public static void waitForContainerState(ContainerManagementProtocol containerManager,

http://git-wip-us.apache.org/repos/asf/hadoop/blob/53fafcf0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
index 296cba6ad..a02b2b0 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/localizer/TestResourceLocalizationService.java
@@ -63,6 +63,7 @@ import java.util.concurrent.CyclicBarrier;
 import java.util.concurrent.Future;
 
 import org.apache.hadoop.fs.Options;
+import org.apache.hadoop.yarn.server.nodemanager.executor.LocalizerStartContext;
 import org.junit.Assert;
 
 import org.apache.commons.io.FileUtils;
@@ -939,11 +940,16 @@ public class TestResourceLocalizationService {
       dispatcher.await();
       String appStr = ConverterUtils.toString(appId);
       String ctnrStr = c.getContainerId().toString();
-      ArgumentCaptor<Path> tokenPathCaptor = ArgumentCaptor.forClass(Path.class);
-      verify(exec).startLocalizer(tokenPathCaptor.capture(),
-          isA(InetSocketAddress.class), eq("user0"), eq(appStr), eq(ctnrStr),
-          isA(LocalDirsHandlerService.class));
-      Path localizationTokenPath = tokenPathCaptor.getValue();
+      ArgumentCaptor<LocalizerStartContext> contextCaptor = ArgumentCaptor
+          .forClass(LocalizerStartContext.class);
+      verify(exec).startLocalizer(contextCaptor.capture());
+
+      LocalizerStartContext context = contextCaptor.getValue();
+      Path localizationTokenPath = context.getNmPrivateContainerTokens();
+
+      assertEquals("user0", context.getUser());
+      assertEquals(appStr, context.getAppId());
+      assertEquals(ctnrStr, context.getLocId());
 
       // heartbeat from localizer
       LocalResourceStatus rsrc1success = mock(LocalResourceStatus.class);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/53fafcf0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
index b1de9cb..eb0d055 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/logaggregation/TestLogAggregationService.java
@@ -116,6 +116,7 @@ import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.Tes
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerAppFinishedEvent;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerAppStartedEvent;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.loghandler.event.LogHandlerContainerFinishedEvent;
+import org.apache.hadoop.yarn.server.nodemanager.executor.DeletionAsUserContext;
 import org.apache.hadoop.yarn.server.utils.BuilderUtils;
 import org.apache.hadoop.yarn.util.ConverterUtils;
 import org.apache.hadoop.yarn.util.Records;
@@ -165,8 +166,12 @@ public class TestLogAggregationService extends BaseContainerManagerTest
{
   @Override
   public void tearDown() throws IOException, InterruptedException {
     super.tearDown();
-    createContainerExecutor().deleteAsUser(user,
-        new Path(remoteRootLogDir.getAbsolutePath()), new Path[] {});
+    createContainerExecutor().deleteAsUser(new DeletionAsUserContext.Builder()
+        .setUser(user)
+        .setSubDir(new Path(remoteRootLogDir.getAbsolutePath()))
+        .setBasedirs(new Path[] {})
+        .build());
+
     dispatcher.await();
     dispatcher.stop();
     dispatcher.close();

http://git-wip-us.apache.org/repos/asf/hadoop/blob/53fafcf0/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
index 1f2d067..909a962 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/monitor/TestContainersMonitor.java
@@ -63,6 +63,7 @@ import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor;
 import org.apache.hadoop.yarn.server.nodemanager.ContainerExecutor.Signal;
 import org.apache.hadoop.yarn.server.nodemanager.Context;
 import org.apache.hadoop.yarn.server.nodemanager.containermanager.BaseContainerManagerTest;
+import org.apache.hadoop.yarn.server.nodemanager.executor.ContainerSignalContext;
 import org.apache.hadoop.yarn.server.utils.BuilderUtils;
 import org.apache.hadoop.yarn.util.ConverterUtils;
 import org.apache.hadoop.yarn.util.LinuxResourceCalculatorPlugin;
@@ -288,8 +289,11 @@ public class TestContainersMonitor extends BaseContainerManagerTest {
 
     // Assert that the process is not alive anymore
     Assert.assertFalse("Process is still alive!",
-        exec.signalContainer(user,
-            pid, Signal.NULL));
+        exec.signalContainer(new ContainerSignalContext.Builder()
+            .setUser(user)
+            .setPid(pid)
+            .setSignal(Signal.NULL)
+            .build()));
   }
 
   @Test(timeout = 20000)


Mime
View raw message