Skip to content

Commit

Permalink
May be fix tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
Sital Kedia committed Mar 28, 2017
1 parent d32856d commit 1e6e88a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/src/main/scala/org/apache/spark/MapOutputTracker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,16 @@ private[spark] class MapOutputTrackerMaster(conf: SparkConf,

/** Get the epoch for map output for a shuffle, if it is available */
def getEpochForMapOutput(shuffleId: Int, mapId: Int): Option[Long] = {
for {
mapStatus <- mapStatuses.get(shuffleId).flatMap { mapStatusArray =>
Option(mapStatusArray(mapId))
val arrayOpt = mapStatuses.get(shuffleId)
if (arrayOpt.isDefined && arrayOpt.get != null) {
val array = arrayOpt.get
array.synchronized {
if (array(mapId) != null) {
return Some(epochForMapStatus(shuffleId)(mapId))
}
}
} yield epochForMapStatus(shuffleId)(mapId)
}
None
}

/**
Expand Down

0 comments on commit 1e6e88a

Please sign in to comment.