HADOOP-16292. Refactor checkTrustAndSend in SaslDataTransferClient to make it cleaner. Contributed by Sherwood Zheng.
This commit is contained in:
parent
f1875b205e
commit
1d59cc490c
@ -169,7 +169,7 @@ public Peer peerSend(Peer peer, DataEncryptionKeyFactory encryptionKeyFactory,
|
|||||||
throws IOException {
|
throws IOException {
|
||||||
IOStreamPair ios = checkTrustAndSend(getPeerAddress(peer),
|
IOStreamPair ios = checkTrustAndSend(getPeerAddress(peer),
|
||||||
peer.getOutputStream(), peer.getInputStream(), encryptionKeyFactory,
|
peer.getOutputStream(), peer.getInputStream(), encryptionKeyFactory,
|
||||||
accessToken, datanodeId);
|
accessToken, datanodeId, null);
|
||||||
// TODO: Consider renaming EncryptedPeer to SaslPeer.
|
// TODO: Consider renaming EncryptedPeer to SaslPeer.
|
||||||
return ios != null ? new EncryptedPeer(peer, ios) : peer;
|
return ios != null ? new EncryptedPeer(peer, ios) : peer;
|
||||||
}
|
}
|
||||||
@ -219,15 +219,6 @@ public IOStreamPair socketSend(
|
|||||||
* @return new pair of streams, wrapped after SASL negotiation
|
* @return new pair of streams, wrapped after SASL negotiation
|
||||||
* @throws IOException for any error
|
* @throws IOException for any error
|
||||||
*/
|
*/
|
||||||
private IOStreamPair checkTrustAndSend(InetAddress addr,
|
|
||||||
OutputStream underlyingOut, InputStream underlyingIn,
|
|
||||||
DataEncryptionKeyFactory encryptionKeyFactory,
|
|
||||||
Token<BlockTokenIdentifier> accessToken, DatanodeID datanodeId)
|
|
||||||
throws IOException {
|
|
||||||
return checkTrustAndSend(addr, underlyingOut, underlyingIn,
|
|
||||||
encryptionKeyFactory, accessToken, datanodeId, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
private IOStreamPair checkTrustAndSend(
|
private IOStreamPair checkTrustAndSend(
|
||||||
InetAddress addr, OutputStream underlyingOut, InputStream underlyingIn,
|
InetAddress addr, OutputStream underlyingOut, InputStream underlyingIn,
|
||||||
DataEncryptionKeyFactory encryptionKeyFactory,
|
DataEncryptionKeyFactory encryptionKeyFactory,
|
||||||
|
Loading…
Reference in New Issue
Block a user