YARN-2682. Updated WindowsSecureContainerExecutor to not use DefaultContainerExecutor#getFirstApplicationDir and use getWorkingDir() instead. Contributed by Zhihai Xu

(cherry picked from commit 0fd0ebae64)
This commit is contained in:
Jian He 2014-10-16 18:14:34 -07:00
parent a85767f376
commit a78f1f8da8
3 changed files with 7 additions and 9 deletions

View File

@ -330,6 +330,10 @@ Release 2.6.0 - UNRELEASED
YARN-2621. Simplify the output when the user doesn't have the access for
getDomain(s). (Zhijie Shen via jianhe)
YARN-2682. Updated WindowsSecureContainerExecutor to not use
DefaultContainerExecutor#getFirstApplicationDir and use getWorkingDir()
instead. (Zhihai Xu via jianhe)
OPTIMIZATIONS
BUG FIXES

View File

@ -462,11 +462,6 @@ public class DefaultContainerExecutor extends ContainerExecutor {
* $logdir/$user/$appId */
static final short LOGDIR_PERM = (short)0710;
protected Path getFirstApplicationDir(List<String> localDirs, String user,
String appId) {
return getApplicationDir(new Path(localDirs.get(0)), user, appId);
}
private long getDiskFreeSpace(Path base) throws IOException {
return lfs.getFsStatus(base).getRemaining();
}
@ -489,7 +484,7 @@ public class DefaultContainerExecutor extends ContainerExecutor {
ContainerLocalizer.FILECACHE);
}
private Path getWorkingDir(List<String> localDirs, String user,
protected Path getWorkingDir(List<String> localDirs, String user,
String appId) throws IOException {
Path appStorageDir = null;
long totalAvailable = 0L;

View File

@ -115,9 +115,8 @@ public class WindowsSecureContainerExecutor extends DefaultContainerExecutor {
createUserCacheDirs(localDirs, user);
createAppDirs(localDirs, user, appId);
createAppLogDirs(appId, logDirs, user);
// TODO: Why pick first app dir. The same in LCE why not random?
Path appStorageDir = getFirstApplicationDir(localDirs, user, appId);
Path appStorageDir = getWorkingDir(localDirs, user, appId);
String tokenFn = String.format(ContainerLocalizer.TOKEN_FILE_NAME_FMT, locId);
Path tokenDst = new Path(appStorageDir, tokenFn);