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_r357019358
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/scheduler/ReplayListenerBus.scala
 ##########
 @@ -68,25 +69,29 @@ private[spark] class ReplayListenerBus extends 
SparkListenerBus with Logging {
       lines: Iterator[String],
       sourceName: String,
       maybeTruncated: Boolean,
-      eventsFilter: ReplayEventsFilter): Boolean = {
+      eventsFilter: ReplayEventsFilter,
+      linesToSkip: Int): ReplayResult = {
     var currentLine: String = null
     var lineNumber: Int = 0
+    var lastLine = linesToSkip
     val unrecognizedEvents = new scala.collection.mutable.HashSet[String]
     val unrecognizedProperties = new scala.collection.mutable.HashSet[String]
 
     try {
       val lineEntries = lines
         .zipWithIndex
-        .filter { case (line, _) => eventsFilter(line) }
+        .filter { case (line, index) =>
+          index > linesToSkip && eventsFilter(line)
+        }
 
       while (lineEntries.hasNext) {
         try {
           val entry = lineEntries.next()
 
           currentLine = entry._1
           lineNumber = entry._2 + 1
-
 
 Review comment:
   nit: I feel it's better to have empty line between twos.

----------------------------------------------------------------
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