Skip to content

Commit

Permalink
Merge pull request apache#295 from markhamstra/JobProgressListenerNPE
Browse files Browse the repository at this point in the history
Avoid a lump of coal (NPE) in JobProgressListener's stocking.
  • Loading branch information
mateiz committed Dec 27, 2013
2 parents e240bad + c529dce commit 5e69fc5
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,9 @@ private[spark] class JobProgressListener(val sc: SparkContext) extends SparkList
// update duration
y.taskTime += taskEnd.taskInfo.duration

taskEnd.taskMetrics.shuffleReadMetrics.foreach { shuffleRead =>
y.shuffleRead += shuffleRead.remoteBytesRead
}

taskEnd.taskMetrics.shuffleWriteMetrics.foreach { shuffleWrite =>
y.shuffleWrite += shuffleWrite.shuffleBytesWritten
Option(taskEnd.taskMetrics).foreach { taskMetrics =>
taskMetrics.shuffleReadMetrics.foreach { y.shuffleRead += _.remoteBytesRead }
taskMetrics.shuffleWriteMetrics.foreach { y.shuffleWrite += _.shuffleBytesWritten }
}
}
case _ => {}
Expand Down

0 comments on commit 5e69fc5

Please sign in to comment.