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/03/19 04:09:46 UTC

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

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



##########
File path: core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala
##########
@@ -216,7 +223,10 @@ private[spark] class HighlyCompressedMapStatus private (
   }
 
   override def readExternal(in: ObjectInput): Unit = Utils.tryOrIOException {
-    loc = BlockManagerId(in)
+    // TODO(wuyi): config
+    val location = "org.apache.spark.storage.BlockManagerId"
+    loc = Utils.classForName(location).newInstance().asInstanceOf[Location]
+    loc.readExternal(in)

Review comment:
       When this is fixed, do the same for `CompressedMapStatus` as well.

##########
File path: core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala
##########
@@ -28,16 +28,23 @@ import org.apache.spark.internal.config
 import org.apache.spark.storage.BlockManagerId
 import org.apache.spark.util.Utils
 
+trait Location extends Externalizable {

Review comment:
       I might have missed some context here, but why `Externalizable` and not `Serializable` ?

##########
File path: core/src/main/scala/org/apache/spark/storage/BlockManagerId.scala
##########
@@ -129,7 +132,7 @@ private[spark] object BlockManagerId {
   def apply(in: ObjectInput): BlockManagerId = {
     val obj = new BlockManagerId()
     obj.readExternal(in)
-    getCachedBlockManagerId(obj)
+    obj

Review comment:
       Why would we not cache this ?

##########
File path: core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala
##########
@@ -28,16 +28,23 @@ import org.apache.spark.internal.config
 import org.apache.spark.storage.BlockManagerId
 import org.apache.spark.util.Utils
 
+trait Location extends Externalizable {
+  def host: String
+  def port: Int
+  def hostPort: String
+  def executorId: String = "unknown"

Review comment:
       Based on discussion, if we are going to mirror everything in `BlockManagerId`, why not expose that directly with ability to subclass it and avoid `Location` altogether ?




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