PrivilegedOperationExecutor { public static String getContainerExecutorExecutablePath(Configuration conf) { String yarnHomeEnvVar = System.getenv(ApplicationConstants.Environment.HADOOP_YARN_HOME.key()); File hadoopBin = new File(yarnHomeEnvVar, "bin"); String defaultPath = new File(hadoopBin, "container-executor").getAbsolutePath(); return null == conf ? defaultPath : conf.get(YarnConfiguration.NM_LINUX_CONTAINER_EXECUTOR_PATH, defaultPath); } private  PrivilegedOperationExecutor(Configuration conf); static String getContainerExecutorExecutablePath(Configuration conf); static PrivilegedOperationExecutor getInstance(Configuration conf); String[] getPrivilegedOperationExecutionCommand(List<String>
      prefixCommands,
      PrivilegedOperation operation); String executePrivilegedOperation(List<String> prefixCommands,
      PrivilegedOperation operation, File workingDir,
      Map<String, String> env, boolean grabOutput, boolean inheritParentEnv); String executePrivilegedOperation(PrivilegedOperation operation,
      boolean grabOutput); IOStreamPair executePrivilegedInteractiveOperation(
      List<String> prefixCommands, PrivilegedOperation operation); static PrivilegedOperation squashCGroupOperations(List<PrivilegedOperation> ops);  }
@Test public void testExecutorPath() { String containerExePath = PrivilegedOperationExecutor .getContainerExecutorExecutablePath(nullConf); String yarnHomeEnvVar = System.getenv("HADOOP_YARN_HOME"); String yarnHome = yarnHomeEnvVar != null ? yarnHomeEnvVar : new File("").getAbsolutePath(); String expectedPath = yarnHome + "/bin/container-executor"; Assert.assertEquals(expectedPath, containerExePath); containerExePath = PrivilegedOperationExecutor .getContainerExecutorExecutablePath(emptyConf); Assert.assertEquals(expectedPath, containerExePath); expectedPath = customExecutorPath; containerExePath = PrivilegedOperationExecutor .getContainerExecutorExecutablePath(confWithExecutorPath); Assert.assertEquals(expectedPath, containerExePath); }