Skip to content

Commit

Permalink
Added logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin authored and aarondav committed Oct 10, 2014
1 parent c066309 commit 6afc435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import io.netty.channel.socket.nio.NioSocketChannel
import io.netty.channel.socket.oio.OioSocketChannel
import io.netty.util.internal.PlatformDependent

import org.apache.spark.SparkConf
import org.apache.spark.{Logging, SparkConf}
import org.apache.spark.util.Utils


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

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

Expand Down Expand Up @@ -102,6 +102,8 @@ class BlockClientFactory(val conf: NettyConfig) extends Closeable {
return cachedClient
}

logInfo(s"Creating new connection to $remoteHost:$remotePort")

// There is a chance two threads are creating two different clients connecting to the same host.
// But that's probably ok ...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class BlockServer(conf: NettyConfig, dataProvider: BlockDataManager)
_port = addr.getPort
// _hostName = addr.getHostName
_hostName = Utils.localHostName()

logInfo(s"Server started ${_hostName}:${_port}")
}

/** Shutdown the server. */
Expand Down

0 comments on commit 6afc435

Please sign in to comment.