Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Feedback.
  • Loading branch information
Marcelo Vanzin committed Oct 23, 2019
commit 051ff5f719b4de083cfe922e598aedf2a1ae13bd
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ class SQLAppStatusListener(

override def onExecutorMetricsUpdate(event: SparkListenerExecutorMetricsUpdate): Unit = {
event.accumUpdates.foreach { case (taskId, stageId, attemptId, accumUpdates) =>
updateStageMetrics(stageId, attemptId, taskId, -1, accumUpdates, false)
updateStageMetrics(stageId, attemptId, taskId, SQLAppStatusListener.UNKNOWN_PARTITION,
accumUpdates, false)
}
}

Expand Down Expand Up @@ -245,7 +246,7 @@ class SQLAppStatusListener(
stageId: Int,
attemptId: Int,
taskId: Long,
partIdx: Int, // -1 if unknown from the event data.
partIdx: Int,
accumUpdates: Seq[AccumulableInfo],
succeeded: Boolean): Unit = {
Option(stageMetrics.get(stageId)).foreach { metrics =>
Expand Down Expand Up @@ -462,7 +463,7 @@ private class LiveStageMetrics(
eventPartIdx: Int,
finished: Boolean,
accumUpdates: Seq[AccumulableInfo]): Unit = {
val partIdx = if (eventPartIdx == -1) {
val partIdx = if (eventPartIdx == SQLAppStatusListener.UNKNOWN_PARTITION) {
if (!taskIndices.contains(taskId)) {
// We probably missed the start event for the task, just ignore it.
return
Expand All @@ -482,7 +483,7 @@ private class LiveStageMetrics(
.filter { acc => acc.update.isDefined && accumulatorIds.contains(acc.id) }
.foreach { acc =>
// In a live application, accumulators have Long values, but when reading from event
// logs, they have String values. For now, assume all accumulators are Long and covert
// logs, they have String values. For now, assume all accumulators are Long and convert
// accordingly.
val value = acc.update.get match {
case s: String => s.toLong
Expand All @@ -501,3 +502,7 @@ private class LiveStageMetrics(

def metricValues(): Seq[(Long, Array[Long])] = taskMetrics.asScala.toSeq
}

private object SQLAppStatusListener {
val UNKNOWN_PARTITION = -1
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,4 @@ object MetricsAggregationBenchmark extends BenchmarkBase {
case class Measurements(
taskEventsTimes: Seq[Long],
aggregationTime: Long)

}