HDFS-13730. BlockReaderRemote.sendReadResult throws NPE. Contributed by Yuanbo Liu.
(cherry picked from commit62ad9885ea
) (cherry picked from commit45543ffd6a
) (cherry picked from commitfc8983a5b8
) (cherry picked from commit79f8e4d5bc
)
This commit is contained in:
parent
73a59b2c42
commit
ce49f8a5df
|
@ -21,6 +21,7 @@ import java.io.IOException;
|
|||
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 class BasicInetPeer implements Peer {
|
|||
|
||||
@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.IOException;
|
|||
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 class NioInetPeer implements Peer {
|
|||
|
||||
@Override
|
||||
public String getRemoteAddressString() {
|
||||
return socket.getRemoteSocketAddress().toString();
|
||||
SocketAddress address = socket.getRemoteSocketAddress();
|
||||
return address == null ? null : address.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue