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

    https://github.com/apache/spark/pull/3026#discussion_r19696729
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/dstream/ReceiverInputDStream.scala
 ---
    @@ -60,22 +56,35 @@ abstract class ReceiverInputDStream[T: 
ClassTag](@transient ssc_ : StreamingCont
     
       /** Ask ReceiverInputTracker for received data blocks and generates RDDs 
with them. */
       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 = {
    +      if (validTime >= graph.startTime) {
    +        val blockStoreResults = getReceivedBlockInfo(validTime).map { 
_.blockStoreResult }
    +        val blockIds = blockStoreResults.map { 
_.blockId.asInstanceOf[BlockId] }.toArray
    +        val isWriteAheadLogBased = blockStoreResults.forall {
    --- End diff --
    
    It should ideally all WAL based or none WAL based. We could make a stronger 
assertion here, but we risk breaking stuff if something goes wrong. We can 
always safely ignore the WAL info and make simple BlockRDDs, which would allow 
streaming to work, but not recover. In either case, if some of the blocks are 
WAL based, and others not, we cannot possible recover. 
    
    This is not a very strong argument though for not putting the assertion. 
How about just logging a warning that something may be going wrong if multiple 
types are mixed?


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