Search in sources :

Example 1 with GetAclStatusRequestProto

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

the class ClientNamenodeProtocolTranslatorPB method getAclStatus.

@Override
public AclStatus getAclStatus(String src) throws IOException {
    GetAclStatusRequestProto req = GetAclStatusRequestProto.newBuilder().setSrc(src).build();
    try {
        if (Client.isAsynchronousMode()) {
            rpcProxy.getAclStatus(null, req);
            final AsyncGet<Message, Exception> asyncReturnMessage = ProtobufRpcEngine.getAsyncReturnMessage();
            final AsyncGet<AclStatus, Exception> asyncGet = new AsyncGet<AclStatus, Exception>() {

                @Override
                public AclStatus get(long timeout, TimeUnit unit) throws Exception {
                    return PBHelperClient.convert((GetAclStatusResponseProto) asyncReturnMessage.get(timeout, unit));
                }

                @Override
                public boolean isDone() {
                    return asyncReturnMessage.isDone();
                }
            };
            AsyncCallHandler.setLowerLayerAsyncReturn(asyncGet);
            return null;
        } else {
            return PBHelperClient.convert(rpcProxy.getAclStatus(null, req));
        }
    } catch (ServiceException e) {
        throw ProtobufHelper.getRemoteException(e);
    }
}
Also used : Message(com.google.protobuf.Message) AclStatus(org.apache.hadoop.fs.permission.AclStatus) ServiceException(com.google.protobuf.ServiceException) GetAclStatusRequestProto(org.apache.hadoop.hdfs.protocol.proto.AclProtos.GetAclStatusRequestProto) AsyncGet(org.apache.hadoop.util.concurrent.AsyncGet) TimeUnit(java.util.concurrent.TimeUnit) IOException(java.io.IOException) ServiceException(com.google.protobuf.ServiceException)

Aggregations

Message (com.google.protobuf.Message)1 ServiceException (com.google.protobuf.ServiceException)1 IOException (java.io.IOException)1 TimeUnit (java.util.concurrent.TimeUnit)1 AclStatus (org.apache.hadoop.fs.permission.AclStatus)1 GetAclStatusRequestProto (org.apache.hadoop.hdfs.protocol.proto.AclProtos.GetAclStatusRequestProto)1 AsyncGet (org.apache.hadoop.util.concurrent.AsyncGet)1