Github user zsxwing commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskResult.scala 
    @@ -77,14 +78,12 @@ private[spark] class DirectTaskResult[T](
        * After the first time, `value()` is trivial and just returns the 
deserialized `valueObject`.
    -  def value(): T = {
    +  def value(resultSer: SerializerInstance = null): T = {
         if (valueObjectDeserialized) {
         } else {
    -      // This should not run when holding a lock because it may cost 
dozens of seconds for a large
    -      // value.
    -      val resultSer = SparkEnv.get.serializer.newInstance()
    -      valueObject = resultSer.deserialize(valueBytes)
    +      valueObject = 
    --- End diff --
    nit: I prefer the following codes because `Option(...).getOrElse` doesn't 
improve the readability but creates unnecessary objects.
    val resultSer = if (resultSer == null) 
SparkEnv.get.serializer.newInstance() else resultSer 
    valueObject = resultSer.deserialize(valueBytes)

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to