ukby1234 commented on code in PR #42296:
URL: https://github.com/apache/spark/pull/42296#discussion_r1323912669
##########
core/src/main/scala/org/apache/spark/MapOutputTracker.scala:
##########
@@ -1288,6 +1288,30 @@ private[spark] class MapOutputTrackerWorker(conf:
SparkConf) extends MapOutputTr
mapSizesByExecutorId.iter
}
+ def getMapOutputLocationWithRefresh(
Review Comment:
We can do the following with `Option`:
```
val currentAddressOpt = mapOutputTrackerWorker
.getMapOutputLocationWithRefresh(shuffleId, mapId, address)
currentAddressOpt match {
case Some(currentAddress) =>
if (currentAddress != address) {
logInfo(s"Map status location for block $blockId
changed from $address " +
s"to $currentAddress")
remainingBlocks -= blockId
deferredBlocks.getOrElseUpdate(currentAddress, new
ArrayBuffer[String]())
.append(blockId)
enqueueDeferredFetchRequestIfNecessary()
} else {
results.put(FailureFetchResult(block,
infoMap(blockId)._2, address, e))
}
case None =>
results.put(FailureFetchResult(block,
infoMap(blockId)._2, address, e))
}
```
It is also consistent with other function signatures with
`getMapOutputLocation`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]