HDFS-13730. BlockReaderRemote.sendReadResult throws NPE. Contributed by Yuanbo Liu.
(cherry picked from commit 62ad9885ea8c75c134de43a3a925c76b253658e1)
This commit is contained in:
parent
f68099aa13
commit
45543ffd6a
@ -21,6 +21,7 @@
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
||||
import org.apache.hadoop.net.unix.DomainSocket;
|
||||
@ -93,7 +94,8 @@ public void close() throws IOException {
|
||||
|
||||
@Override
|
||||
public String getRemoteAddressString() {
|
||||
return socket.getRemoteSocketAddress().toString();
|
||||
SocketAddress address = socket.getRemoteSocketAddress();
|
||||
return address == null ? null : address.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
||||
import org.apache.hadoop.net.SocketInputStream;
|
||||
@ -96,7 +97,8 @@ public void close() throws IOException {
|
||||
|
||||
@Override
|
||||
public String getRemoteAddressString() {
|
||||
return socket.getRemoteSocketAddress().toString();
|
||||
SocketAddress address = socket.getRemoteSocketAddress();
|
||||
return address == null ? null : address.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user