Github user ilganeli commented on a diff in the pull request:
https://github.com/apache/spark/pull/4708#discussion_r25183148
--- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
---
@@ -830,39 +836,39 @@ class DAGScheduler(
try {
// For ShuffleMapTask, serialize and broadcast (rdd, shuffleDep).
// For ResultTask, serialize and broadcast (rdd, func).
- val taskBinaryBytes: Array[Byte] =
- if (stage.isShuffleMap) {
- closureSerializer.serialize((stage.rdd, stage.shuffleDep.get) :
AnyRef).array()
- } else {
- closureSerializer.serialize((stage.rdd,
stage.resultOfJob.get.func) : AnyRef).array()
- }
+ val taskBinaryBytes: Array[Byte] = stage match {
+ case a: ShuffleMapStage =>
+ closureSerializer.serialize((a.rdd, a.shuffleDep):
AnyRef).array()
+ case b: ResultStage =>
+ closureSerializer.serialize((b.rdd, b.resultOfJob.get.func):
AnyRef).array()
+ }
+
taskBinary = sc.broadcast(taskBinaryBytes)
} catch {
// In the case of a failure during serialization, abort the stage.
case e: NotSerializableException =>
abortStage(stage, "Task not serializable: " + e.toString)
runningStages -= stage
- return
--- End diff --
This was a mistake introduced when I was doing the second round of
refactoring (copying code back from when I pulled this all out to its own
method). When this code is within its own method then we can just look at the
return value of the method and the weird return breaks become unnecessary. I'll
add a comment for these in the meantime.
---
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]