Skip to content

Instantly share code, notes, and snippets.

@ashkrit
Created January 27, 2019 05:40
Show Gist options
  • Save ashkrit/6fabd60e0e64ce8a7f47c48957877772 to your computer and use it in GitHub Desktop.
Save ashkrit/6fabd60e0e64ce8a7f47c48957877772 to your computer and use it in GitHub Desktop.
class StageAccumulatorListener extends SparkListener {
val log = LoggerFactory.getLogger(this.getClass.getName)
override def onStageCompleted(event: SparkListenerStageCompleted): Unit = {
log.info(s"Stage accumulator values:${event.stageInfo.name}")
event.stageInfo.accumulables.foreach { case (id, accInfo) =>
log.info(s"$id:${accInfo.name}:${accInfo.value}")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment