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

    https://github.com/apache/spark/pull/2991#discussion_r20130193
  
    --- 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 --
    
    Actually that is more obvious, and introduces minimum extra logic in the 
BlockGenerator, keeping the BlockGenerator more generic. It is tricky to 
document stuff like "method 1 and method 2 of BlockGenerator are called in the 
same lock, but not other methods".


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