Github user harishreedharan commented on a diff in the pull request:
https://github.com/apache/spark/pull/1195#discussion_r15494899
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/receiver/Receiver.scala ---
@@ -125,6 +125,16 @@ abstract class Receiver[T](val storageLevel:
StorageLevel) extends Serializable
}
/**
+ * Store an ArrayBuffer of received data as a data block into Spark's
memory. The callback is
+ * called when the data is safely stored. This callback can be used to
commit transactions
+ * with systems from which data is being sent etc.
+ */
+ @Experimental
+ def storeReliably(dataBuffer: ArrayBuffer[T], callback: Option[() =>
Unit]) {
--- End diff --
The only issue is that there is nothing that stops a buggy receiver to call
storeReliably(buffer, null). This just protects against this - else we'd have
to explicitly do a null check.
---
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.
---