本文整理匯總了Java中org.apache.hadoop.fs.permission.FsAction.ALL屬性的典型用法代碼示例。如果您正苦於以下問題:Java FsAction.ALL屬性的具體用法?Java FsAction.ALL怎麽用?Java FsAction.ALL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.hadoop.fs.permission.FsAction
的用法示例。
在下文中一共展示了FsAction.ALL屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: listStatus
@Override
public FileStatus[] listStatus(Path f) throws IOException {
FsPermission perm = new FsPermission(FsAction.ALL, FsAction.READ_EXECUTE,
FsAction.READ_EXECUTE);
Path path = new Path("/foo");
FileStatus stat = new FileStatus(1000, true, 3, 1000, 0, 0, perm, "owner",
"group", path);
return new FileStatus[] { stat };
}
示例2: mkdirs
/**
* Make directory in the uri position
* @param uri target position
* @return whether success or not
* @throws IOException
*/
public static boolean mkdirs(String uri) throws IOException {
Path path = new Path(Constants.NAME_NODE + "/" + uri);
System.out.println("[mkdirs]" + path.toString());
FsPermission dirPerm = new FsPermission(FsAction.ALL,FsAction.ALL,FsAction.ALL);
Boolean flag = fs.mkdirs(path);
if( flag )
fs.setPermission(path, new FsPermission(dirPerm));
return flag;
}
示例3: genRandomPermission
/**
* @return A random FsPermission
*/
private FsPermission genRandomPermission() {
// randomly select between "rwx" and "rw-"
FsAction u = random.nextBoolean() ? FsAction.ALL : FsAction.READ_WRITE;
FsAction g = random.nextBoolean() ? FsAction.ALL : FsAction.READ_WRITE;
FsAction o = random.nextBoolean() ? FsAction.ALL : FsAction.READ_WRITE;
return new FsPermission(u, g, o);
}
示例4: changeUserGroup
private static void changeUserGroup(String user, String group)
throws IOException {
FileSystem fs = cluster.getFileSystem();
FsPermission changedPermission = new FsPermission(
FsAction.ALL, FsAction.ALL, FsAction.ALL
);
for (Path path : pathList)
if (fs.isFile(path)) {
fs.setOwner(path, user, group);
fs.setPermission(path, changedPermission);
}
}