Skip to content

Commit

Permalink
[SPARK-15395][CORE] Use getHostString to create RpcAddress (backport …
Browse files Browse the repository at this point in the history
…for 1.6)

## What changes were proposed in this pull request?

Backport apache#13185 to branch 1.6.

## How was this patch tested?

Jenkins unit tests.

Author: Shixiong Zhu <[email protected]>

Closes apache#13196 from zsxwing/host-string-1.6.

(cherry picked from commit 7ad82b6)
  • Loading branch information
zsxwing authored and zzcclp committed May 21, 2016
1 parent 813a6b0 commit 21df3bb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ private[netty] class NettyRpcHandler(
private def internalReceive(client: TransportClient, message: ByteBuffer): RequestMessage = {
val addr = client.getChannel().remoteAddress().asInstanceOf[InetSocketAddress]
assert(addr != null)
val clientAddr = RpcAddress(addr.getHostName, addr.getPort)
val clientAddr = RpcAddress(addr.getHostString, addr.getPort)
if (clients.putIfAbsent(client, JBoolean.TRUE) == null) {
dispatcher.postToAll(RemoteProcessConnected(clientAddr))
}
Expand All @@ -609,7 +609,7 @@ private[netty] class NettyRpcHandler(
override def exceptionCaught(cause: Throwable, client: TransportClient): Unit = {
val addr = client.getChannel.remoteAddress().asInstanceOf[InetSocketAddress]
if (addr != null) {
val clientAddr = RpcAddress(addr.getHostName, addr.getPort)
val clientAddr = RpcAddress(addr.getHostString, addr.getPort)
dispatcher.postToAll(RemoteProcessConnectionError(cause, clientAddr))
// If the remove RpcEnv listens to some address, we should also fire a
// RemoteProcessConnectionError for the remote RpcEnv listening address
Expand All @@ -629,7 +629,7 @@ private[netty] class NettyRpcHandler(
val addr = client.getChannel.remoteAddress().asInstanceOf[InetSocketAddress]
if (addr != null) {
clients.remove(client)
val clientAddr = RpcAddress(addr.getHostName, addr.getPort)
val clientAddr = RpcAddress(addr.getHostString, addr.getPort)
nettyEnv.removeOutbox(clientAddr)
dispatcher.postToAll(RemoteProcessDisconnected(clientAddr))
val remoteEnvAddress = remoteAddresses.remove(clientAddr)
Expand Down

0 comments on commit 21df3bb

Please sign in to comment.