本文整理汇总了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);
}
}