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

    https://github.com/apache/spark/pull/6707#discussion_r31933693
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala
 ---
    @@ -151,12 +165,18 @@ private[streaming] class 
WriteAheadLogBasedBlockHandler(
        */
       def storeBlock(blockId: StreamBlockId, block: ReceivedBlock): 
ReceivedBlockStoreResult = {
     
    +    var numRecords = None: Option[Long]
    +    val countIterator = block match {
    +      case ArrayBufferBlock(arrayBuffer) => new 
CountingIterator(arrayBuffer.iterator)
    +      case IteratorBlock(iterator) => new CountingIterator(iterator)
    +      case _ => null
    +    }
         // Serialize the block so that it can be inserted into both
         val serializedBlock = block match {
           case ArrayBufferBlock(arrayBuffer) =>
    -        blockManager.dataSerialize(blockId, arrayBuffer.iterator)
    +        blockManager.dataSerialize(blockId, countIterator)
    --- End diff --
    
    Yes, this is fine.. As for WAL based handler,  block count can be done here 
while it does dataSerialize..


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