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

    https://github.com/apache/spark/pull/9297#discussion_r44475121
  
    --- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
    @@ -52,7 +55,22 @@ import org.apache.spark.storage._
     private[spark] object JsonProtocol {
       // TODO: Remove this file and put JSON serialization into each 
individual class.
     
    -  private implicit val format = DefaultFormats
    +  // Events defined in other modules are allowed to be registered through 
implementing the
    +  // SparkListenerEventRegister trait. These events are written to Json 
using Jackson.
    +  val eventRegisters: Iterable[SparkListenerEventRegister] = {
    +    val loader = Utils.getContextOrSparkClassLoader
    +    ServiceLoader.load(classOf[SparkListenerEventRegister], loader).asScala
    +  }
    +
    +  var eventClasses = new ListBuffer[Class[_]]()
    --- End diff --
    
    This can be a `val`. I still want to check how this stuff is used, though 
(haven't made it to that part of the patch yet).
    
        val eventClasses = eventRegisters.flatMap { r => 
eventRegister.getEventClasses() }.toSeq


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to