本文整理汇总了Java中org.apache.hadoop.hdfs.server.namenode.AclFeature类的典型用法代码示例。如果您正苦于以下问题:Java AclFeature类的具体用法?Java AclFeature怎么用?Java AclFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AclFeature类属于org.apache.hadoop.hdfs.server.namenode包,在下文中一共展示了AclFeature类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: Root
import org.apache.hadoop.hdfs.server.namenode.AclFeature; //导入依赖的package包/类
Root(INodeDirectory other) {
// Always preserve ACL, XAttr.
super(other, false, Lists.newArrayList(
Iterables.filter(Arrays.asList(other.getFeatures()), new Predicate<Feature>() {
@Override
public boolean apply(Feature input) {
if (AclFeature.class.isInstance(input)
|| XAttrFeature.class.isInstance(input)) {
return true;
}
return false;
}
}))
.toArray(new Feature[0]));
}
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:Snapshot.java
示例2: deleteSnapshotWithAclAndVerify
import org.apache.hadoop.hdfs.server.namenode.AclFeature; //导入依赖的package包/类
private void deleteSnapshotWithAclAndVerify(AclFeature aclFeature,
Path pathToCheckAcl, int totalAclFeatures) throws IOException {
hdfs.deleteSnapshot(path, snapshotName);
AclFeature afterDeleteAclFeature = FSAclBaseTest.getAclFeature(
pathToCheckAcl, cluster);
assertSame(aclFeature, afterDeleteAclFeature);
assertEquals("Reference count should remain same"
+ " even after deletion of snapshot", 1,
afterDeleteAclFeature.getRefCount());
hdfs.removeAcl(pathToCheckAcl);
assertEquals("Reference count should be 0", 0, aclFeature.getRefCount());
assertEquals("Unique ACL features should remain same", totalAclFeatures,
AclStorage.getUniqueAclFeatures().getUniqueElementsSize());
}
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:TestAclWithSnapshot.java
示例3: checkAndRemoveHdfsAcl
import org.apache.hadoop.hdfs.server.namenode.AclFeature; //导入依赖的package包/类
private void checkAndRemoveHdfsAcl(INodeAuthorizationInfo node,
boolean warn) {
AclFeature f = defaultAuthzProvider.getAclFeature(node,
Snapshot.CURRENT_STATE_ID);
if (f != null) {
defaultAuthzProvider.removeAclFeature(node);
} else {
if (warn) {
LOG.warn("### removeAclFeature is requested on {}, but it does not " +
"have any acl.", node);
}
}
}
开发者ID:apache,项目名称:incubator-sentry,代码行数:14,代码来源:SentryAuthorizationProvider.java
示例4: addAclFeature
import org.apache.hadoop.hdfs.server.namenode.AclFeature; //导入依赖的package包/类
@Override
public void addAclFeature(INodeAuthorizationInfo node, AclFeature f) {
// always fall through to defaultAuthZProvider,
// issue warning when the path is sentry managed
if (isSentryManaged(node)) {
LOG.warn("### addAclFeature {} (sentry managed path) {}, update HDFS." +
WARN_VISIBILITY,
node.getFullPathName(), f.toString());
// For Sentry-managed path, remove ACL silently before adding new ACL
checkAndRemoveHdfsAcl(node, false);
}
defaultAuthzProvider.addAclFeature(node, f);
}
开发者ID:apache,项目名称:incubator-sentry,代码行数:14,代码来源:SentryAuthorizationProvider.java
示例5: addAclFeature
import org.apache.hadoop.hdfs.server.namenode.AclFeature; //导入依赖的package包/类
@Override
public void addAclFeature(AclFeature f) {
throw new UnsupportedOperationException("ACLs are not supported on symlinks");
}
开发者ID:yncxcw,项目名称:FlexMap,代码行数:5,代码来源:INodeSymlink.java
示例6: Root
import org.apache.hadoop.hdfs.server.namenode.AclFeature; //导入依赖的package包/类
Root(INodeDirectory other) {
// Always preserve ACL.
super(other, false, Lists.newArrayList(
Iterables.filter(Arrays.asList(other.getFeatures()), AclFeature.class))
.toArray(new Feature[0]));
}
开发者ID:Seagate,项目名称:hadoop-on-lustre2,代码行数:7,代码来源:Snapshot.java
示例7: getAclFeature
import org.apache.hadoop.hdfs.server.namenode.AclFeature; //导入依赖的package包/类
@Override
public AclFeature getAclFeature(INodeAuthorizationInfo node, int snapshotId) {
AclFeature f = null;
String[] pathElements = getPathElements(node);
String p = Arrays.toString(pathElements);
boolean isPrefixed = false;
boolean isStale = false;
boolean hasAuthzObj = false;
Map<String, AclEntry> aclMap = null;
if (!authzInfo.isUnderPrefix(pathElements)) {
isPrefixed = false;
f = defaultAuthzProvider.getAclFeature(node, snapshotId);
} else if (!authzInfo.doesBelongToAuthzObject(pathElements)) {
isPrefixed = true;
f = defaultAuthzProvider.getAclFeature(node, snapshotId);
} else {
isPrefixed = true;
hasAuthzObj = true;
aclMap = new HashMap<String, AclEntry>();
if (originalAuthzAsAcl) {
String user = defaultAuthzProvider.getUser(node, snapshotId);
String group = getDefaultProviderGroup(node, snapshotId);
FsPermission perm = defaultAuthzProvider.getFsPermission(node, snapshotId);
addToACLMap(aclMap, createAclEntries(user, group, perm));
} else {
addToACLMap(aclMap,
createAclEntries(this.user, this.group, this.permission));
}
if (!authzInfo.isStale()) {
isStale = false;
addToACLMap(aclMap, authzInfo.getAclEntries(pathElements));
f = new SentryAclFeature(ImmutableList.copyOf(aclMap.values()));
} else {
isStale = true;
f = new SentryAclFeature(ImmutableList.copyOf(aclMap.values()));
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("### getAclEntry \n[" + p + "] : ["
+ "isPreifxed=" + isPrefixed
+ ", isStale=" + isStale
+ ", hasAuthzObj=" + hasAuthzObj
+ ", origAuthzAsAcl=" + originalAuthzAsAcl + "]\n"
+ "[" + (aclMap == null ? "null" : aclMap) + "]\n"
+ "[" + (f == null ? "null" : f.getEntries()) + "]\n");
}
return f;
}
开发者ID:apache,项目名称:incubator-sentry,代码行数:49,代码来源:SentryAuthorizationProvider.java
注:本文中的org.apache.hadoop.hdfs.server.namenode.AclFeature类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论