Search in sources :

Example 1 with MkdirsRequestProto

use of org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.MkdirsRequestProto in project hadoop by apache.

the class ClientNamenodeProtocolTranslatorPB method mkdirs.

@Override
public boolean mkdirs(String src, FsPermission masked, boolean createParent) throws IOException {
    MkdirsRequestProto.Builder builder = MkdirsRequestProto.newBuilder().setSrc(src).setMasked(PBHelperClient.convert(masked)).setCreateParent(createParent);
    FsPermission unmasked = masked.getUnmasked();
    if (unmasked != null) {
        builder.setUnmasked(PBHelperClient.convert(unmasked));
    }
    MkdirsRequestProto req = builder.build();
    try {
        return rpcProxy.mkdirs(null, req).getResult();
    } catch (ServiceException e) {
        throw ProtobufHelper.getRemoteException(e);
    }
}
Also used : MkdirsRequestProto(org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.MkdirsRequestProto) ServiceException(com.google.protobuf.ServiceException) FsPermission(org.apache.hadoop.fs.permission.FsPermission)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 FsPermission (org.apache.hadoop.fs.permission.FsPermission)1 MkdirsRequestProto (org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.MkdirsRequestProto)1