-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-10081][Core ] Skip re-computing getMissingParentStages #8269
Changes from all commits
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 |
---|---|---|
|
@@ -732,7 +732,8 @@ class DAGScheduler( | |
job.jobId, callSite.shortForm, partitions.length)) | ||
logInfo("Final stage: " + finalStage + "(" + finalStage.name + ")") | ||
logInfo("Parents of final stage: " + finalStage.parents) | ||
logInfo("Missing parents: " + getMissingParentStages(finalStage)) | ||
val missingStages = getMissingParentStages(finalStage) | ||
logInfo("Missing parents: " + missingStages) | ||
val jobSubmissionTime = clock.getTimeMillis() | ||
jobIdToActiveJob(jobId) = job | ||
activeJobs += job | ||
|
@@ -741,18 +742,18 @@ class DAGScheduler( | |
val stageInfos = stageIds.flatMap(id => stageIdToStage.get(id).map(_.latestInfo)) | ||
listenerBus.post( | ||
SparkListenerJobStart(job.jobId, jobSubmissionTime, stageInfos, properties)) | ||
submitStage(finalStage) | ||
submitStage(finalStage, Some(missingStages)) | ||
} | ||
submitWaitingStages() | ||
} | ||
|
||
/** Submits stage, but first recursively submits any missing parents. */ | ||
private def submitStage(stage: Stage) { | ||
private def submitStage(stage: Stage, missingStages: Option[List[Stage]] = None) { | ||
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. There are a number of recursive calls that then don't get this value then and recompute anyway? To avoid complication, is it simpler to just have all callers provide this info? I don't think it's but one more change. 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. +1, it actually simplifies the code down there because now you don't need the |
||
val jobId = activeJobForStage(stage) | ||
if (jobId.isDefined) { | ||
logDebug("submitStage(" + stage + ")") | ||
if (!waitingStages(stage) && !runningStages(stage) && !failedStages(stage)) { | ||
val missing = getMissingParentStages(stage).sortBy(_.id) | ||
val missing = missingStages.getOrElse(getMissingParentStages(stage)).sortBy(_.id) | ||
logDebug("missing: " + missing) | ||
if (missing.isEmpty) { | ||
logInfo("Submitting " + stage + " (" + stage.rdd + "), which has no missing parents") | ||
|
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.
Super minor but should this use string interpolation? as a general principle for speed and conciseness, though it won't matter here.