Skip to content

Commit 6afc435

Browse files
rxinaarondav
authored andcommitted
Added logging.
1 parent c066309 commit 6afc435

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/src/main/scala/org/apache/spark/network/netty/BlockClientFactory.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import io.netty.channel.socket.nio.NioSocketChannel
3131
import io.netty.channel.socket.oio.OioSocketChannel
3232
import io.netty.util.internal.PlatformDependent
3333

34-
import org.apache.spark.SparkConf
34+
import org.apache.spark.{Logging, SparkConf}
3535
import org.apache.spark.util.Utils
3636

3737

@@ -42,7 +42,7 @@ import org.apache.spark.util.Utils
4242
* for the same remote host. It also shares a single worker thread pool for all [[BlockClient]]s.
4343
*/
4444
private[netty]
45-
class BlockClientFactory(val conf: NettyConfig) extends Closeable {
45+
class BlockClientFactory(val conf: NettyConfig) extends Logging with Closeable {
4646

4747
def this(sparkConf: SparkConf) = this(new NettyConfig(sparkConf))
4848

@@ -102,6 +102,8 @@ class BlockClientFactory(val conf: NettyConfig) extends Closeable {
102102
return cachedClient
103103
}
104104

105+
logInfo(s"Creating new connection to $remoteHost:$remotePort")
106+
105107
// There is a chance two threads are creating two different clients connecting to the same host.
106108
// But that's probably ok ...
107109

core/src/main/scala/org/apache/spark/network/netty/BlockServer.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ class BlockServer(conf: NettyConfig, dataProvider: BlockDataManager)
114114
_port = addr.getPort
115115
// _hostName = addr.getHostName
116116
_hostName = Utils.localHostName()
117+
118+
logInfo(s"Server started ${_hostName}:${_port}")
117119
}
118120

119121
/** Shutdown the server. */

0 commit comments

Comments
 (0)