[KYUUBI #6390] Temporarily disable UI Tab for Spark 4.0 and above

# 🔍 Description

Spark 4.0 migrated from `javax.servlet` to `jakarta.servlet` in SPARK-47118, which breaks the Kyuubi UI tab.

## Describe Your Solution 🔧

Temporarily disable UI Tab for Spark 4.0 and above.

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

Build Kyuubi with Spark 3.5 and successfully launch the Spark engine with Spark 4.0.0 preview1.

<img width="1339" alt="image" src="https://github.com/apache/kyuubi/assets/26535726/34a001e5-5c70-4928-bf28-743825c0ead3">

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6390 from pan3793/ui-4.0.

Closes #6390

2abad8c35 [Cheng Pan] Temporarily disable UI Tab for Spark 4.0 and above

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
Cheng Pan 2024-05-20 17:20:38 +08:00
parent 02e1aa3063
commit 70eadc15ad
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D

View File

@ -27,7 +27,7 @@ import scala.util.control.NonFatal
import com.google.common.annotations.VisibleForTesting
import org.apache.hadoop.fs.Path
import org.apache.spark.{ui, SparkConf}
import org.apache.spark.{ui, SPARK_VERSION, SparkConf}
import org.apache.spark.kyuubi.{SparkContextHelper, SparkSQLEngineEventListener, SparkSQLEngineListener}
import org.apache.spark.kyuubi.SparkUtilsHelper.getLocalDir
import org.apache.spark.sql.SparkSession
@ -46,7 +46,7 @@ import org.apache.kyuubi.ha.HighAvailabilityConf._
import org.apache.kyuubi.ha.client.RetryPolicies
import org.apache.kyuubi.service.Serverable
import org.apache.kyuubi.session.SessionHandle
import org.apache.kyuubi.util.{SignalRegister, ThreadUtils}
import org.apache.kyuubi.util.{SemanticVersion, SignalRegister, ThreadUtils}
import org.apache.kyuubi.util.ThreadUtils.scheduleTolerableRunnableWithFixedDelay
case class SparkSQLEngine(spark: SparkSession) extends Serverable("SparkSQLEngine") {
@ -358,11 +358,15 @@ object SparkSQLEngine extends Logging {
engine.start()
val kvStore = SparkContextHelper.getKvStore(spark.sparkContext)
val store = new EngineEventsStore(kvStore)
ui.EngineTab(
Some(engine),
SparkContextHelper.getSparkUI(spark.sparkContext),
store,
kyuubiConf)
if (SemanticVersion(SPARK_VERSION) >= "4.0") {
warn("Kyuubi UI does not support Spark 4.0 and above yet")
} else {
ui.EngineTab(
Some(engine),
SparkContextHelper.getSparkUI(spark.sparkContext),
store,
kyuubiConf)
}
val event = EngineEvent(engine)
info(event)
EventBus.post(event)