本文整理匯總了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;
}