Skip to content

Commit ee6543f

Browse files
committed
Minor changes based on Andrew's comments.
1 parent fa760fe commit ee6543f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private[ui] class StreamingPage(parent: StreamingTab)
8585
val headerRow = Seq(
8686
"Receiver",
8787
"Location",
88-
s"Records in last batch",
88+
"Records in last batch",
8989
"Minimum rate\n[records/sec]",
9090
"25th percentile rate\n[records/sec]",
9191
"Median rate\n[records/sec]",
@@ -102,8 +102,7 @@ private[ui] class StreamingPage(parent: StreamingTab)
102102
}.getOrElse {
103103
Seq(emptyCellTest, emptyCellTest, emptyCellTest, emptyCellTest, emptyCellTest)
104104
}
105-
Seq(receiverName, receiverLocation, receiverLastBatchRecords) ++
106-
receivedRecordStats
105+
Seq(receiverName, receiverLocation, receiverLastBatchRecords) ++ receivedRecordStats
107106
}
108107
Some(listingTable(headerRow, dataRows, fixedWidth = true))
109108
} else {
@@ -225,15 +224,18 @@ private[ui] class StreamingPage(parent: StreamingTab)
225224
day -> s"$hourString $minuteString $secondString",
226225
week -> s"$dayString $hourString $minuteString",
227226
year -> s"$weekString $dayString $hourString"
228-
).foreach {
229-
case (durationLimit, durationString) if (ms < durationLimit) =>
227+
).foreach { case (durationLimit, durationString) =>
228+
if (ms < durationLimit) {
229+
// if time is less than the limit (upto year)
230230
return durationString
231-
case e: Any => // matcherror is thrown without this
231+
}
232232
}
233+
// if time is more than a year
233234
return s"$yearString $weekString $dayString"
234235
} catch {
235236
case e: Exception =>
236237
logError("Error converting time to string", e)
238+
// if there is some error, return blank string
237239
return ""
238240
}
239241
}

0 commit comments

Comments
 (0)