Java 类org.apache.hadoop.hdfs.protocol.FsPermissionExtension 实例源码

项目:hadoop    文件:FSAclBaseTest.java   
@Test
public void testSetPermissionCannotSetAclBit() throws IOException {
  FileSystem.mkdirs(fs, path, FsPermission.createImmutable((short)0750));
  fs.setPermission(path, FsPermission.createImmutable((short)0700));
  assertPermission((short)0700);
  fs.setPermission(path,
    new FsPermissionExtension(FsPermission.
        createImmutable((short)0755), true, true));
  INode inode = cluster.getNamesystem().getFSDirectory().getINode(
      path.toUri().getPath(), false);
  assertNotNull(inode);
  FsPermission perm = inode.getFsPermission();
  assertNotNull(perm);
  assertEquals(0755, perm.toShort());
  assertEquals(0755, perm.toExtendedShort());
  assertAclFeature(false);
}
项目:aliyun-oss-hadoop-fs    文件:FSAclBaseTest.java   
@Test
public void testSetPermissionCannotSetAclBit() throws IOException {
  FileSystem.mkdirs(fs, path, FsPermission.createImmutable((short)0750));
  fs.setPermission(path, FsPermission.createImmutable((short)0700));
  assertPermission((short)0700);
  fs.setPermission(path,
    new FsPermissionExtension(FsPermission.
        createImmutable((short)0755), true, true));
  INode inode = cluster.getNamesystem().getFSDirectory().getINode(
      path.toUri().getPath(), false);
  assertNotNull(inode);
  FsPermission perm = inode.getFsPermission();
  assertNotNull(perm);
  assertEquals(0755, perm.toShort());
  assertEquals(0755, perm.toExtendedShort());
  assertAclFeature(false);
}
项目:big-c    文件:FSAclBaseTest.java   
@Test
public void testSetPermissionCannotSetAclBit() throws IOException {
  FileSystem.mkdirs(fs, path, FsPermission.createImmutable((short)0750));
  fs.setPermission(path, FsPermission.createImmutable((short)0700));
  assertPermission((short)0700);
  fs.setPermission(path,
    new FsPermissionExtension(FsPermission.
        createImmutable((short)0755), true, true));
  INode inode = cluster.getNamesystem().getFSDirectory().getINode(
      path.toUri().getPath(), false);
  assertNotNull(inode);
  FsPermission perm = inode.getFsPermission();
  assertNotNull(perm);
  assertEquals(0755, perm.toShort());
  assertEquals(0755, perm.toExtendedShort());
  assertAclFeature(false);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSAclBaseTest.java   
@Test
public void testSetPermissionCannotSetAclBit() throws IOException {
  FileSystem.mkdirs(fs, path, FsPermission.createImmutable((short)0750));
  fs.setPermission(path, FsPermission.createImmutable((short)0700));
  assertPermission((short)0700);
  fs.setPermission(path,
    new FsPermissionExtension(FsPermission.
        createImmutable((short)0755), true, true));
  INode inode = cluster.getNamesystem().getFSDirectory().getNode(
    path.toUri().getPath(), false);
  assertNotNull(inode);
  FsPermission perm = inode.getFsPermission();
  assertNotNull(perm);
  assertEquals(0755, perm.toShort());
  assertEquals(0755, perm.toExtendedShort());
  assertAclFeature(false);
}
项目:FlexMap    文件:FSAclBaseTest.java   
@Test
public void testSetPermissionCannotSetAclBit() throws IOException {
  FileSystem.mkdirs(fs, path, FsPermission.createImmutable((short)0750));
  fs.setPermission(path, FsPermission.createImmutable((short)0700));
  assertPermission((short)0700);
  fs.setPermission(path,
    new FsPermissionExtension(FsPermission.
        createImmutable((short)0755), true, true));
  INode inode = cluster.getNamesystem().getFSDirectory().getNode(
    path.toUri().getPath(), false);
  assertNotNull(inode);
  FsPermission perm = inode.getFsPermission();
  assertNotNull(perm);
  assertEquals(0755, perm.toShort());
  assertEquals(0755, perm.toExtendedShort());
  assertAclFeature(false);
}
项目:aliyun-oss-hadoop-fs    文件:JsonUtilClient.java   
/** Convert a string to a FsPermission object. */
static FsPermission toFsPermission(
    final String s, Boolean aclBit, Boolean encBit) {
  FsPermission perm = new FsPermission(Short.parseShort(s, 8));
  final boolean aBit = (aclBit != null) ? aclBit : false;
  final boolean eBit = (encBit != null) ? encBit : false;
  if (aBit || eBit) {
    return new FsPermissionExtension(perm, aBit, eBit);
  } else {
    return perm;
  }
}
项目:hadoop    文件:PBHelper.java   
public static FsPermission convert(FsPermissionProto p) {
  return new FsPermissionExtension((short)p.getPerm());
}
项目:aliyun-oss-hadoop-fs    文件:PBHelperClient.java   
public static FsPermission convert(FsPermissionProto p) {
  return new FsPermissionExtension((short)p.getPerm());
}
项目:big-c    文件:PBHelper.java   
public static FsPermission convert(FsPermissionProto p) {
  return new FsPermissionExtension((short)p.getPerm());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static FsPermission convert(FsPermissionProto p) {
  return new FsPermissionExtension((short)p.getPerm());
}
项目:FlexMap    文件:PBHelper.java   
public static FsPermission convert(FsPermissionProto p) {
  return new FsPermissionExtension((short)p.getPerm());
}