-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-4961] [CORE] Put HadoopRDD.getPartitions forward to reduce DAGScheduler.JobSubmitted processing time #3794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 18 commits
cdef539
cbcba66
8a00106
03b62b0
76d4027
d26d982
e249846
6e643f8
92242c7
74175b4
950b21e
718afeb
59e4de9
1893956
bd2c444
efc4210
1e1ebb4
e4c2c0a
5601a8b
af5abda
6e95955
d4bca32
5e3ef70
fd87518
74c1dec
5041b35
09afdff
b535a53
e2880f9
aed530b
5b27571
267e375
e2c2494
572079b
ae7c139
d5c0e84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -495,6 +495,19 @@ class DAGScheduler( | |
| assert(partitions.size > 0) | ||
| val func2 = func.asInstanceOf[(TaskContext, Iterator[_]) => _] | ||
| val waiter = new JobWaiter(this, jobId, partitions.size, resultHandler) | ||
|
|
||
| // Makes sure that getPartitions occurs before | ||
| // the job submitter sends a message into the DAGScheduler actor. | ||
| // Although getPartitions may be called in rdd.partitions.length before this. | ||
| try { | ||
| getParentStages(rdd, jobId).foreach(_.rdd.partitions) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just realized that this could be a thread-safety issue: Do you think we could just call |
||
| } catch { | ||
| case e: Exception => | ||
| logWarning("Get the partitions of parent stages' rdds failed due to exception - job: " | ||
| + jobId, e) | ||
| waiter.jobFailed(e) | ||
| return waiter | ||
| } | ||
| eventProcessActor ! JobSubmitted( | ||
| jobId, rdd, func2, partitions.toArray, allowLocal, callSite, waiter, properties) | ||
| waiter | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expand this comment to explain that the reason for performing this call here is that computing the partitions may be very expensive for certain types of RDDs (e.g. HadoopRDDs), so therefore we'd like that computation to take place outside of the DAGScheduler to avoid blocking its event processing loop. I'd also mention SPARK-4961 so that it's easier to find more context on JIRA.