/** * Initialize the local directories for a particular user. * <ul> * <li>$local.dir/usercache/$user/appcache/$appid</li> * </ul> * @param localDirs */ void createAppDirs(List<String> localDirs, String user, String appId, String userFolder) throws IOException { boolean initAppDirStatus = false; FsPermission appperms = new FsPermission(APPDIR_PERM); for (String localDir : localDirs) { Path fullAppDir = getApplicationDir(new Path(localDir), userFolder, appId); // create $local.dir/usercache/$user/appcache/$appId try { createDir(fullAppDir, appperms, true, user); initAppDirStatus = true; } catch (IOException e) { LOG.warn("Unable to create app directory " + fullAppDir.toString(), e); } } if (!initAppDirStatus) { throw new IOException("Not able to initialize app directories " + "in any of the configured local directories for app " + appId.toString()); } }
/** * Initialize the local directories for a particular user. * <ul> * <li>$local.dir/usercache/$user/appcache/$appid</li> * </ul> * @param localDirs */ void createAppDirs(List<String> localDirs, String user, String appId) throws IOException { boolean initAppDirStatus = false; FsPermission appperms = new FsPermission(APPDIR_PERM); for (String localDir : localDirs) { Path fullAppDir = getApplicationDir(new Path(localDir), user, appId); // create $local.dir/usercache/$user/appcache/$appId try { createDir(fullAppDir, appperms, true, user); initAppDirStatus = true; } catch (IOException e) { LOG.warn("Unable to create app directory " + fullAppDir.toString(), e); } } if (!initAppDirStatus) { throw new IOException("Not able to initialize app directories " + "in any of the configured local directories for app " + appId.toString()); } }
/** * Initialize the local directories for a particular user. * <ul> * <li>$local.dir/usercache/$user/appcache/$appid</li> * </ul> * @param localDirs */ void createAppDirs(List<String> localDirs, String user, String appId) throws IOException { boolean initAppDirStatus = false; FsPermission appperms = new FsPermission(APPDIR_PERM); for (String localDir : localDirs) { Path fullAppDir = getApplicationDir(new Path(localDir), user, appId); // create $local.dir/usercache/$user/appcache/$appId try { createDir(fullAppDir, appperms, true, user); initAppDirStatus = true; } catch (IOException e) { LOG.warn("Unable to create app directory " + fullAppDir.toString(), e); } } if (!initAppDirStatus) { throw new IOException("Not able to initialize app directories " + "in any of the configured local directories for app " + appId.toString()); } }
FsPermission appperms = new FsPermission(APPDIR_PERM); for (String localDir : localDirs) { Path fullAppDir = getApplicationDir(new Path(localDir), user, appId);
Path curBase = getApplicationDir(new Path(localDir), user, appId); long space = 0L; randomPosition -= availableOnDisk[dir++]; appStorageDir = getApplicationDir(new Path(localDirs.get(dir)), user, appId);
Path curBase = getApplicationDir(new Path(localDir), user, appId); long space = 0L; randomPosition -= availableOnDisk[dir++]; appStorageDir = getApplicationDir(new Path(localDirs.get(dir)), user, appId);
Path curBase = getApplicationDir(new Path(localDir), userFolder, appId); long space = 0L; randomPosition -= availableOnDisk[dir++]; appStorageDir = getApplicationDir(new Path(localDirs.get(dir)), userFolder, appId);
Path curBase = getApplicationDir(new Path(localDir), user, appId); long space = 0L; try { int dir = pickDirectory(randomPosition, availableOnDisk); return getApplicationDir(new Path(localDirs.get(dir)), user, appId);