HDFS-4367. GetDataEncryptionKeyResponseProto does not handle null response. Contributed by Suresh Srinivas.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1431459 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d863f7a1e4
commit
2bd35d8de3
|
@ -307,6 +307,9 @@ Release 2.0.3-alpha - Unreleased
|
||||||
HDFS-4362. GetDelegationTokenResponseProto does not handle null token.
|
HDFS-4362. GetDelegationTokenResponseProto does not handle null token.
|
||||||
(suresh)
|
(suresh)
|
||||||
|
|
||||||
|
HDFS-4367. GetDataEncryptionKeyResponseProto does not handle null
|
||||||
|
response. (suresh)
|
||||||
|
|
||||||
NEW FEATURES
|
NEW FEATURES
|
||||||
|
|
||||||
HDFS-2656. Add libwebhdfs, a pure C client based on WebHDFS.
|
HDFS-2656. Add libwebhdfs, a pure C client based on WebHDFS.
|
||||||
|
|
|
@ -839,10 +839,13 @@ public class ClientNamenodeProtocolServerSideTranslatorPB implements
|
||||||
RpcController controller, GetDataEncryptionKeyRequestProto request)
|
RpcController controller, GetDataEncryptionKeyRequestProto request)
|
||||||
throws ServiceException {
|
throws ServiceException {
|
||||||
try {
|
try {
|
||||||
|
GetDataEncryptionKeyResponseProto.Builder builder =
|
||||||
|
GetDataEncryptionKeyResponseProto.newBuilder();
|
||||||
DataEncryptionKey encryptionKey = server.getDataEncryptionKey();
|
DataEncryptionKey encryptionKey = server.getDataEncryptionKey();
|
||||||
return GetDataEncryptionKeyResponseProto.newBuilder()
|
if (encryptionKey != null) {
|
||||||
.setDataEncryptionKey(PBHelper.convert(encryptionKey))
|
builder.setDataEncryptionKey(PBHelper.convert(encryptionKey));
|
||||||
.build();
|
}
|
||||||
|
return builder.build();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ServiceException(e);
|
throw new ServiceException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDat
|
||||||
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetBlockLocationsRequestProto;
|
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetBlockLocationsRequestProto;
|
||||||
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetBlockLocationsResponseProto;
|
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetBlockLocationsResponseProto;
|
||||||
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetContentSummaryRequestProto;
|
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetContentSummaryRequestProto;
|
||||||
|
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDataEncryptionKeyResponseProto;
|
||||||
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDatanodeReportRequestProto;
|
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDatanodeReportRequestProto;
|
||||||
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDelegationTokenRequestProto;
|
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDelegationTokenRequestProto;
|
||||||
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDelegationTokenResponseProto;
|
import org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos.GetDelegationTokenResponseProto;
|
||||||
|
@ -111,7 +112,6 @@ import org.apache.hadoop.ipc.ProtocolMetaInterface;
|
||||||
import org.apache.hadoop.ipc.RPC;
|
import org.apache.hadoop.ipc.RPC;
|
||||||
import org.apache.hadoop.ipc.RpcClientUtil;
|
import org.apache.hadoop.ipc.RpcClientUtil;
|
||||||
import org.apache.hadoop.security.AccessControlException;
|
import org.apache.hadoop.security.AccessControlException;
|
||||||
import org.apache.hadoop.security.proto.SecurityProtos.TokenProto;
|
|
||||||
import org.apache.hadoop.security.token.Token;
|
import org.apache.hadoop.security.token.Token;
|
||||||
|
|
||||||
import com.google.protobuf.ByteString;
|
import com.google.protobuf.ByteString;
|
||||||
|
@ -819,8 +819,10 @@ public class ClientNamenodeProtocolTranslatorPB implements
|
||||||
GetDataEncryptionKeyRequestProto req = GetDataEncryptionKeyRequestProto
|
GetDataEncryptionKeyRequestProto req = GetDataEncryptionKeyRequestProto
|
||||||
.newBuilder().build();
|
.newBuilder().build();
|
||||||
try {
|
try {
|
||||||
return PBHelper.convert(rpcProxy.getDataEncryptionKey(null, req)
|
GetDataEncryptionKeyResponseProto rsp =
|
||||||
.getDataEncryptionKey());
|
rpcProxy.getDataEncryptionKey(null, req);
|
||||||
|
return rsp.hasDataEncryptionKey() ?
|
||||||
|
PBHelper.convert(rsp.getDataEncryptionKey()) : null;
|
||||||
} catch (ServiceException e) {
|
} catch (ServiceException e) {
|
||||||
throw ProtobufHelper.getRemoteException(e);
|
throw ProtobufHelper.getRemoteException(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,7 +443,7 @@ message GetDataEncryptionKeyRequestProto { // no parameters
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetDataEncryptionKeyResponseProto {
|
message GetDataEncryptionKeyResponseProto {
|
||||||
required DataEncryptionKeyProto dataEncryptionKey = 1;
|
optional DataEncryptionKeyProto dataEncryptionKey = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
service ClientNamenodeProtocol {
|
service ClientNamenodeProtocol {
|
||||||
|
|
Loading…
Reference in New Issue