Skip to content

Commit c4e7f61

Browse files
author
Marcelo Vanzin
committed
Feedback.
1 parent e22bceb commit c4e7f61

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

core/src/main/scala/org/apache/spark/status/AppStatusStore.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ private[spark] class AppStatusStore(
171171
// If there are no missing quantiles, return the data. Otherwise, just compute everything
172172
// to make the code simpler.
173173
if (cachedQuantiles.size == quantiles.size) {
174-
def toValues(fn: CachedQuantile => Double): IndexedSeq[Double] = {
175-
cachedQuantiles.map(fn).toIndexedSeq
176-
}
174+
def toValues(fn: CachedQuantile => Double): IndexedSeq[Double] = cachedQuantiles.map(fn)
177175

178176
val distributions = new v1.TaskMetricDistributions(
179177
quantiles = quantiles,
@@ -342,7 +340,7 @@ private[spark] class AppStatusStore(
342340
*/
343341
private def shouldCacheQuantile(q: Double): Boolean = ((q * 100).toInt % 5) == 0
344342

345-
private def quantileToString(q: Double): String = (q * 100).toInt.toString
343+
private def quantileToString(q: Double): String = math.round(q * 100).toString
346344

347345
def taskList(stageId: Int, stageAttemptId: Int, maxTasks: Int): Seq[v1.TaskData] = {
348346
val stageKey = Array(stageId, stageAttemptId)

0 commit comments

Comments
 (0)