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.
  • Loading branch information
zsxwing committed May 20, 2016
1 parent 7200e6b commit 7ad82b6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,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 @@ -605,7 +605,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 @@ -625,7 +625,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 7ad82b6

Please sign in to comment.