Skip to content

Commit 3e059b0

Browse files
author
Ilya Ganelin
committed
Switched to using getorelse
1 parent b946d08 commit 3e059b0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/src/main/scala/org/apache/spark/shuffle/sort/SortShuffleWriter.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,10 @@ private[spark] class SortShuffleWriter[K, V, C](
9090
if (sorter != null) {
9191
val startTime = System.nanoTime()
9292
sorter.stop()
93-
context.taskMetrics().shuffleWriteMetrics match {
94-
case Some(metrics : ShuffleWriteMetrics) =>
93+
context.taskMetrics().shuffleWriteMetrics.getOrElse({
94+
metrics : ShuffleWriteMetrics =>
9595
metrics.incShuffleWriteTime(System.nanoTime()-startTime)
96-
case None => Nil
97-
}
96+
},Nil)
9897
sorter = null
9998
}
10099
}

0 commit comments

Comments
 (0)