You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/22 02:02:47 UTC

[GitHub] [spark] hiboyang commented on a change in pull request #31876: [SPARK-34942][API][CORE] Abstract Location in MapStatus to enable support for custom storage

hiboyang commented on a change in pull request #31876:
URL: https://github.com/apache/spark/pull/31876#discussion_r618026215



##########
File path: core/src/main/scala/org/apache/spark/MapOutputTracker.scala
##########
@@ -172,7 +172,7 @@ private class ShuffleStatus(numPartitions: Int) extends Logging {
    */
   def removeOutputsOnExecutor(execId: String): Unit = withWriteLock {
     logDebug(s"Removing outputs for execId ${execId}")
-    removeOutputsByFilter(x => x.asInstanceOf[BlockManagerId].executorId == execId)
+    removeOutputsByFilter(x => x.asInstanceOf[ExecutorLocation].executorId == execId)

Review comment:
       Could we do `x.isInstanceOf[ExecutorLocation] && x.asInstanceOf[ExecutorLocation].executorId == execId`, since people could have `Location` implementation which does not implement `ExecutorLocation`?

##########
File path: core/src/main/scala/org/apache/spark/MapOutputTracker.scala
##########
@@ -162,7 +162,7 @@ private class ShuffleStatus(numPartitions: Int) extends Logging {
    */
   def removeOutputsOnHost(host: String): Unit = withWriteLock {
     logDebug(s"Removing outputs for host ${host}")
-    removeOutputsByFilter(x => x.asInstanceOf[BlockManagerId].host == host)
+    removeOutputsByFilter(x => x.asInstanceOf[HostLocation].host == host)

Review comment:
       Could we do `x.isInstanceOf[HostLocation] && x.asInstanceOf[HostLocation].host == host`, since people could have `Location` implementation which does not implement `HostLocation`?




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org