Skip to content

Commit ac24c8f

Browse files
committed
[KYUUBI #1429][TASK-1] Move ui package from org.apache.spark to org.apache.spark.ui
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html 2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'. 3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'. --> ### _Why are the changes needed?_ <!-- Please clarify why the changes are needed. For instance, 1. If you add a feature, you can talk about the use case of it. 2. If you fix a bug, you can clarify why it is a bug. --> In order to compaible with both Spark-2 and Spark-3, we should respect package `ui`, since apache/spark#22645, some class cope changed from package `ui` to `spark`. ### _How was this patch tested?_ Pass CI Closes #1430 from ulysses-you/spark-2.4. Closes #1429 8b40c60 [ulysses-you] nit f875cda [ulysses-you] ui Authored-by: ulysses-you <ulyssesyou18@gmail.com> Signed-off-by: ulysses-you <ulyssesyou@apache.org>
1 parent e19d463 commit ac24c8f

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import java.util.concurrent.CountDownLatch
2222

2323
import scala.util.control.NonFatal
2424

25-
import org.apache.spark.SparkConf
25+
import org.apache.spark.{ui, SparkConf}
2626
import org.apache.spark.kyuubi.SparkSQLEngineListener
27-
import org.apache.spark.kyuubi.ui.EngineTab
2827
import org.apache.spark.sql.SparkSession
2928

3029
import org.apache.kyuubi.{KyuubiException, Logging}
@@ -134,7 +133,7 @@ object SparkSQLEngine extends Logging {
134133
}
135134
try {
136135
engine.start()
137-
EngineTab(engine)
136+
ui.EngineTab(engine)
138137
val event = EngineEvent(engine)
139138
info(event)
140139
EventLoggingService.onEvent(event)
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.spark.kyuubi.ui
18+
package org.apache.spark.ui
1919

2020
import java.net.URLEncoder
2121
import java.nio.charset.StandardCharsets.UTF_8
@@ -26,13 +26,11 @@ import scala.collection.JavaConverters.mapAsScalaMapConverter
2626
import scala.xml.{Node, Unparsed}
2727

2828
import org.apache.commons.text.StringEscapeUtils
29-
import org.apache.spark.kyuubi.ui.TableSourceUtil._
30-
import org.apache.spark.ui.{PagedDataSource, PagedTable, UIUtils, WebUIPage}
29+
import org.apache.spark.ui.TableSourceUtil._
3130
import org.apache.spark.ui.UIUtils._
3231

3332
import org.apache.kyuubi.Utils
34-
import org.apache.kyuubi.engine.spark.events.SessionEvent
35-
import org.apache.kyuubi.engine.spark.events.SparkStatementEvent
33+
import org.apache.kyuubi.engine.spark.events.{SessionEvent, SparkStatementEvent}
3634

3735
case class EnginePage(parent: EngineTab) extends WebUIPage("") {
3836
private val store = parent.engine.store
@@ -401,7 +399,7 @@ private class SessionStatsTableDataSource(
401399
case "User" => Ordering.by(_.username)
402400
case "Client IP" => Ordering.by(_.ip)
403401
case "Session ID" => Ordering.by(_.sessionId)
404-
case "Start Time" => Ordering by (_.startTime)
402+
case "Start Time" => Ordering.by(_.startTime)
405403
case "Finish Time" => Ordering.by(_.endTime)
406404
case "Duration" => Ordering.by(_.duration)
407405
case "Total Statements" => Ordering.by(_.totalOperations)
@@ -435,7 +433,7 @@ private class StatementStatsTableDataSource(
435433
val ordering: Ordering[SparkStatementEvent] = sortColumn match {
436434
case "User" => Ordering.by(_.username)
437435
case "Statement ID" => Ordering.by(_.statementId)
438-
case "Create Time" => Ordering by (_.createTime)
436+
case "Create Time" => Ordering.by(_.createTime)
439437
case "Finish Time" => Ordering.by(_.completeTime)
440438
case "Duration" => Ordering.by(_.duration)
441439
case "Statement" => Ordering.by(_.statement)
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.spark.kyuubi.ui
18+
package org.apache.spark.ui
1919

2020
import java.util.Date
2121
import javax.servlet.http.HttpServletRequest
2222

2323
import scala.xml.Node
2424

2525
import org.apache.spark.internal.Logging
26-
import org.apache.spark.ui._
2726
import org.apache.spark.ui.UIUtils._
2827
import org.apache.spark.util.Utils
2928

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.spark.kyuubi.ui
18+
package org.apache.spark.ui
1919

2020
import javax.servlet.http.HttpServletRequest
2121

2222
import scala.util.control.NonFatal
2323

24-
import org.apache.spark.ui.SparkUITab
25-
2624
import org.apache.kyuubi.{Logging, Utils}
2725
import org.apache.kyuubi.config.KyuubiConf
2826
import org.apache.kyuubi.engine.spark.SparkSQLEngine
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.spark.kyuubi.ui
18+
package org.apache.spark.ui
1919

2020
import org.apache.http.client.methods.HttpGet
2121
import org.apache.http.impl.client.HttpClients

0 commit comments

Comments
 (0)