本文整理汇总了Java中org.apache.hadoop.hdfs.protocol.AclException类的典型用法代码示例。如果您正苦于以下问题:Java AclException类的具体用法?Java AclException怎么用?Java AclException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AclException类属于org.apache.hadoop.hdfs.protocol包,在下文中一共展示了AclException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: modifyAclEntries
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
public void modifyAclEntries(String src, List<AclEntry> aclSpec)
throws IOException {
checkOpen();
TraceScope scope = getPathTraceScope("modifyAclEntries", src);
try {
namenode.modifyAclEntries(src, aclSpec);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
AclException.class,
FileNotFoundException.class,
NSQuotaExceededException.class,
SafeModeException.class,
SnapshotAccessControlException.class,
UnresolvedPathException.class);
} finally {
scope.close();
}
}
示例2: removeAclEntries
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
public void removeAclEntries(String src, List<AclEntry> aclSpec)
throws IOException {
checkOpen();
TraceScope scope = Trace.startSpan("removeAclEntries", traceSampler);
try {
namenode.removeAclEntries(src, aclSpec);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
AclException.class,
FileNotFoundException.class,
NSQuotaExceededException.class,
SafeModeException.class,
SnapshotAccessControlException.class,
UnresolvedPathException.class);
} finally {
scope.close();
}
}
示例3: removeDefaultAcl
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
public void removeDefaultAcl(String src) throws IOException {
checkOpen();
TraceScope scope = Trace.startSpan("removeDefaultAcl", traceSampler);
try {
namenode.removeDefaultAcl(src);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
AclException.class,
FileNotFoundException.class,
NSQuotaExceededException.class,
SafeModeException.class,
SnapshotAccessControlException.class,
UnresolvedPathException.class);
} finally {
scope.close();
}
}
示例4: removeAcl
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
public void removeAcl(String src) throws IOException {
checkOpen();
TraceScope scope = Trace.startSpan("removeAcl", traceSampler);
try {
namenode.removeAcl(src);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
AclException.class,
FileNotFoundException.class,
NSQuotaExceededException.class,
SafeModeException.class,
SnapshotAccessControlException.class,
UnresolvedPathException.class);
} finally {
scope.close();
}
}
示例5: setAcl
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
public void setAcl(String src, List<AclEntry> aclSpec) throws IOException {
checkOpen();
TraceScope scope = Trace.startSpan("setAcl", traceSampler);
try {
namenode.setAcl(src, aclSpec);
} catch(RemoteException re) {
throw re.unwrapRemoteException(AccessControlException.class,
AclException.class,
FileNotFoundException.class,
NSQuotaExceededException.class,
SafeModeException.class,
SnapshotAccessControlException.class,
UnresolvedPathException.class);
} finally {
scope.close();
}
}
示例6: unprotectedMkdir
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
/**
* create a directory at path specified by parent
*/
private static INodesInPath unprotectedMkdir(FSDirectory fsd, long inodeId,
INodesInPath parent, byte[] name, PermissionStatus permission,
List<AclEntry> aclEntries, long timestamp)
throws QuotaExceededException, AclException, FileAlreadyExistsException {
assert fsd.hasWriteLock();
assert parent.getLastINode() != null;
if (!parent.getLastINode().isDirectory()) {
throw new FileAlreadyExistsException("Parent path is not a directory: " +
parent.getPath() + " " + DFSUtil.bytes2String(name));
}
final INodeDirectory dir = new INodeDirectory(inodeId, name, permission,
timestamp);
INodesInPath iip = fsd.addLastINode(parent, dir, true);
if (iip != null && aclEntries != null) {
AclStorage.updateINodeAcl(dir, aclEntries, Snapshot.CURRENT_STATE_ID);
}
return iip;
}
示例7: testFilterAclEntriesByAclSpec
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testFilterAclEntriesByAclSpec() throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ_WRITE))
.add(aclEntry(ACCESS, USER, "diana", READ_EXECUTE))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, GROUP, "sales", READ_EXECUTE))
.add(aclEntry(ACCESS, GROUP, "execs", READ_WRITE))
.add(aclEntry(ACCESS, MASK, ALL))
.add(aclEntry(ACCESS, OTHER, READ))
.build();
List<AclEntry> aclSpec = Lists.newArrayList(
aclEntry(ACCESS, USER, "diana"),
aclEntry(ACCESS, GROUP, "sales"));
List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ_WRITE))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, GROUP, "execs", READ_WRITE))
.add(aclEntry(ACCESS, MASK, READ_WRITE))
.add(aclEntry(ACCESS, OTHER, READ))
.build();
assertEquals(expected, filterAclEntriesByAclSpec(existing, aclSpec));
}
示例8: testFilterAclEntriesByAclSpecAccessMaskCalculated
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testFilterAclEntriesByAclSpecAccessMaskCalculated()
throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ))
.add(aclEntry(ACCESS, USER, "diana", READ_WRITE))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, MASK, READ_WRITE))
.add(aclEntry(ACCESS, OTHER, READ))
.build();
List<AclEntry> aclSpec = Lists.newArrayList(
aclEntry(ACCESS, USER, "diana"));
List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, MASK, READ))
.add(aclEntry(ACCESS, OTHER, READ))
.build();
assertEquals(expected, filterAclEntriesByAclSpec(existing, aclSpec));
}
示例9: testFilterAclEntriesByAclSpecAutomaticDefaultGroup
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testFilterAclEntriesByAclSpecAutomaticDefaultGroup()
throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, OTHER, READ))
.add(aclEntry(DEFAULT, USER, READ_WRITE))
.add(aclEntry(DEFAULT, GROUP, READ_WRITE))
.add(aclEntry(DEFAULT, OTHER, NONE))
.build();
List<AclEntry> aclSpec = Lists.newArrayList(
aclEntry(DEFAULT, GROUP));
List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, OTHER, READ))
.add(aclEntry(DEFAULT, USER, READ_WRITE))
.add(aclEntry(DEFAULT, GROUP, READ))
.add(aclEntry(DEFAULT, OTHER, NONE))
.build();
assertEquals(expected, filterAclEntriesByAclSpec(existing, aclSpec));
}
示例10: testFilterAclEntriesByAclSpecAutomaticDefaultOther
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testFilterAclEntriesByAclSpecAutomaticDefaultOther()
throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, OTHER, READ))
.add(aclEntry(DEFAULT, USER, READ_WRITE))
.add(aclEntry(DEFAULT, GROUP, READ_WRITE))
.add(aclEntry(DEFAULT, OTHER, NONE))
.build();
List<AclEntry> aclSpec = Lists.newArrayList(
aclEntry(DEFAULT, OTHER));
List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, OTHER, READ))
.add(aclEntry(DEFAULT, USER, READ_WRITE))
.add(aclEntry(DEFAULT, GROUP, READ_WRITE))
.add(aclEntry(DEFAULT, OTHER, READ))
.build();
assertEquals(expected, filterAclEntriesByAclSpec(existing, aclSpec));
}
示例11: testFilterAclEntriesByAclSpecEmptyAclSpec
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testFilterAclEntriesByAclSpecEmptyAclSpec() throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ_WRITE))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, MASK, ALL))
.add(aclEntry(ACCESS, OTHER, READ))
.add(aclEntry(DEFAULT, USER, ALL))
.add(aclEntry(DEFAULT, USER, "bruce", READ_WRITE))
.add(aclEntry(DEFAULT, GROUP, READ))
.add(aclEntry(DEFAULT, MASK, ALL))
.add(aclEntry(DEFAULT, OTHER, READ))
.build();
List<AclEntry> aclSpec = Lists.newArrayList();
assertEquals(existing, filterAclEntriesByAclSpec(existing, aclSpec));
}
示例12: testFilterAclEntriesByAclSpecRemoveDefaultMaskRequired
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test(expected=AclException.class)
public void testFilterAclEntriesByAclSpecRemoveDefaultMaskRequired()
throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, GROUP, READ))
.add(aclEntry(ACCESS, OTHER, NONE))
.add(aclEntry(DEFAULT, USER, ALL))
.add(aclEntry(DEFAULT, USER, "bruce", READ))
.add(aclEntry(DEFAULT, GROUP, READ))
.add(aclEntry(DEFAULT, MASK, ALL))
.add(aclEntry(DEFAULT, OTHER, NONE))
.build();
List<AclEntry> aclSpec = Lists.newArrayList(
aclEntry(DEFAULT, MASK));
filterAclEntriesByAclSpec(existing, aclSpec);
}
示例13: testFilterDefaultAclEntries
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testFilterDefaultAclEntries() throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ_WRITE))
.add(aclEntry(ACCESS, GROUP, READ_EXECUTE))
.add(aclEntry(ACCESS, GROUP, "sales", READ_EXECUTE))
.add(aclEntry(ACCESS, MASK, ALL))
.add(aclEntry(ACCESS, OTHER, NONE))
.add(aclEntry(DEFAULT, USER, ALL))
.add(aclEntry(DEFAULT, USER, "bruce", READ_WRITE))
.add(aclEntry(DEFAULT, GROUP, READ))
.add(aclEntry(DEFAULT, GROUP, "sales", READ_EXECUTE))
.add(aclEntry(DEFAULT, MASK, READ_WRITE))
.add(aclEntry(DEFAULT, OTHER, READ_EXECUTE))
.build();
List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ_WRITE))
.add(aclEntry(ACCESS, GROUP, READ_EXECUTE))
.add(aclEntry(ACCESS, GROUP, "sales", READ_EXECUTE))
.add(aclEntry(ACCESS, MASK, ALL))
.add(aclEntry(ACCESS, OTHER, NONE))
.build();
assertEquals(expected, filterDefaultAclEntries(existing));
}
示例14: testMergeAclEntries
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testMergeAclEntries() throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, GROUP, READ_EXECUTE))
.add(aclEntry(ACCESS, OTHER, NONE))
.build();
List<AclEntry> aclSpec = Lists.newArrayList(
aclEntry(ACCESS, USER, "bruce", ALL));
List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", ALL))
.add(aclEntry(ACCESS, GROUP, READ_EXECUTE))
.add(aclEntry(ACCESS, MASK, ALL))
.add(aclEntry(ACCESS, OTHER, NONE))
.build();
assertEquals(expected, mergeAclEntries(existing, aclSpec));
}
示例15: testMergeAclEntriesMultipleNewBeforeExisting
import org.apache.hadoop.hdfs.protocol.AclException; //导入依赖的package包/类
@Test
public void testMergeAclEntriesMultipleNewBeforeExisting()
throws AclException {
List<AclEntry> existing = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "diana", READ))
.add(aclEntry(ACCESS, GROUP, READ_EXECUTE))
.add(aclEntry(ACCESS, MASK, READ_EXECUTE))
.add(aclEntry(ACCESS, OTHER, NONE))
.build();
List<AclEntry> aclSpec = Lists.newArrayList(
aclEntry(ACCESS, USER, "bruce", READ_EXECUTE),
aclEntry(ACCESS, USER, "clark", READ_EXECUTE),
aclEntry(ACCESS, USER, "diana", READ_EXECUTE));
List<AclEntry> expected = new ImmutableList.Builder<AclEntry>()
.add(aclEntry(ACCESS, USER, ALL))
.add(aclEntry(ACCESS, USER, "bruce", READ_EXECUTE))
.add(aclEntry(ACCESS, USER, "clark", READ_EXECUTE))
.add(aclEntry(ACCESS, USER, "diana", READ_EXECUTE))
.add(aclEntry(ACCESS, GROUP, READ_EXECUTE))
.add(aclEntry(ACCESS, MASK, READ_EXECUTE))
.add(aclEntry(ACCESS, OTHER, NONE))
.build();
assertEquals(expected, mergeAclEntries(existing, aclSpec));
}