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

    https://github.com/apache/spark/pull/2991#discussion_r19994012
  
    --- Diff: 
streaming/src/main/scala/org/apache/spark/streaming/receiver/BlockGenerator.scala
 ---
    @@ -80,9 +89,10 @@ private[streaming] class BlockGenerator(
        * Push a single data item into the buffer. All received data items
        * will be periodically pushed into BlockManager.
        */
    -  def += (data: Any): Unit = synchronized {
    +  def += (data: Any, metadata: Any = null): Unit = synchronized {
         waitToPush()
         currentBuffer += data
    +    listener.onStoreData(data, metadata)
    --- End diff --
    
    The reason of putting onStoreData here is that this is synchronized with 
the same mutex, if we put this into caller class, we should use another mutex, 
this will add some other synchronization logic.


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