From 9f0dc829cbaa9aa5011fb917010d13ea5e0a19d7 Mon Sep 17 00:00:00 2001 From: Matei Zaharia Date: Mon, 4 Mar 2013 12:08:31 -0800 Subject: Fix TaskMetrics not being serializable --- core/src/main/scala/spark/executor/TaskMetrics.scala | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'core') diff --git a/core/src/main/scala/spark/executor/TaskMetrics.scala b/core/src/main/scala/spark/executor/TaskMetrics.scala index 800305cd6c..b9c07830f5 100644 --- a/core/src/main/scala/spark/executor/TaskMetrics.scala +++ b/core/src/main/scala/spark/executor/TaskMetrics.scala @@ -1,14 +1,16 @@ package spark.executor -class TaskMetrics{ +class TaskMetrics extends Serializable { /** * Time taken on the executor to deserialize this task */ var executorDeserializeTime: Int = _ + /** * Time the executor spends actually running the task (including fetching shuffle data) */ var executorRunTime:Int = _ + /** * The number of bytes this task transmitted back to the driver as the TaskResult */ @@ -23,49 +25,54 @@ class TaskMetrics{ * If this task writes to shuffle output, metrics on the written shuffle data will be collected here */ var shuffleWriteMetrics: Option[ShuffleWriteMetrics] = None - } object TaskMetrics { - private[spark] def empty() : TaskMetrics = new TaskMetrics + private[spark] def empty(): TaskMetrics = new TaskMetrics } -class ShuffleReadMetrics { +class ShuffleReadMetrics extends Serializable { /** * Total number of blocks fetched in a shuffle (remote or local) */ var totalBlocksFetched : Int = _ + /** * Number of remote blocks fetched in a shuffle */ var remoteBlocksFetched: Int = _ + /** * Local blocks fetched in a shuffle */ var localBlocksFetched: Int = _ + /** * Total time to read shuffle data */ var shuffleReadMillis: Long = _ + /** * Total time that is spent blocked waiting for shuffle to fetch remote data */ var remoteFetchWaitTime: Long = _ + /** * The total amount of time for all the shuffle fetches. This adds up time from overlapping * shuffles, so can be longer than task time */ var remoteFetchTime: Long = _ + /** * Total number of remote bytes read from a shuffle */ var remoteBytesRead: Long = _ } -class ShuffleWriteMetrics { +class ShuffleWriteMetrics extends Serializable { /** * Number of bytes written for a shuffle */ var shuffleBytesWritten: Long = _ -} \ No newline at end of file +} -- cgit v1.2.3