ContainerLaunchContext ctx = Utils.createTaskExecutorContext(flinkConf, yarnConf, env, tmParams, taskManagerConf, workingDirectory, taskManagerMainClass, LOG); assertEquals("file", ctx.getLocalResources().get("flink.jar").getResource().getScheme());
private void addAsLocalResource(Map<File, String> resources, ContainerId containerId, ContainerLaunchContext containerLaunchContext) throws IOException { for (Map.Entry<File, String> resource : resources.entrySet()) { File localFile = resource.getKey(); if (!localFile.exists() || !localFile.canRead()) { throw new IOException("Crypto material file " + localFile.getAbsolutePath() + " for container " + containerId.toString() + " does not exist or cannot be read"); } URL fileURL = URL.newInstance("file", null, -1, localFile.getAbsolutePath()); LocalResource localResource = LocalResource.newInstance(fileURL, LocalResourceType.FILE, LocalResourceVisibility.PRIVATE, localFile.length(), localFile.lastModified()); containerLaunchContext.getLocalResources().put(resource.getValue(), localResource); } }
ContainerLaunchContext launchContext = appContext.getAMContainerSpec(); Map<String, String> env = launchContext.getEnvironment(); Map<String, LocalResource> rescs = launchContext.getLocalResources(); launchContext.getLocalResources(), env, launchContext.getCommands(), null, null, null); appContext.setAMContainerSpec(amContainer);
commonContainerSpec.getLocalResources(), myEnv, commands, myServiceData, commonContainerSpec.getTokens().duplicate(), applicationACLs);
commonContainerSpec.getLocalResources(), myEnv, commands, myServiceData, commonContainerSpec.getTokens().duplicate(), applicationACLs);
commonContainerSpec.getLocalResources(), myEnv, commands, myServiceData, commonContainerSpec.getTokens().duplicate(), applicationACLs);
Map<String,LocalResource> cntrRsrc = ctxt.getLocalResources(); if (!cntrRsrc.isEmpty()) { try {
Map<String,LocalResource> cntrRsrc = ctxt.getLocalResources(); if (!cntrRsrc.isEmpty()) { try {
Map<String,LocalResource> cntrRsrc = ctxt.getLocalResources(); if (!cntrRsrc.isEmpty()) { try {
+ ", containerId=" + ctx.getContainerId() + ", memory=" + ctx.getResource().getMemory() + ", localResources=" + ctx.getLocalResources().toString() + ", commands=" + ctx.getCommands().toString() + ", env=" + ctx.getEnvironment().toString());
try { if (reInitLaunchContext != null) { resourceSet.addResources(reInitLaunchContext.getLocalResources());
Map<String,LocalResource> cntrRsrc = ctxt.getLocalResources(); if (!cntrRsrc.isEmpty()) { try { Map<LocalResourceVisibility, Collection<LocalResourceRequest>> req = container.resourceSet.addResources(ctxt.getLocalResources()); container.dispatcher.getEventHandler().handle( new ContainerLocalizationRequestEvent(container, req));
.getLocalResources().entrySet()) { if (rsrc.getValue() == null || rsrc.getValue().getResource() == null) { throw new YarnException(
.getLocalResources().entrySet()) { if (rsrc.getValue() == null || rsrc.getValue().getResource() == null) { throw new YarnException(
if (isLocalMode) { TezLocalCacheManager cacheManager = new TezLocalCacheManager( event.getContainerLaunchContext().getLocalResources(), conf );
assertEquals(environment, ctx.getEnvironment()); assertEquals(acls, ctx.getApplicationACLs()); Map<String, LocalResource> appLRs = ctx.getLocalResources(); assertTrue(appLRs.containsKey(lrKey)); LocalResource exampleLR = appLRs.get(lrKey);
assertEquals(environment, ctx.getEnvironment()); assertEquals(acls, ctx.getApplicationACLs()); Map<String, LocalResource> appLRs = ctx.getLocalResources(); assertTrue(appLRs.containsKey(lrKey)); LocalResource exampleLR = appLRs.get(lrKey);
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()); }