Github user tgravescs commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17658#discussion_r114997435
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala ---
    @@ -283,10 +283,15 @@ private[spark] object EventLoggingListener extends 
Logging {
        *
        * @param logStream Raw output stream to the event log file.
        */
    -  def initEventLog(logStream: OutputStream): Unit = {
    +  def initEventLog(logStream: OutputStream, testing: Boolean,
    +                   loggedEvents: ArrayBuffer[JValue]): Unit = {
         val metadata = SparkListenerLogStart(SPARK_VERSION)
    -    val metadataJson = compact(JsonProtocol.logStartToJson(metadata)) + 
"\n"
    +    val eventJson = JsonProtocol.logStartToJson(metadata)
    +    val metadataJson = compact(eventJson) + "\n"
         logStream.write(metadataJson.getBytes(StandardCharsets.UTF_8))
    +    if (testing && loggedEvents != null) {
    +      loggedEvents += eventJson
    --- End diff --
    
    The downside to returning the event is that this function can't do more in 
the future.  For instance if it wants to add 2 events. I guess its private so 
it doesn't matter to much and its just for testing stuff.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to