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:
parent
18e731074e
commit
9385dd50c7
@ -179,6 +179,9 @@ Release 2.0.3-alpha - Unreleased
|
||||
YARN-217. Fix RMAdmin protocol description to make it work in secure mode
|
||||
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
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -124,7 +124,7 @@ public int launchContainer(Container container,
|
||||
Path appCacheDir = new Path(userdir, ContainerLocalizer.APPCACHE);
|
||||
Path appDir = new Path(appCacheDir, appIdStr);
|
||||
Path containerDir = new Path(appDir, containerIdStr);
|
||||
createDir(containerDir, dirPerm, false);
|
||||
createDir(containerDir, dirPerm, true);
|
||||
}
|
||||
|
||||
// Create the container log-dirs on all disks
|
||||
|
@ -401,23 +401,9 @@ private AMRMProtocol submitAndRegisterApplication(
|
||||
UnsupportedFileSystemException, YarnRemoteException,
|
||||
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
|
||||
.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, ByteBuffer>(), null,
|
||||
new HashMap<ApplicationAccessType, String>());
|
||||
|
Loading…
Reference in New Issue
Block a user