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 2019/10/23 21:39:33 UTC

[GitHub] [spark] dbtsai commented on a change in pull request #26235: [SPARK-29576][Core] Use Spark's CompressionCodec for Ser/Deser of MapOutputStatus

dbtsai commented on a change in pull request #26235: [SPARK-29576][Core] Use Spark's CompressionCodec for Ser/Deser of MapOutputStatus
URL: https://github.com/apache/spark/pull/26235#discussion_r338291945
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/MapOutputTracker.scala
 ##########
 @@ -952,11 +936,12 @@ private[spark] object MapOutputTracker extends Logging {
   }
 
   // Opposite of serializeMapStatuses.
-  def deserializeMapStatuses(bytes: Array[Byte]): Array[MapStatus] = {
+  def deserializeMapStatuses(bytes: Array[Byte], conf: SparkConf): Array[MapStatus] = {
     assert (bytes.length > 0)
 
     def deserializeObject(arr: Array[Byte], off: Int, len: Int): AnyRef = {
-      val objIn = new ObjectInputStream(new ZstdInputStream(
+      val codec = CompressionCodec.createCodec(conf, "zstd")
 
 Review comment:
   Yes. The codec is wrapped in buffered stream which avoids overhead excessive of JNI call while trying to compress small amount of data.

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


With regards,
Apache Git Services

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