Skip to content

Commit

Permalink
[SPARK-3973] Print call site information for broadcasts
Browse files Browse the repository at this point in the history
Its hard to debug which broadcast variables refer to what in a big codebase. Printing call site information helps in debugging.

Author: Shivaram Venkataraman <[email protected]>

Closes #2829 from shivaram/spark-broadcast-print and squashes the following commits:

cd6dbdf [Shivaram Venkataraman] Print call site information for broadcasts
  • Loading branch information
shivaram authored and JoshRosen committed Oct 17, 2014
1 parent dedace8 commit e678b9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ class SparkContext(config: SparkConf) extends Logging {
*/
def broadcast[T: ClassTag](value: T): Broadcast[T] = {
val bc = env.broadcastManager.newBroadcast[T](value, isLocal)
val callSite = getCallSite
logInfo("Created broadcast " + bc.id + " from " + callSite.shortForm)
cleaner.foreach(_.registerBroadcastForCleanup(bc))
bc
}
Expand Down

0 comments on commit e678b9f

Please sign in to comment.