Search in sources :

Example 1 with AclStatusProto

use of org.apache.hadoop.hdfs.protocol.proto.AclProtos.AclStatusProto in project hadoop by apache.

the class PBHelperClient method convert.

public static AclStatus convert(GetAclStatusResponseProto e) {
    AclStatusProto r = e.getResult();
    AclStatus.Builder builder = new AclStatus.Builder();
    builder.owner(r.getOwner()).group(r.getGroup()).stickyBit(r.getSticky()).addEntries(convertAclEntry(r.getEntriesList()));
    if (r.hasPermission()) {
        builder.setPermission(convert(r.getPermission()));
    }
    return builder.build();
}
Also used : AclStatus(org.apache.hadoop.fs.permission.AclStatus) Builder(org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.LocatedBlockProto.Builder) DatanodeInfoBuilder(org.apache.hadoop.hdfs.protocol.DatanodeInfo.DatanodeInfoBuilder) AclStatusProto(org.apache.hadoop.hdfs.protocol.proto.AclProtos.AclStatusProto)

Example 2 with AclStatusProto

use of org.apache.hadoop.hdfs.protocol.proto.AclProtos.AclStatusProto in project hadoop by apache.

the class PBHelperClient method convert.

public static GetAclStatusResponseProto convert(AclStatus e) {
    AclStatusProto.Builder builder = AclStatusProto.newBuilder();
    builder.setOwner(e.getOwner()).setGroup(e.getGroup()).setSticky(e.isStickyBit()).addAllEntries(convertAclEntryProto(e.getEntries()));
    if (e.getPermission() != null) {
        builder.setPermission(convert(e.getPermission()));
    }
    AclStatusProto r = builder.build();
    return GetAclStatusResponseProto.newBuilder().setResult(r).build();
}
Also used : AclStatusProto(org.apache.hadoop.hdfs.protocol.proto.AclProtos.AclStatusProto)

Aggregations

AclStatusProto (org.apache.hadoop.hdfs.protocol.proto.AclProtos.AclStatusProto)2 AclStatus (org.apache.hadoop.fs.permission.AclStatus)1 DatanodeInfoBuilder (org.apache.hadoop.hdfs.protocol.DatanodeInfo.DatanodeInfoBuilder)1 Builder (org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.LocatedBlockProto.Builder)1