From 06f4ce43e167cc88f1782076e88e9e4cd2d57fc6 Mon Sep 17 00:00:00 2001 From: yangjie01 Date: Sat, 19 Feb 2022 08:54:35 -0600 Subject: [PATCH] [SPARK-38175][CORE][FOLLOWUP] Remove `urlPattern` from `HistoryAppStatusStore#replaceLogUrls` method signature ### What changes were proposed in this pull request? This pr is a followup of SPARK-38175 to remove `urlPattern` from `HistoryAppStatusStore#replaceLogUrls` method signature ### Why are the changes needed? Cleanup unused symbol. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Pass GA Closes #35567 from LuciferYang/SPARK-38175-FOLLOWUP. Authored-by: yangjie01 Signed-off-by: Sean Owen --- .../deploy/history/HistoryAppStatusStore.scala | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/deploy/history/HistoryAppStatusStore.scala b/core/src/main/scala/org/apache/spark/deploy/history/HistoryAppStatusStore.scala index ac0f102d81a6a..d86243df7163f 100644 --- a/core/src/main/scala/org/apache/spark/deploy/history/HistoryAppStatusStore.scala +++ b/core/src/main/scala/org/apache/spark/deploy/history/HistoryAppStatusStore.scala @@ -44,21 +44,23 @@ private[spark] class HistoryAppStatusStore( override def executorList(activeOnly: Boolean): Seq[v1.ExecutorSummary] = { val execList = super.executorList(activeOnly) - logUrlPattern match { - case Some(pattern) => execList.map(replaceLogUrls(_, pattern)) - case None => execList + if (logUrlPattern.nonEmpty) { + execList.map(replaceLogUrls) + } else { + execList } } override def executorSummary(executorId: String): v1.ExecutorSummary = { val execSummary = super.executorSummary(executorId) - logUrlPattern match { - case Some(pattern) => replaceLogUrls(execSummary, pattern) - case None => execSummary + if (logUrlPattern.nonEmpty) { + replaceLogUrls(execSummary) + } else { + execSummary } } - private def replaceLogUrls(exec: v1.ExecutorSummary, urlPattern: String): v1.ExecutorSummary = { + private def replaceLogUrls(exec: v1.ExecutorSummary): v1.ExecutorSummary = { val newLogUrlMap = logUrlHandler.applyPattern(exec.executorLogs, exec.attributes) replaceExecutorLogs(exec, newLogUrlMap) }