You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/03/29 08:25:44 UTC

[GitHub] [incubator-kyuubi] iodone commented on a change in pull request #1853: [KYUUBI #1798] Add EventBus module to unify the distribution and subscription of Kyuubi's events

iodone commented on a change in pull request #1853:
URL: https://github.com/apache/incubator-kyuubi/pull/1853#discussion_r837195305



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala
##########
@@ -170,15 +169,37 @@ object SparkSQLEngine extends Logging {
           kyuubiConf)
         val event = EngineEvent(engine)
         info(event)
-        EventLogging.onEvent(event)
+        EventBus.post(event)
       } catch {
         case t: Throwable =>
           throw new KyuubiException(s"Failed to start SparkSQLEngine: ${t.getMessage}", t)
       }
       // Stop engine before SparkContext stopped to avoid calling a stopped SparkContext
       addShutdownHook(() => engine.stop(), SPARK_CONTEXT_SHUTDOWN_PRIORITY + 2)
-      addShutdownHook(() => eventLogging.stop(), SPARK_CONTEXT_SHUTDOWN_PRIORITY + 1)
     }
+
+    def initLoggerEventHandler(conf: KyuubiConf): Unit = {
+      conf.get(ENGINE_EVENT_LOGGERS)
+        .map(EventLoggerType.withName)
+        .foreach {
+          case EventLoggerType.SPARK =>
+            EventBus.register[KyuubiEvent](new SparkHistoryLoggingEventHandler(spark.sparkContext))
+          case EventLoggerType.JSON =>
+            val handler = SparkJsonLoggingEventHandler(
+              spark.sparkContext.applicationAttemptId.getOrElse(spark.sparkContext.applicationId),

Review comment:
       Thanks, i will resolve it ASAP




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org