Skip to content

Commit

Permalink
[SPARK-15395][Core]Use getHostString to create RpcAddress (backport f…
Browse files Browse the repository at this point in the history
…or 1.6)
  • Loading branch information
zsxwing committed May 19, 2016
1 parent fd2da7b commit 4e58119
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 4e58119

Please sign in to comment.