You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/07/16 02:50:28 UTC

[GitHub] [incubator-kyuubi] zhang1002 opened a new pull request #814: Event Tracking: For jonInfo

zhang1002 opened a new pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814


   ### _Why are the changes needed?_
   
   Store all jobInfos for each statement in mem.
   And you can get all jobInfos by given statement, also you can get all stageInfos by given job.
   
   Some interfaces:
   - KyuubiJobInfo: job's summary info
   - KyuubiStatementListener: singleton pattern, used for getting metrics about job, stage, executor and so on.
   
   Feature:
   - store all jobs' info for each statement in mem
   
   Test case:
   externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/KyuubiStatementMonitorSuite.scala
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671835090



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       1 if you do not use it yet,DO not do this.
   2 The StatsReportListener’s logging is already there,DO not duplicate it
   




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671966277



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/kyuubi/SparkSQLEngineListener.scala
##########
@@ -63,8 +66,19 @@ class SparkSQLEngineListener(server: Serverable) extends SparkListener with Logg
     }
   }
 
+  override def onJobStart(jobStart: SparkListenerJobStart): Unit = {
+    val statementId = jobStart.properties.getProperty(KYUUBI_STATEMENT_ID_KEY)
+    val kyuubiJobInfo = KyuubiJobInfo(
+      jobStart.jobId, statementId, jobStart.stageIds, jobStart.time)
+    KyuubiStatementMonitor.putJobInfoIntoMap(kyuubiJobInfo)
+    info(s"Add jobStartInfo. Query [$statementId]: Job ${jobStart.jobId} started with " +
+      s"${jobStart.stageIds.length} stages")
+  }
+
   override def onJobEnd(jobEnd: SparkListenerJobEnd): Unit = {
-   jobEnd.jobResult match {
+    KyuubiStatementMonitor.insertEndTimeAndJobResult(jobEnd)
+    info(s"Job end. Job ${jobEnd.jobId} state is ${jobEnd.jobResult.toString}")

Review comment:
       debug is enough
   
   




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671839882



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       FYI, StatsReportListener is inherited by SQLOperationListener already, we currently used it for logging in both the operation log  and the engine log, if it is involved here again, we are going to produce completely duplicated logs




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-882427836


   thanks, merged to master


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671835090



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       why?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
zhang1002 commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671824750



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       In my listener, i don't care about engine.
   I think engine and statement should have different listener.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
zhang1002 commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670935591



##########
File path: kyuubi-common/src/main/scala/org/apache/kyuubi/operation/AbstractOperation.scala
##########
@@ -162,3 +162,9 @@ abstract class AbstractOperation(opType: OperationType, session: Session)
     }
   }
 }
+
+object AbstractOperation {

Review comment:
       e... forget to change the name.
   Is ok to named OperationFieldKey in this class?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.57%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5116           
     Branches          ?      641           
   =========================================
     Hits              ?     4020           
     Misses            ?      745           
     Partials          ?      351           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...7d8ece2](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
zhang1002 commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671818711



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       I don't think it's a good idea, even though we add them into sparkContext in the same time.
   First, event granularity is different. In KyuubiStatementListener, i don't care about this engine(SparkSQLEngineListener is for engine level), the listener is used for getting metrics about job, stage, executor for each statement.
   Second,  i used StatsReportListener as parent class.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
zhang1002 commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671823793



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       In StatsReportListener's code comment, it says "Simple SparkListener that logs a few summary statistics when each stage completes." I think i can use them...




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671966769



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/KyuubiStatementMonitorSuite.scala
##########
@@ -76,6 +78,46 @@ class KyuubiStatementMonitorSuite extends WithSparkSQLEngine with HiveJDBCTests
     }
   }
 
+  test("add kyuubiJobInfo into queue and remove them when threshold reached") {
+    val sql = "select timestamp'2021-06-01'"
+    val getJobMap = PrivateMethod[
+      ConcurrentHashMap[Int, KyuubiJobInfo]](Symbol("kyuubiJobIdToJobInfoMap"))()
+
+    val jobIdToJobInfoMap = KyuubiStatementMonitor.invokePrivate(getJobMap)
+    jobIdToJobInfoMap.clear()
+    withSessionHandle { (client, handle) =>
+      val req = new TExecuteStatementReq()
+      req.setSessionHandle(handle)
+      req.setStatement(sql)
+      val tExecuteStatementResp = client.ExecuteStatement(req)
+      val opHandle = tExecuteStatementResp.getOperationHandle
+
+      eventually(timeout(10.seconds), interval(100.milliseconds)) {
+        val elements = jobIdToJobInfoMap.elements()
+        while (elements.hasMoreElements) {
+          val kyuubiJobInfo = elements.nextElement()
+          assert(jobIdToJobInfoMap.size() === 1)
+          assert(kyuubiJobInfo.statementId === OperationHandle(opHandle).identifier.toString)
+          assert(kyuubiJobInfo.stageIds.length === 1)
+          assert(kyuubiJobInfo.jobResult === JobSucceeded)
+          assert(kyuubiJobInfo.endTime !== 0)
+        }
+      }
+
+      // Test for clear kyuubiJobIdToJobInfoMap when threshold reached
+      // This function is used for avoiding mem leak
+      for ( a <- 1 to 7 ) {

Review comment:
       ```
   (1 to 7).forech { _ =>
   
   }
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.29%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5136           
     Branches          ?      639           
   =========================================
     Hits              ?     4021           
     Misses            ?      767           
     Partials          ?      348           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...741fcd0](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 0ddd83a differs from pull request most recent head 7d8ece2. Consider uploading reports for the commit 7d8ece2 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.58%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5114           
     Branches          ?      640           
   =========================================
     Hits              ?     4019           
     Misses            ?      744           
     Partials          ?      351           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...7d8ece2](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn closed pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn closed pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814


   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671821529



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       if you don't care about the engine, what stops you from merging them?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 970c000 differs from pull request most recent head 741fcd0. Consider uploading reports for the commit 741fcd0 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.30%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5136           
     Branches          ?      639           
   =========================================
     Hits              ?     4022           
     Misses            ?      766           
     Partials          ?      348           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...741fcd0](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head c6f7f1e differs from pull request most recent head 62ecb53. Consider uploading reports for the commit 62ecb53 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.26%           
     Complexity        ?       10           
   =========================================
     Files             ?      134           
     Lines             ?     5139           
     Branches          ?      639           
   =========================================
     Hits              ?     4022           
     Misses            ?      770           
     Partials          ?      347           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...62ecb53](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671965427



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/KyuubiStatementMonitor.scala
##########
@@ -55,12 +78,55 @@ object KyuubiStatementMonitor extends Logging{
   }
 
   /**
-   * This function is used for removing kyuubiStatementInfo from blockingQueue(statementQueue)
+   * This method is used for removing kyuubiStatementInfo from blockingQueue(statementQueue)
    * and dumpping them to a file by threshold.
    */
   // TODO: Need ensure those items have finished. If not, we should put them into this queue again.
   private def removeAndDumpStatementInfoFromQueue(): Unit = {
     // TODO: Just for test
     kyuubiStatementQueue.clear()
   }
+
+  /**
+   * This method is used for putting kyuubiJobInfo into hashMap(kyuubiJobIdToJobInfoMap)
+   * and storing the mapping relationship between jobId and jobInfo.
+   * The reason that we need to maintain a mapping relationship
+   * is we need to store endTime and jobResult
+   * when this job has finished but the object-jobEnd has nothing but jobId.
+   *
+   * @param kyuubiJobInfo
+   */
+  // TODO: Lack size type threshold and time type threshold
+  def putJobInfoIntoMap(kyuubiJobInfo: KyuubiJobInfo): Unit = {
+    if (kyuubiJobIdToJobInfoMap.size() >= maxSize) {
+      removeAndDumpJobInfoFromMap()
+    }
+    // Put kyuubiJobInfo into kyuubiJobIdToJobInfoMap
+    kyuubiJobIdToJobInfoMap.put(kyuubiJobInfo.jobId, kyuubiJobInfo)
+  }
+
+  /**
+   * This method is used for removing kyuubiJobInfo from hashMap(kyuubiJobIdToJobInfoMap)
+   * and dumpping them to a file by threshold.
+   */
+  private def removeAndDumpJobInfoFromMap(): Unit = {
+    // TODO: Just for test
+    kyuubiJobIdToJobInfoMap.clear()
+  }
+
+  /**
+   * This method is used for inserting endTime and jobResult.
+   * Those fields can only get when this job has finished.
+   *
+   * Notice:
+   *    1. endTime and jobResult should consider the thread safe.
+   *
+   * @param jobEnd
+   */
+  def insertEndTimeAndJobResult(jobEnd: SparkListenerJobEnd): Unit = {

Review comment:
       `insertEndTimeAndJobResult` -> `insertJobEndTimeAndResult `




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671948822



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/KyuubiStatementMonitorSuite.scala
##########
@@ -76,6 +78,47 @@ class KyuubiStatementMonitorSuite extends WithSparkSQLEngine with HiveJDBCTests
     }
   }
 
+  test("add kyuubiJobInfo into queue and remove them when threshold reached") {
+    val sql = "select timestamp'2021-06-01'"
+    val getJobMap = PrivateMethod[
+      ConcurrentHashMap[Int, KyuubiJobInfo]](Symbol("kyuubiJobIdToJobInfoMap"))()
+
+    val jobIdToJobInfoMap = KyuubiStatementMonitor.invokePrivate(getJobMap)
+    jobIdToJobInfoMap.clear()
+    withSessionHandle { (client, handle) =>
+      val req = new TExecuteStatementReq()
+      req.setSessionHandle(handle)
+      req.setStatement(sql)
+      val tExecuteStatementResp = client.ExecuteStatement(req)
+      val opHandle = tExecuteStatementResp.getOperationHandle
+      waitForOperationToComplete(client, opHandle)

Review comment:
       why are `waitForOperationToComplete` and `eventually` both used?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn closed pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn closed pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814


   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
zhang1002 commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670934366



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/entity/KyuubiJobInfo.scala
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.entity
+
+import org.apache.spark.scheduler.JobResult
+
+/**
+ * This object is used for storing the basic data for job.
+ * You can use statementId to get all jobs that belong to this statemnent.
+ * And also you can use statementId and jobId to get all stages that belong to this job.
+ * @param jobId
+ * @param statementId
+ * @param stageIds: is array
+ * @param startTime
+ * @param endTime
+ * @param jobResult

Review comment:
       i will remove them




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670933727



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/entity/KyuubiJobInfo.scala
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.entity
+
+import org.apache.spark.scheduler.JobResult
+
+/**
+ * This object is used for storing the basic data for job.
+ * You can use statementId to get all jobs that belong to this statemnent.
+ * And also you can use statementId and jobId to get all stages that belong to this job.
+ * @param jobId
+ * @param statementId
+ * @param stageIds: is array
+ * @param startTime
+ * @param endTime
+ * @param jobResult
+ */
+case class KyuubiJobInfo(
+    jobId: Int,
+    statementId: String,
+    stageIds: Seq[Int],
+    startTime: Long) {
+
+  var endTime: Option[Long] = None
+  var jobResult: JobResult = null

Review comment:
       need them to be volatle?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head 741fcd0 differs from pull request most recent head bbc36bb. Consider uploading reports for the commit bbc36bb to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.29%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5136           
     Branches          ?      639           
   =========================================
     Hits              ?     4021           
     Misses            ?      767           
     Partials          ?      348           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...bbc36bb](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670935188



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/entity/KyuubiJobInfo.scala
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.entity
+
+import org.apache.spark.scheduler.JobResult
+
+/**
+ * This object is used for storing the basic data for job.
+ * You can use statementId to get all jobs that belong to this statemnent.
+ * And also you can use statementId and jobId to get all stages that belong to this job.
+ * @param jobId
+ * @param statementId
+ * @param stageIds: is array
+ * @param startTime
+ * @param endTime
+ * @param jobResult
+ */
+case class KyuubiJobInfo(
+    jobId: Int,
+    statementId: String,
+    stageIds: Seq[Int],
+    startTime: Long) {
+
+  var endTime: Option[Long] = None

Review comment:
       why is it an option?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671821385



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       we need to avoid `StatsReportListener` be inherit twice, and I do find any logic related to it. why we need this parent class?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671966042



##########
File path: externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/spark/kyuubi/SparkSQLEngineListener.scala
##########
@@ -63,8 +66,19 @@ class SparkSQLEngineListener(server: Serverable) extends SparkListener with Logg
     }
   }
 
+  override def onJobStart(jobStart: SparkListenerJobStart): Unit = {
+    val statementId = jobStart.properties.getProperty(KYUUBI_STATEMENT_ID_KEY)
+    val kyuubiJobInfo = KyuubiJobInfo(
+      jobStart.jobId, statementId, jobStart.stageIds, jobStart.time)
+    KyuubiStatementMonitor.putJobInfoIntoMap(kyuubiJobInfo)
+    info(s"Add jobStartInfo. Query [$statementId]: Job ${jobStart.jobId} started with " +

Review comment:
       debug is enough




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.30%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5136           
     Branches          ?      639           
   =========================================
     Hits              ?     4022           
     Misses            ?      766           
     Partials          ?      348           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...970c000](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-882427836


   thanks, merged to master


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671821385



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       we need to avoid `StatsReportListener` be inherit twice




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670933727



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/entity/KyuubiJobInfo.scala
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.entity
+
+import org.apache.spark.scheduler.JobResult
+
+/**
+ * This object is used for storing the basic data for job.
+ * You can use statementId to get all jobs that belong to this statemnent.
+ * And also you can use statementId and jobId to get all stages that belong to this job.
+ * @param jobId
+ * @param statementId
+ * @param stageIds: is array
+ * @param startTime
+ * @param endTime
+ * @param jobResult
+ */
+case class KyuubiJobInfo(
+    jobId: Int,
+    statementId: String,
+    stageIds: Seq[Int],
+    startTime: Long) {
+
+  var endTime: Option[Long] = None
+  var jobResult: JobResult = null

Review comment:
       need them to be volatile?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671967246



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/KyuubiStatementMonitor.scala
##########
@@ -36,17 +42,34 @@ object KyuubiStatementMonitor extends Logging{
    *      b. this queue's current size
    */
   // TODO: Capacity should make configurable
-  private val kyuubiStatementQueue = new ArrayBlockingQueue[KyuubiStatementInfo](10)
+  private val kyuubiStatementQueue = new ArrayBlockingQueue[KyuubiStatementInfo](maxCapacity)
+
+  /**
+   * This map store the relationship between jobId and jobInfo.
+   * When the job has finished, all we can get is jobId from the object-jobEnd.
+   * So we need to maintain a mapping relationship to store endTime and jobResult
+   * when this job has finished.
+   *
+   * Key is jobId, value is KyuubiJobInfo.
+   *
+   * Notice:
+   *    1. There have two kinds of threshold to trigger when to remove and dump items from this map:
+   *      a. time
+   *      b. this map's current size
+   */
+  // TODO: Capacity should make configurable

Review comment:
       It's better to create a new issue to track this `TODO`, and put that issue link here.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
zhang1002 commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671967448



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/KyuubiStatementMonitor.scala
##########
@@ -36,17 +42,34 @@ object KyuubiStatementMonitor extends Logging{
    *      b. this queue's current size
    */
   // TODO: Capacity should make configurable
-  private val kyuubiStatementQueue = new ArrayBlockingQueue[KyuubiStatementInfo](10)
+  private val kyuubiStatementQueue = new ArrayBlockingQueue[KyuubiStatementInfo](maxCapacity)
+
+  /**
+   * This map store the relationship between jobId and jobInfo.
+   * When the job has finished, all we can get is jobId from the object-jobEnd.
+   * So we need to maintain a mapping relationship to store endTime and jobResult
+   * when this job has finished.
+   *
+   * Key is jobId, value is KyuubiJobInfo.
+   *
+   * Notice:
+   *    1. There have two kinds of threshold to trigger when to remove and dump items from this map:
+   *      a. time
+   *      b. this map's current size
+   */
+  // TODO: Capacity should make configurable

Review comment:
       It's a good idea. I will do it soon.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670935458



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/KyuubiStatementMonitor.scala
##########
@@ -55,12 +85,57 @@ object KyuubiStatementMonitor extends Logging{
   }
 
   /**
-   * This function is used for removing kyuubiStatementInfo from blockingQueue(statementQueue)
+   * This method is used for removing kyuubiStatementInfo from blockingQueue(statementQueue)
    * and dumpping them to a file by threshold.
    */
   // TODO: Need ensure those items have finished. If not, we should put them into this queue again.
   private def removeAndDumpStatementInfoFromQueue(): Unit = {
     // TODO: Just for test
     kyuubiStatementQueue.clear()
   }
+
+  /**
+   * This method is used for putting kyuubiJobInfo into blockingQueue(jobQueue)
+   * and storing the mapping relationship between jobId and jobInfo.
+   * The reason that we need to maintain a mapping relationship
+   * is we need to store endTime and jobResult
+   * when this job has finished but the object-jobEnd has nothing but jobId.
+   * @param kyuubiJobInfo
+   */
+  // TODO: Lack size type threshold and time type threshold
+  def putJobInfoIntoQueue(kyuubiJobInfo: KyuubiJobInfo): Unit = {
+    if (kyuubiJobQueue.size() >= maxSize) {
+      removeAndDumpJobInfoFromQueue()
+    }
+    // Put kyuubiJobInfo into kyuubiJobQueue
+    kyuubiJobQueue.add(kyuubiJobInfo)
+    // Store the relationship between jobID and jobInfo
+    jobIdToJobInfoMap.put(kyuubiJobInfo.jobId, kyuubiJobInfo)
+  }
+
+  /**
+   * This method is used for removing kyuubiJobInfo from blockingQueue(jobQueue)
+   * and dumpping them to a file by threshold.
+   */
+  // TODO: Need ensure those items have finished. If not, we should put them into this queue again.
+  private def removeAndDumpJobInfoFromQueue(): Unit = {
+    // TODO: Just for test
+    kyuubiJobQueue.clear()
+  }
+
+  /**
+   * This method is used for adding endTime and jobResult into jobInfo.
+   * Those fields can only get when this job has finished.
+   *
+   * Notice:
+   *    1. When this job has finished, you should remove it from jobIdToJobInfoMap.
+   * @param jobEnd
+   */
+  def addJobEndInfo(jobEnd: SparkListenerJobEnd): Unit = {

Review comment:
       why does it call addXX but remove something?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.58%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5114           
     Branches          ?      640           
   =========================================
     Hits              ?     4019           
     Misses            ?      744           
     Partials          ?      351           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...bbc36bb](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671948935



##########
File path: externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/kyuubi/engine/spark/KyuubiStatementMonitorSuite.scala
##########
@@ -76,6 +78,47 @@ class KyuubiStatementMonitorSuite extends WithSparkSQLEngine with HiveJDBCTests
     }
   }
 
+  test("add kyuubiJobInfo into queue and remove them when threshold reached") {
+    val sql = "select timestamp'2021-06-01'"
+    val getJobMap = PrivateMethod[
+      ConcurrentHashMap[Int, KyuubiJobInfo]](Symbol("kyuubiJobIdToJobInfoMap"))()
+
+    val jobIdToJobInfoMap = KyuubiStatementMonitor.invokePrivate(getJobMap)
+    jobIdToJobInfoMap.clear()
+    withSessionHandle { (client, handle) =>
+      val req = new TExecuteStatementReq()
+      req.setSessionHandle(handle)
+      req.setStatement(sql)
+      val tExecuteStatementResp = client.ExecuteStatement(req)
+      val opHandle = tExecuteStatementResp.getOperationHandle
+      waitForOperationToComplete(client, opHandle)
+
+      eventually(timeout(10.seconds), interval(1.second)) {

Review comment:
       1.second -> 100 ms




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] zhang1002 commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
zhang1002 commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671818711



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       I don't think it's a good idea, even though we add them into sparkContext at the same time.
   First, event granularity is different. In KyuubiStatementListener, i don't care about this engine(SparkSQLEngineListener is for engine level), the listener is used for getting metrics about job, stage, executor for each statement.
   Second,  i used StatsReportListener as parent class.




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670933583



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/entity/KyuubiJobInfo.scala
##########
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.entity
+
+import org.apache.spark.scheduler.JobResult
+
+/**
+ * This object is used for storing the basic data for job.
+ * You can use statementId to get all jobs that belong to this statemnent.
+ * And also you can use statementId and jobId to get all stages that belong to this job.
+ * @param jobId
+ * @param statementId
+ * @param stageIds: is array
+ * @param startTime
+ * @param endTime
+ * @param jobResult

Review comment:
       are these param?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r670933316



##########
File path: kyuubi-common/src/main/scala/org/apache/kyuubi/operation/AbstractOperation.scala
##########
@@ -162,3 +162,9 @@ abstract class AbstractOperation(opType: OperationType, session: Session)
     }
   }
 }
+
+object AbstractOperation {

Review comment:
       why an object is named abstract?




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.58%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5114           
     Branches          ?      640           
   =========================================
     Hits              ?     4019           
     Misses            ?      744           
     Partials          ?      351           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...0ddd83a](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
yaooqinn commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671200986



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/listener/KyuubiStatementListener.scala
##########
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.engine.spark.monitor.listener
+
+import org.apache.spark.scheduler._
+
+import org.apache.kyuubi.KyuubiSparkUtils._
+import org.apache.kyuubi.Logging
+import org.apache.kyuubi.engine.spark.monitor.KyuubiStatementMonitor
+import org.apache.kyuubi.engine.spark.monitor.entity.KyuubiJobInfo
+
+/**
+ * This listener is used for getting metrics about job, stage, executor and stageExecutor.
+ * It's singleton pattern and we will add it into sparkContext when initialize sparkEngine.
+ */
+class KyuubiStatementListener extends StatsReportListener with Logging{

Review comment:
       Merge KyuubiStatementListener to SparkSQLEngineListener




-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] codecov-commenter edited a comment on pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#issuecomment-881243017


   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > :exclamation: No coverage uploaded for pull request base (`master@ff52b20`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#section-missing-base-commit).
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head bbc36bb differs from pull request most recent head 0ddd83a. Consider uploading reports for the commit 0ddd83a to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-kyuubi/pull/814/graphs/tree.svg?width=650&height=150&src=pr&token=925D4tb9AH&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff            @@
   ##             master     #814   +/-   ##
   =========================================
     Coverage          ?   78.58%           
     Complexity        ?       10           
   =========================================
     Files             ?      135           
     Lines             ?     5114           
     Branches          ?      640           
   =========================================
     Hits              ?     4019           
     Misses            ?      744           
     Partials          ?      351           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [ff52b20...0ddd83a](https://codecov.io/gh/apache/incubator-kyuubi/pull/814?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

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



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #814: Event Tracking: For jonInfo

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #814:
URL: https://github.com/apache/incubator-kyuubi/pull/814#discussion_r671965596



##########
File path: externals/kyuubi-spark-monitor/src/main/scala/org/apache/kyuubi/engine/spark/monitor/KyuubiStatementMonitor.scala
##########
@@ -55,12 +78,55 @@ object KyuubiStatementMonitor extends Logging{
   }
 
   /**
-   * This function is used for removing kyuubiStatementInfo from blockingQueue(statementQueue)
+   * This method is used for removing kyuubiStatementInfo from blockingQueue(statementQueue)
    * and dumpping them to a file by threshold.
    */
   // TODO: Need ensure those items have finished. If not, we should put them into this queue again.
   private def removeAndDumpStatementInfoFromQueue(): Unit = {
     // TODO: Just for test
     kyuubiStatementQueue.clear()
   }
+
+  /**
+   * This method is used for putting kyuubiJobInfo into hashMap(kyuubiJobIdToJobInfoMap)
+   * and storing the mapping relationship between jobId and jobInfo.
+   * The reason that we need to maintain a mapping relationship
+   * is we need to store endTime and jobResult
+   * when this job has finished but the object-jobEnd has nothing but jobId.
+   *
+   * @param kyuubiJobInfo
+   */
+  // TODO: Lack size type threshold and time type threshold
+  def putJobInfoIntoMap(kyuubiJobInfo: KyuubiJobInfo): Unit = {
+    if (kyuubiJobIdToJobInfoMap.size() >= maxSize) {
+      removeAndDumpJobInfoFromMap()
+    }
+    // Put kyuubiJobInfo into kyuubiJobIdToJobInfoMap
+    kyuubiJobIdToJobInfoMap.put(kyuubiJobInfo.jobId, kyuubiJobInfo)
+  }
+
+  /**
+   * This method is used for removing kyuubiJobInfo from hashMap(kyuubiJobIdToJobInfoMap)
+   * and dumpping them to a file by threshold.
+   */
+  private def removeAndDumpJobInfoFromMap(): Unit = {
+    // TODO: Just for test
+    kyuubiJobIdToJobInfoMap.clear()
+  }
+
+  /**
+   * This method is used for inserting endTime and jobResult.
+   * Those fields can only get when this job has finished.
+   *
+   * Notice:
+   *    1. endTime and jobResult should consider the thread safe.
+   *
+   * @param jobEnd
+   */
+  def insertEndTimeAndJobResult(jobEnd: SparkListenerJobEnd): Unit = {
+    val jobInfo = kyuubiJobIdToJobInfoMap.get(jobEnd.jobId)
+    jobInfo.endTime = jobEnd.time
+    jobInfo.jobResult = jobEnd.jobResult

Review comment:
       `jobInfo ` can be null if the `JobStartEvent` is lost




-- 
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: commits-unsubscribe@kyuubi.apache.org

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