ConcurrentMap<ContainerId, Container> containers = nm.getNMContext().getContainers(); for (Map.Entry<ContainerId, Container> entry : containers.entrySet()) { String command = StringUtils.join(entry.getValue().getLaunchContext().getCommands(), " "); if (command.contains(YarnTaskExecutorRunner.class.getSimpleName())) { taskManagerContainer = entry.getKey();
false, jobManagerMemory) .getCommands().get(0)); true, jobManagerMemory) .getCommands().get(0)); false, jobManagerMemory) .getCommands().get(0)); true, jobManagerMemory) .getCommands().get(0)); false, jobManagerMemory) .getCommands().get(0)); true, jobManagerMemory) .getCommands().get(0)); false, jobManagerMemory) .getCommands().get(0)); true,
@Override public List<String> getCommands() { return launchContext.getCommands(); }
@Override public List<String> getCommands() { return launchContext.getCommands(); }
@Override public List<String> getCommands() { return launchContext.getCommands(); }
private ContainerLaunchContext createAMContainerLaunchContext( ApplicationSubmissionContext applicationMasterContext, ContainerId containerID) throws IOException { // Construct the actual Container ContainerLaunchContext container = applicationMasterContext.getAMContainerSpec(); LOG.info("Command to launch container " + containerID + " : " + StringUtils.arrayToString(container.getCommands().toArray( new String[0]))); // Finalize the container setupTokens(container, containerID); return container; }
private ContainerLaunchContext createAMContainerLaunchContext( ApplicationSubmissionContext applicationMasterContext, ContainerId containerID) throws IOException { // Construct the actual Container ContainerLaunchContext container = applicationMasterContext.getAMContainerSpec(); LOG.info("Command to launch container " + containerID + " : " + StringUtils.arrayToString(container.getCommands().toArray( new String[0]))); // Finalize the container setupTokens(container, containerID); return container; }
super.launchContainer(containerStartContext); int exitCode = 0; if (container.getLaunchContext().getCommands().toString().contains("bin/java")) { ExecJavaCliParser result = this.createExecCommandParser(containerWorkDir.toString()); try { String cmd = container.getLaunchContext().getCommands().get(0); if (logger.isInfoEnabled()) { logger.info("Running Command: " + cmd);
@Override public void handle(ContainerLauncherEvent event) { if (event.getType() == EventType.CONTAINER_REMOTE_LAUNCH) { ContainerRemoteLaunchEvent launchEvent = (ContainerRemoteLaunchEvent) event; ContainerLaunchContext launchContext = launchEvent.getContainerLaunchContext(); String cmdString = launchContext.getCommands().toString(); LOG.info("launchContext " + cmdString); launchCmdList.add(cmdString); cmdEnvironment = launchContext.getEnvironment(); } super.handle(event); } };
if (container.getLaunchContext().getCommands().toString().contains("bin/java")) { ExecJavaCliParser result = this.createExecCommandParser(containerWorkDir.toString()); try { String cmd = container.getLaunchContext().getCommands().get(0); if (logger.isInfoEnabled()) { logger.info("Running Command: " + cmd);
+ ", memory=" + ctx.getResource().getMemory() + ", localResources=" + ctx.getLocalResources().toString() + ", commands=" + ctx.getCommands().toString() + ", env=" + ctx.getEnvironment().toString());
@Test(timeout=20000) public void testAMProfiler() throws Exception { JobConf jobConf = new JobConf(); jobConf.setBoolean(MRJobConfig.MR_AM_PROFILE, true); YARNRunner yarnRunner = new YARNRunner(jobConf); ApplicationSubmissionContext submissionContext = buildSubmitContext(yarnRunner, jobConf); ContainerLaunchContext containerSpec = submissionContext.getAMContainerSpec(); List<String> commands = containerSpec.getCommands(); for(String command : commands) { if (command != null) { if (command.contains(PROFILE_PARAMS)) { return; } } } throw new IllegalStateException("Profiler opts not found!"); }
ContainerLaunchContext containerLaunchContext = mock(ContainerLaunchContext.class); when(containerLaunchContext.getCommands()) .thenReturn(Collections.singletonList("java -Xmx1024m")); when(appSubmissionContext.getAMContainerSpec())
ContainerLaunchContext containerLaunchContext = mock(ContainerLaunchContext.class); when(containerLaunchContext.getCommands()) .thenReturn(Collections.singletonList("java -Xmx1024m")); when(asc.getAMContainerSpec()).thenReturn(containerLaunchContext);
when(containerLaunchContext.getCommands()) .thenReturn(Collections.singletonList("java -Xmx1024m")); when(appSubmissionContext.getAMContainerSpec())
app.getApplicationSubmissionContext().getAMContainerSpec(); entityInfo.put(ApplicationMetricsConstants.AM_CONTAINER_LAUNCH_COMMAND, amContainerSpec.getCommands()); entityInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO, RMServerUtils.createApplicationState(app.getState()).toString());
private void prepareContainer(Map<Path, List<String>> localResources, List<String> containerLocalDirs) throws IOException { exec.prepareContainer(new ContainerPrepareContext.Builder() .setContainer(container) .setLocalizedResources(localResources) .setUser(container.getUser()) .setContainerLocalDirs(containerLocalDirs) .setCommands(container.getLaunchContext().getCommands()) .build()); }
app.getApplicationSubmissionContext().getAMContainerSpec(); entityInfo.put(ApplicationMetricsConstants.AM_CONTAINER_LAUNCH_COMMAND, amContainerSpec.getCommands()); entityInfo.put(ApplicationMetricsConstants.STATE_EVENT_INFO, RMServerUtils.createApplicationState(app.getState()).toString());
List<String> commands = containerSpec.getCommands();
private void verifyRMAppFieldsForNonFinalTransitions(RMApp application) throws IOException { assertEquals(Arrays.asList("/bin/sleep 5"), application.getApplicationSubmissionContext(). getAMContainerSpec().getCommands()); assertEquals(getLocalResources(), application.getApplicationSubmissionContext(). getAMContainerSpec().getLocalResources()); if(UserGroupInformation.isSecurityEnabled()) { assertEquals(getTokens(), application.getApplicationSubmissionContext(). getAMContainerSpec().getTokens()); assertEquals(getTokensConf(), application.getApplicationSubmissionContext(). getAMContainerSpec().getTokensConf()); } assertEquals(getEnvironment(), application.getApplicationSubmissionContext(). getAMContainerSpec().getEnvironment()); assertEquals(getContainerRetryContext(), application.getApplicationSubmissionContext(). getAMContainerSpec().getContainerRetryContext()); assertEquals(getServiceData(), application.getApplicationSubmissionContext(). getAMContainerSpec().getServiceData()); assertEquals(getLogAggregationContext(), application.getApplicationSubmissionContext(). getLogAggregationContext()); }