Skip to content

Commit bed11a8

Browse files
committed
[SPARK-29087][SS] Use DelegatingServletContextHandler to avoid CCE
1 parent d334fee commit bed11a8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/src/main/scala/org/apache/spark/ui/WebUI.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,8 @@ private[spark] class DelegatingServletContextHandler(handler: ServletContextHand
236236
def filterCount(): Int = {
237237
handler.getServletHandler.getFilters.length
238238
}
239+
240+
def getContextPath(): String = {
241+
handler.getContextPath
242+
}
239243
}

streaming/src/test/scala/org/apache/spark/streaming/UISeleniumSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class UISeleniumSuite
9797

9898
val sparkUI = ssc.sparkContext.ui.get
9999

100-
sparkUI.getHandlers.count(_.getContextPath.contains("/streaming")) should be (5)
100+
sparkUI.getDelegatingHandlers.count(_.getContextPath.contains("/streaming")) should be (5)
101101

102102
eventually(timeout(10.seconds), interval(50.milliseconds)) {
103103
go to (sparkUI.webUrl.stripSuffix("/"))
@@ -198,7 +198,7 @@ class UISeleniumSuite
198198

199199
ssc.stop(false)
200200

201-
sparkUI.getHandlers.count(_.getContextPath.contains("/streaming")) should be (0)
201+
sparkUI.getDelegatingHandlers.count(_.getContextPath.contains("/streaming")) should be (0)
202202

203203
eventually(timeout(10.seconds), interval(50.milliseconds)) {
204204
go to (sparkUI.webUrl.stripSuffix("/"))

0 commit comments

Comments
 (0)