Github user markhamstra commented on a diff in the pull request:
https://github.com/apache/spark/pull/4703#discussion_r25057714
--- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
---
@@ -229,41 +227,56 @@ class DAGScheduler(
/**
* Create a Stage -- either directly for use as a result stage, or as
part of the (re)-creation
- * of a shuffle map stage in newOrUsedStage. The stage will be
associated with the provided
- * jobId. Production of shuffle map stages should always use
newOrUsedStage, not newStage
- * directly.
+ * of a shuffle map stage in newOrUsedShuffleStage. The stage will be
associated with the provided
+ * jobId. Production of shuffle map stages should always use
newOrUsedShuffleStage,
+ * not getAndRegNewShuffleMap directly.
*/
- private def newStage(
- rdd: RDD[_],
- numTasks: Int,
- shuffleDep: Option[ShuffleDependency[_, _, _]],
- jobId: Int,
- callSite: CallSite)
- : Stage =
- {
+ private def getAndRegNewShuffleMap(rdd: RDD[_],
+ numTasks: Int,
+ shuffleDep: ShuffleDependency[_, _,
_],
+ jobId: Int,
+ callSite: CallSite): ShuffleMapStage
= {
val parentStages = getParentStages(rdd, jobId)
- val id = nextStageId.getAndIncrement()
- val stage = new Stage(id, rdd, numTasks, shuffleDep, parentStages,
jobId, callSite)
+ val id = nextStageId.getAndIncrement
+ val stage: ShuffleMapStage = new ShuffleMapStage(id, rdd, numTasks,
parentStages,
+ jobId, callSite, shuffleDep)
+
stageIdToStage(id) = stage
updateJobIdStageIdMaps(jobId, stage)
stage
}
/**
+ * Create a Stage -- either directly for use as a result stage, or as
part of the (re)-creation
+ * of a shuffle map stage in newOrUsedShuffleStage. The stage will be
associated with the provided
+ * jobId. Production of shuffle map stages should always use
newOrUsedShuffleStage,
+ * not getAndRegNewResults directly.
+ */
+ private def getAndRegNewResults(rdd: RDD[_],
--- End diff --
I'm not a fan of the `getAndReg` addition since `get` falsely implies some
kind of look up, and `reg` is more-or-less an implementation detail that across
future refactorings won't necessarily be a fixed part of the creation of new
stages. The new, longer naming just doesn't add anything positive, imo.
---
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]