Github user srowen commented on a diff in the pull request: https://github.com/apache/spark/pull/4828#discussion_r25558151 --- Diff: streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingTab.scala --- @@ -29,19 +29,30 @@ import StreamingTab._ */ private[spark] class StreamingTab(ssc: StreamingContext) extends SparkUITab(getSparkUI(ssc), "streaming") with Logging { - val parent = getSparkUI(ssc) - val listener = ssc.progressListener - + var listener = ssc.progressListener ssc.addStreamingListener(listener) attachPage(new StreamingPage(this)) parent.attachTab(this) } -private object StreamingTab { +private[spark] object StreamingTab { def getSparkUI(ssc: StreamingContext): SparkUI = { ssc.sc.ui.getOrElse { throw new SparkException("Parent SparkUI to attach this tab to not found!") } } + def updateOrCreateStreamingTab(ssc:StreamingContext):Option[StreamingTab]={ --- End diff -- You have some style issues here, like spaces around operators, braces, and parentheses. Have a look at other code. Also we usually write e.g. `foreach { tab =>` not `foreach(tab = {` I think the code here can be more concise and avoid `return` with a construction built around `getTabs.find(_.isInstanceOf[StreamingTab]).map(...).getOrElse(...)
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org