YARN-253. Fixed container-launch to not fail when there are no local resources to localize. Contributed by Tom White.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1430269 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Vinod Kumar Vavilapalli 2013-01-08 13:20:07 +00:00
parent 18e731074e
commit 9385dd50c7
3 changed files with 5 additions and 16 deletions

View File

@ -179,6 +179,9 @@ Release 2.0.3-alpha - Unreleased
YARN-217. Fix RMAdmin protocol description to make it work in secure mode YARN-217. Fix RMAdmin protocol description to make it work in secure mode
also. (Devaraj K via vinodkv) also. (Devaraj K via vinodkv)
YARN-253. Fixed container-launch to not fail when there are no local
resources to localize. (Tom White via vinodkv)
Release 2.0.2-alpha - 2012-09-07 Release 2.0.2-alpha - 2012-09-07
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -124,7 +124,7 @@ public class DefaultContainerExecutor extends ContainerExecutor {
Path appCacheDir = new Path(userdir, ContainerLocalizer.APPCACHE); Path appCacheDir = new Path(userdir, ContainerLocalizer.APPCACHE);
Path appDir = new Path(appCacheDir, appIdStr); Path appDir = new Path(appCacheDir, appIdStr);
Path containerDir = new Path(appDir, containerIdStr); Path containerDir = new Path(appDir, containerIdStr);
createDir(containerDir, dirPerm, false); createDir(containerDir, dirPerm, true);
} }
// Create the container log-dirs on all disks // Create the container log-dirs on all disks

View File

@ -401,23 +401,9 @@ public class TestContainerManagerSecurity {
UnsupportedFileSystemException, YarnRemoteException, UnsupportedFileSystemException, YarnRemoteException,
InterruptedException { InterruptedException {
// TODO: Use a resource to work around bugs. Today NM doesn't create local
// app-dirs if there are no file to download!!
String fileName = "testFile-" + appID.toString();
File testFile = new File(localDir.getAbsolutePath(), fileName);
FileWriter tmpFile = new FileWriter(testFile);
tmpFile.write("testing");
tmpFile.close();
URL testFileURL = ConverterUtils.getYarnUrlFromPath(FileContext
.getFileContext().makeQualified(
new Path(localDir.getAbsolutePath(), fileName)));
LocalResource rsrc = BuilderUtils.newLocalResource(testFileURL,
LocalResourceType.FILE, LocalResourceVisibility.PRIVATE, testFile
.length(), testFile.lastModified());
ContainerLaunchContext amContainer = BuilderUtils ContainerLaunchContext amContainer = BuilderUtils
.newContainerLaunchContext(null, "testUser", BuilderUtils .newContainerLaunchContext(null, "testUser", BuilderUtils
.newResource(1024), Collections.singletonMap(fileName, rsrc), .newResource(1024), Collections.<String, LocalResource>emptyMap(),
new HashMap<String, String>(), Arrays.asList("sleep", "100"), new HashMap<String, String>(), Arrays.asList("sleep", "100"),
new HashMap<String, ByteBuffer>(), null, new HashMap<String, ByteBuffer>(), null,
new HashMap<ApplicationAccessType, String>()); new HashMap<ApplicationAccessType, String>());