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

    https://github.com/apache/spark/pull/5554#discussion_r28608673
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/scheduler/JobGenerator.scala
 ---
    @@ -70,22 +68,23 @@ class JobGenerator(jobScheduler: JobScheduler) extends 
Logging {
         null
       }
     
    -  // eventActor is created when generator starts.
    +  // eventLoop is created when generator starts.
       // This not being null means the scheduler has been started and not 
stopped
    -  private var eventActor: ActorRef = null
    +  private var eventLoop: EventLoop[JobGeneratorEvent] = null
     
       // last batch whose completion,checkpointing and metadata cleanup has 
been completed
       private var lastProcessedBatch: Time = null
     
       /** Start generation of jobs */
       def start(): Unit = synchronized {
    -    if (eventActor != null) return // generator has already been started
    +    if (eventLoop != null) return // generator has already been started
     
    -    eventActor = ssc.env.actorSystem.actorOf(Props(new Actor {
    -      override def receive: PartialFunction[Any, Unit] = {
    -        case event: JobGeneratorEvent =>  processEvent(event)
    -      }
    -    }), "JobGenerator")
    +    eventLoop = new EventLoop[JobGeneratorEvent]("JobGenerator") {
    +      override protected def onReceive(event: JobGeneratorEvent): Unit = 
processEvent(event)
    +
    +      override protected def onError(e: Throwable): Unit = logError("Error 
in job generator", e)
    +    }
    +    eventLoop.start()
         if (ssc.isCheckpointPresent) {
    --- End diff --
    
    add a blank line here


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