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

    https://github.com/apache/spark/pull/3026#discussion_r19699221
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/dstream/ReceiverInputDStream.scala
 ---
    @@ -58,24 +54,45 @@ abstract class ReceiverInputDStream[T: 
ClassTag](@transient ssc_ : StreamingCont
     
       def stop() {}
     
    -  /** Ask ReceiverInputTracker for received data blocks and generates RDDs 
with them. */
    +  /**
    +   * Generates RDDs with blocks received by the receiver of this stream. */
       override def compute(validTime: Time): Option[RDD[T]] = {
    -    // If this is called for any time before the start time of the context,
    -    // then this returns an empty RDD. This may happen when recovering 
from a
    -    // master failure
    -    if (validTime >= graph.startTime) {
    -      val blockInfo = 
ssc.scheduler.receiverTracker.getReceivedBlockInfo(id)
    -      receivedBlockInfo(validTime) = blockInfo
    -      val blockIds = blockInfo.map { 
_.blockStoreResult.blockId.asInstanceOf[BlockId] }
    -      Some(new BlockRDD[T](ssc.sc, blockIds))
    -    } else {
    -      Some(new BlockRDD[T](ssc.sc, Array.empty))
    -    }
    -  }
    +    val blockRDD = {
     
    -  /** Get information on received blocks. */
    -  private[streaming] def getReceivedBlockInfo(time: Time) = {
    -    receivedBlockInfo.get(time).getOrElse(Array.empty[ReceivedBlockInfo])
    +      if (validTime < graph.startTime) {
    +        // If this is called for any time before the start time of the 
context,
    +        // then this returns an empty RDD. This may happen when recovering 
from a
    +        // driver failure without any write ahead log to recover 
pre-failure data.
    +        new BlockRDD[T](ssc.sc, Array.empty)
    +      } else {
    +        // Otherwise, ask the tracker for all the blocks that have been 
allocated to this stream
    +        // for this batch
    +        val blockInfos =
    +          
ssc.scheduler.receiverTracker.getBlocksOfBatch(validTime).get(id).getOrElse(Seq.empty)
    --- End diff --
    
    Ignore this. Verified it does not.


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