HeartSaVioR commented on a change in pull request #26821: 
[SPARK-20656][CORE]Support Incremental parsing of event logs in SHS
URL: https://github.com/apache/spark/pull/26821#discussion_r357024933
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/status/AppStatusListener.scala
 ##########
 @@ -100,6 +102,41 @@ private[spark] class AppStatusListener(
     if (!live) {
       val now = System.nanoTime()
       flush(update(_, now))
+      if (appId != null) {
+        // If incremental parsing is enabled, write the listener data to the 
store
+        val data = new AppStatusListenerData(appId, attemptId, liveStages, 
liveJobs,
+          liveExecutors, deadExecutors, liveTasks, liveRDDs,
+          pools, appInfo, coresPerTask, appSummary, activeExecutorCount)
+        kvstore.write(data)
+      }
+    }
+  }
+
+  def initialize(appId: String, attemptId: Option[String]): Unit = {
+    if (!live) {
+      // If incremental parsing is enabled, read and update the listener data
+      // from store
+      this.appId = appId
 
 Review comment:
   I'd rather have some case class (or just simply tuple) to store the 
information altogether and name it which clearly representing "incremental 
parsing is used". Checking whether appId is available or not to determine 
whether incremental parsing is used or not wouldn't be easy to understand for 
newcomer of the code.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to