Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/6614#discussion_r31858270
--- Diff:
streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala
---
@@ -199,3 +220,15 @@ private[streaming] object
WriteAheadLogBasedBlockHandler {
new Path(checkpointDir, new Path("receivedData",
streamId.toString)).toString
}
}
+
+/**
+ * A utility that will wrap the Iterator to get the count
+ */
+private class CountingIterator[T: Manifest](iterator: Iterator[T]) extends
Iterator[T] {
+ var count = 0
+ def hasNext(): Boolean = iterator.hasNext
--- End diff --
Add a method
`def isFullyConsumed = !iterator.hasNext` and use that to detect whether
the block was completely consumed (that is, inserted into block manager) or
not.
---
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]