You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2013/12/20 03:12:47 UTC

[3/8] git commit: Incorporate pwendell's code review suggestions.

Incorporate pwendell's code review suggestions.


Project: http://git-wip-us.apache.org/repos/asf/incubator-spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-spark/commit/963d6f06
Tree: http://git-wip-us.apache.org/repos/asf/incubator-spark/tree/963d6f06
Diff: http://git-wip-us.apache.org/repos/asf/incubator-spark/diff/963d6f06

Branch: refs/heads/master
Commit: 963d6f065a763c2b94529bbd3ac4326e190bb2d7
Parents: 882d544
Author: Tor Myklebust <tm...@gmail.com>
Authored: Mon Dec 16 23:14:52 2013 -0500
Committer: Tor Myklebust <tm...@gmail.com>
Committed: Mon Dec 16 23:14:52 2013 -0500

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/executor/Executor.scala   | 6 +++---
 .../src/main/scala/org/apache/spark/executor/TaskMetrics.scala | 4 ++--
 core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala   | 4 ++--
 .../spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala   | 3 +--
 4 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/963d6f06/core/src/main/scala/org/apache/spark/executor/Executor.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/executor/Executor.scala b/core/src/main/scala/org/apache/spark/executor/Executor.scala
index 02ad64d..0f19d7a 100644
--- a/core/src/main/scala/org/apache/spark/executor/Executor.scala
+++ b/core/src/main/scala/org/apache/spark/executor/Executor.scala
@@ -222,9 +222,9 @@ private[spark] class Executor(
           return
         }
 
-        val objectSer = SparkEnv.get.serializer.newInstance()
+        val resultSer = SparkEnv.get.serializer.newInstance()
         val beforeSerialization = System.currentTimeMillis()
-        val valueBytes = objectSer.serialize(value)
+        val valueBytes = resultSer.serialize(value)
         val afterSerialization = System.currentTimeMillis()
 
         for (m <- task.metrics) {
@@ -232,7 +232,7 @@ private[spark] class Executor(
           m.executorDeserializeTime = (taskStart - startTime).toInt
           m.executorRunTime = (taskFinish - taskStart).toInt
           m.jvmGCTime = gcTime - startGCTime
-          m.serializationTime = (afterSerialization - beforeSerialization).toInt
+          m.resultSerializationTime = (afterSerialization - beforeSerialization).toInt
         }
 
         val accumUpdates = Accumulators.values

http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/963d6f06/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala b/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
index c036866..bb1471d 100644
--- a/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
+++ b/core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
@@ -44,9 +44,9 @@ class TaskMetrics extends Serializable {
   var jvmGCTime: Long = _
 
   /**
-   * Amount of time spent serializing the result of the task
+   * Amount of time spent serializing the task result
    */
-  var serializationTime: Long = _
+  var resultSerializationTime: Long = _
 
   /**
    * If this task reads from shuffle output, metrics on getting shuffle data will be collected here

http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/963d6f06/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
index 81651bd..2f06efa 100644
--- a/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
+++ b/core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala
@@ -102,8 +102,8 @@ private[spark] class StagePage(parent: JobProgressUI) {
         }
         else {
           val serializationTimes = validTasks.map{case (info, metrics, exception) =>
-            metrics.get.serializationTime.toDouble}
-          val serializationQuantiles = "Serialization Time" +: Distribution(serializationTimes).get.getQuantiles().map(
+            metrics.get.resultSerializationTime.toDouble}
+          val serializationQuantiles = "Result serialization time" +: Distribution(serializationTimes).get.getQuantiles().map(
             ms => parent.formatDuration(ms.toLong))
 
           val serviceTimes = validTasks.map{case (info, metrics, exception) =>

http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/963d6f06/core/src/test/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala
index 788cbb8..2476ab5 100644
--- a/core/src/test/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala
@@ -314,7 +314,6 @@ class ClusterTaskSetManagerSuite extends FunSuite with LocalSparkContext with Lo
 
   def createTaskResult(id: Int): DirectTaskResult[Int] = {
     val objectSer = SparkEnv.get.serializer.newInstance()
-    new DirectTaskResult[Int](objectSer.serialize(id), mutable.Map.empty,
-        new TaskMetrics)
+    new DirectTaskResult[Int](objectSer.serialize(id), mutable.Map.empty, new TaskMetrics)
   }
 }