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
Address review comment from @vanzin
  • Loading branch information
HeartSaVioR committed Jan 10, 2019
commit 5c4ced7caaa9be2bcb3e1dec31d7253ef9be03ad
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ private[spark] object UI {
val UI_FILTERS = ConfigBuilder("spark.ui.filters")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use .toSequence too and clean up call sites a little bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. Looks like others which are used along with stringToSet can be applied. I'll see which configurations can be applied and make changes.

.doc("Comma separated list of filter class names to apply to the Spark Web UI.")
.stringConf
.createOptional
.toSequence
.createWithDefault(Nil)

val UI_ALLOW_FRAMING_FROM = ConfigBuilder("spark.ui.allowFramingFrom")
.stringConf
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/ui/JettyUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ private[spark] case class ServerInfo(
* of the chain to perform security-related functions.
*/
private def addFilters(handler: ServletContextHandler, securityMgr: SecurityManager): Unit = {
conf.get(UI_FILTERS).toSeq.flatMap(Utils.stringToSeq).foreach { filter =>
conf.get(UI_FILTERS).foreach { filter =>
logInfo(s"Adding filter to ${handler.getContextPath()}: $filter")
val oldParams = conf.getOption(s"spark.$filter.params").toSeq
.flatMap(Utils.stringToSeq)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private[spark] abstract class YarnSchedulerBackend(
filterParams != null && filterParams.nonEmpty
if (hasFilter) {
// SPARK-26255: Append user provided filters(spark.ui.filters) with yarn filter.
val allFilters = filterName + "," + conf.get(UI_FILTERS).orElse(Some("")).get
val allFilters = Seq(filterName) ++ conf.get(UI_FILTERS)
logInfo(s"Add WebUI Filter. $filterName, $filterParams, $proxyBase")

// For already installed handlers, prepend the filter.
Expand Down