From 1d59cc490cb46e99d1d72fe3bd0c2a396d98f2c8 Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Fri, 3 May 2019 10:14:17 -0700 Subject: [PATCH] HADOOP-16292. Refactor checkTrustAndSend in SaslDataTransferClient to make it cleaner. Contributed by Sherwood Zheng. --- .../datatransfer/sasl/SaslDataTransferClient.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferClient.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferClient.java index 8d1c7f6265..af1cec8ef1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferClient.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferClient.java @@ -169,7 +169,7 @@ public Peer peerSend(Peer peer, DataEncryptionKeyFactory encryptionKeyFactory, throws IOException { IOStreamPair ios = checkTrustAndSend(getPeerAddress(peer), peer.getOutputStream(), peer.getInputStream(), encryptionKeyFactory, - accessToken, datanodeId); + accessToken, datanodeId, null); // TODO: Consider renaming EncryptedPeer to SaslPeer. return ios != null ? new EncryptedPeer(peer, ios) : peer; } @@ -219,15 +219,6 @@ public IOStreamPair socketSend( * @return new pair of streams, wrapped after SASL negotiation * @throws IOException for any error */ - private IOStreamPair checkTrustAndSend(InetAddress addr, - OutputStream underlyingOut, InputStream underlyingIn, - DataEncryptionKeyFactory encryptionKeyFactory, - Token accessToken, DatanodeID datanodeId) - throws IOException { - return checkTrustAndSend(addr, underlyingOut, underlyingIn, - encryptionKeyFactory, accessToken, datanodeId, null); - } - private IOStreamPair checkTrustAndSend( InetAddress addr, OutputStream underlyingOut, InputStream underlyingIn, DataEncryptionKeyFactory encryptionKeyFactory,