Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/9264#discussion_r44856609
--- Diff: core/src/main/scala/org/apache/spark/rdd/AsyncRDDActions.scala ---
@@ -95,19 +102,18 @@ class AsyncRDDActions[T: ClassTag](self: RDD[T])
extends Serializable with Loggi
val p = partsScanned until math.min(partsScanned + numPartsToTry,
totalParts)
val buf = new Array[Array[T]](p.size)
- f.runJob(self,
+ val job = f.submitJob(self,
(it: Iterator[T]) => it.take(left).toArray,
p,
(index: Int, data: Array[T]) => buf(index) = data,
Unit)
-
- buf.foreach(results ++= _.take(num - results.size))
- partsScanned += numPartsToTry
+ job.flatMap {case _ =>
--- End diff --
I'm just picking nits over style at this point but `{case _ =>` isn't very
helpful vs `(thing =>`
---
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]