本文整理汇总了Java中org.apache.hadoop.fs.permission.FsAction.READ属性的典型用法代码示例。如果您正苦于以下问题:Java FsAction.READ属性的具体用法?Java FsAction.READ怎么用?Java FsAction.READ使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.hadoop.fs.permission.FsAction
的用法示例。
在下文中一共展示了FsAction.READ属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFolderMetadata
@Test
public void testFolderMetadata() throws Exception {
Path folder = new Path("/folder");
FsPermission justRead = new FsPermission(FsAction.READ, FsAction.READ,
FsAction.READ);
fs.mkdirs(folder, justRead);
HashMap<String, String> metadata = backingStore
.getMetadata(AzureBlobStorageTestAccount.toMockUri(folder));
assertNotNull(metadata);
assertEquals("true", metadata.get("hdi_isfolder"));
assertEquals(getExpectedPermissionString("r--r--r--"),
metadata.get("hdi_permission"));
}
示例2: getUpdateKeyPermissionTasks
private Collection<FsPermissionTask> getUpdateKeyPermissionTasks(DatasetConfig datasetConfig, FileSystemWrapper userFs) {
final FileUpdateKey fileUpdateKey = new FileUpdateKey();
ProtostuffIOUtil.mergeFrom(datasetConfig.getReadDefinition().getReadSignature().toByteArray(), fileUpdateKey, fileUpdateKey.getSchema());
if (fileUpdateKey.getCachedEntitiesList() == null || fileUpdateKey.getCachedEntitiesList().isEmpty()) {
return Collections.emptyList();
}
final List<FsPermissionTask> fsPermissionTasks = Lists.newArrayList();
final FsAction action;
final List<Path> batch = Lists.newArrayList();
//DX-7850 : remove once solution for maprfs is found
if (userFs.isMapRfs()) {
action = FsAction.READ;
} else {
action = FsAction.READ_EXECUTE;
}
for (FileSystemCachedEntity cachedEntity : fileUpdateKey.getCachedEntitiesList()) {
batch.add(new Path(cachedEntity.getPath()));
if (batch.size() == PERMISSION_CHECK_TASK_BATCH_SIZE) {
// make a copy of batch
fsPermissionTasks.add(new FsPermissionTask(userFs, Lists.newArrayList(batch), action));
batch.clear();
}
}
if (!batch.isEmpty()) {
fsPermissionTasks.add(new FsPermissionTask(userFs, batch, action));
}
return fsPermissionTasks;
}