Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/9264#discussion_r46867432
--- Diff: core/src/main/scala/org/apache/spark/rdd/AsyncRDDActions.scala ---
@@ -65,17 +64,23 @@ class AsyncRDDActions[T: ClassTag](self: RDD[T])
extends Serializable with Loggi
* Returns a future for retrieving the first num elements of the RDD.
*/
def takeAsync(num: Int): FutureAction[Seq[T]] = self.withScope {
- val f = new ComplexFutureAction[Seq[T]]
val callSite = self.context.getCallSite
-
- f.run {
- // This is a blocking action so we should use
"AsyncRDDActions.futureExecutionContext" which
- // is a cached thread pool.
- val results = new ArrayBuffer[T](num)
- val totalParts = self.partitions.length
- var partsScanned = 0
- self.context.setCallSite(callSite)
- while (results.size < num && partsScanned < totalParts) {
+ val localProperties = self.context.getLocalProperties
+ // Cached thread pool to handle aggregation of subtasks.
+ implicit val executionContext = AsyncRDDActions.futureExecutionContext
--- End diff --
not necessary for this patch. But I think we can remove `executionContext`
in future since it doesn't make sense to use a cached thread pool now.
---
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]