Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/1195#discussion_r15609758
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/receiver/Receiver.scala ---
@@ -179,6 +181,80 @@ abstract class Receiver[T](val storageLevel:
StorageLevel) extends Serializable
executor.pushBytes(bytes, Some(metadata), None)
}
+ /**
+ * Store an ArrayBuffer of received data as a data block into Spark's
memory.
+ */
+ @Experimental
+ def storeReliably(dataBuffer: ArrayBuffer[T]): Future[Boolean] = {
+ executor.pushArrayBufferReliably(dataBuffer, None, None)
+ }
+
+ /**
+ * Store an ArrayBuffer of received data as a data block into Spark's
memory.
+ * The metadata will be associated with this block of data
+ * for being used in the corresponding InputDStream.
+ */
+ @Experimental
+ def storeReliably(dataBuffer: ArrayBuffer[T], metadata: Any):
Future[Boolean] = {
+ executor.pushArrayBufferReliably(dataBuffer, Some(metadata), None)
--- End diff --
Returning a Future[Boolean] does not expose the exception. Maybe its better
to return something like a StoreResult that has a boolean field and an
exception field. And this change will the API breaking change, so better to do
it now rather than later.
---
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.
---