Search in sources :

Example 1 with GetDataEncryptionKeyResponseProto

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

the class ClientNamenodeProtocolServerSideTranslatorPB method getDataEncryptionKey.

@Override
public GetDataEncryptionKeyResponseProto getDataEncryptionKey(RpcController controller, GetDataEncryptionKeyRequestProto request) throws ServiceException {
    try {
        GetDataEncryptionKeyResponseProto.Builder builder = GetDataEncryptionKeyResponseProto.newBuilder();
        DataEncryptionKey encryptionKey = server.getDataEncryptionKey();
        if (encryptionKey != null) {
            builder.setDataEncryptionKey(PBHelperClient.convert(encryptionKey));
        }
        return builder.build();
    } catch (IOException e) {
        throw new ServiceException(e);
    }
}
Also used : DataEncryptionKey(org.apache.hadoop.hdfs.security.token.block.DataEncryptionKey) ServiceException(com.google.protobuf.ServiceException) GetDataEncryptionKeyResponseProto(org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDataEncryptionKeyResponseProto) IOException(java.io.IOException)

Aggregations

ServiceException (com.google.protobuf.ServiceException)1 IOException (java.io.IOException)1 GetDataEncryptionKeyResponseProto (org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDataEncryptionKeyResponseProto)1 DataEncryptionKey (org.apache.hadoop.hdfs.security.token.block.DataEncryptionKey)1