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

    https://github.com/apache/spark/pull/11030#discussion_r52084635
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala
 ---
    @@ -150,36 +205,40 @@ class StreamExecution(
           streamProgress.synchronized {
             // Update the offsets and calculate a new composite offset
             newOffsets.foreach(streamProgress.update)
    -        val newStreamProgress = logicalPlan.collect {
    -          case StreamingRelation(source, _) => streamProgress.get(source)
    -        }
    -        val batchOffset = CompositeOffset(newStreamProgress)
     
             // Construct the batch and send it to the sink.
    +        val batchOffset = streamProgress.toCompositeOffset(sources)
             val nextBatch = new Batch(batchOffset, new DataFrame(sqlContext, 
newPlan))
             sink.addBatch(nextBatch)
           }
     
    -      batchRun = true
           awaitBatchLock.synchronized {
             // Wake up any threads that are waiting for the stream to progress.
             awaitBatchLock.notifyAll()
           }
     
           val batchTime = (System.nanoTime() - startTime).toDouble / 1000000
    -      logInfo(s"Compete up to $newOffsets in ${batchTime}ms")
    +      logInfo(s"Completed up to $newOffsets in ${batchTime}ms")
         }
     
         logDebug(s"Waiting for data, current: $streamProgress")
       }
     
    +  private def postEvent(event: ContinuousQueryListener.Event) {
    +    sqlContext.streams.postListenerEvent(event)
    +  }
    +
       /**
        * Signals to the thread executing micro-batches that it should stop 
running after the next
        * batch. This method blocks until the thread stops running.
        */
    -  def stop(): Unit = {
    -    shouldRun = false
    -    if (microBatchThread.isAlive) { microBatchThread.join() }
    +  override def stop(): Unit = {
    +    state = TERMINATED
    --- End diff --
    
    But it is used to figure out whether the interrupt on that thread was 
intentional (with stop, and in that case ignore it) or accidentally (in which 
case report it).


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