Example usage for org.apache.hadoop.fs.permission AclEntryType MASK

List of usage examples for org.apache.hadoop.fs.permission AclEntryType MASK

Introduction

In this page you can find the example usage for org.apache.hadoop.fs.permission AclEntryType MASK.

Prototype

AclEntryType MASK

To view the source code for org.apache.hadoop.fs.permission AclEntryType MASK.

Click Source Link

Document

An ACL mask entry.

Usage

From source file:alluxio.underfs.hdfs.acl.SupportedHdfsAclProvider.java

License:Apache License

/**
 * @param aclEntry an alluxio acl entry/*from  ww w.j a  v  a 2  s.co  m*/
 * @return hdfs acl entry type
 */
private AclEntryType getHdfsAclEntryType(alluxio.security.authorization.AclEntry aclEntry) throws IOException {
    switch (aclEntry.getType()) {
    case OWNING_USER:
    case NAMED_USER:
        return AclEntryType.USER;
    case OWNING_GROUP:
    case NAMED_GROUP:
        return AclEntryType.GROUP;
    case MASK:
        return AclEntryType.MASK;
    case OTHER:
        return AclEntryType.OTHER;
    default:
        throw new IOException("Unknown Alluxio ACL entry type: " + aclEntry.getType());
    }
}

From source file:alluxio.underfs.hdfs.acl.SupportedHdfsAclProvider.java

License:Apache License

/**
 * @param entry an hdfs acl entry/*from ww w .j  a  va2 s  .co  m*/
 * @return alluxio acl entry type
 */
private alluxio.security.authorization.AclEntryType getAclEntryType(AclEntry entry) throws IOException {
    switch (entry.getType()) {
    case USER:
        return entry.getName() == null || entry.getName().isEmpty()
                ? alluxio.security.authorization.AclEntryType.OWNING_USER
                : alluxio.security.authorization.AclEntryType.NAMED_USER;
    case GROUP:
        return entry.getName() == null || entry.getName().isEmpty()
                ? alluxio.security.authorization.AclEntryType.OWNING_GROUP
                : alluxio.security.authorization.AclEntryType.NAMED_GROUP;
    case MASK:
        return alluxio.security.authorization.AclEntryType.MASK;
    case OTHER:
        return alluxio.security.authorization.AclEntryType.OTHER;
    default:
        throw new IOException("Unknown HDFS ACL entry type: " + entry.getType());
    }
}

From source file:org.trustedanalytics.samples.utils.FsPermissionHelper.java

License:Apache License

public static List<AclEntry> getDefaultAclsForTechnicalUsers(List<String> users, FsAction fsAction) {
    List<AclEntry> acls = users.stream()
            .map(name -> getAcl(AclEntryScope.DEFAULT, fsAction, AclEntryType.USER, name)).collect(toList());
    acls.add(getAcl(AclEntryScope.DEFAULT, FsAction.ALL, AclEntryType.GROUP));
    acls.add(getAcl(AclEntryScope.DEFAULT, FsAction.ALL, AclEntryType.MASK));
    return acls;/* w w  w .  ja va2s  .c  om*/
}

From source file:org.trustedanalytics.samples.utils.FsPermissionHelper.java

License:Apache License

public static List<AclEntry> getAclsForTechnicalUsers(List<String> users, FsAction fsAction) {
    List<AclEntry> acls = users.stream()
            .map(name -> getAcl(AclEntryScope.ACCESS, fsAction, AclEntryType.USER, name)).collect(toList());
    acls.add(getAcl(AclEntryScope.ACCESS, FsAction.ALL, AclEntryType.GROUP));
    acls.add(getAcl(AclEntryScope.ACCESS, FsAction.ALL, AclEntryType.MASK));
    return acls;//from   w ww . java 2  s. com
}