Search in sources :

Example 1 with GetEZForPathRequestProto

use of org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.GetEZForPathRequestProto in project hadoop by apache.

the class ClientNamenodeProtocolTranslatorPB method getEZForPath.

@Override
public EncryptionZone getEZForPath(String src) throws IOException {
    final GetEZForPathRequestProto.Builder builder = GetEZForPathRequestProto.newBuilder();
    builder.setSrc(src);
    final GetEZForPathRequestProto req = builder.build();
    try {
        final EncryptionZonesProtos.GetEZForPathResponseProto response = rpcProxy.getEZForPath(null, req);
        if (response.hasZone()) {
            return PBHelperClient.convert(response.getZone());
        } else {
            return null;
        }
    } catch (ServiceException e) {
        throw ProtobufHelper.getRemoteException(e);
    }
}
Also used : GetEZForPathRequestProto(org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.GetEZForPathRequestProto) ServiceException(com.google.protobuf.ServiceException)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 GetEZForPathRequestProto (org.apache.hadoop.hdfs.protocol.proto.EncryptionZonesProtos.GetEZForPathRequestProto)1