Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/5043#discussion_r26544667
--- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
---
@@ -188,14 +188,13 @@ class DAGScheduler(
eventProcessLoop.post(TaskSetFailed(taskSet, reason))
}
- private def getCacheLocs(rdd: RDD[_]): Array[Seq[TaskLocation]] =
cacheLocs.synchronized {
+ private def getCacheLocs(rdd: RDD[_]): Seq[Seq[TaskLocation]] =
cacheLocs.synchronized {
// Note: this doesn't use `getOrElse()` because this method is called
O(num tasks) times
if (!cacheLocs.contains(rdd.id)) {
val blockIds = rdd.partitions.indices.map(index =>
RDDBlockId(rdd.id, index)).toArray[BlockId]
- val locs = BlockManager.blockIdsToBlockManagers(blockIds, env,
blockManagerMaster)
- cacheLocs(rdd.id) = blockIds.map { id =>
- locs.getOrElse(id, Nil).map(bm => TaskLocation(bm.host,
bm.executorId))
- }
+ val locs = blockManagerMaster.getLocations(blockIds)
--- End diff --
The `blockManagerMaster` is a member of `DAGScheduler` and I don't think it
will be `null`. Correct me if I got a misunderstanding here :) @rxin
---
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]