Skip to content

Commit

Permalink
Made inc/dec functions private[spark]
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Ganelin committed Jan 15, 2015
1 parent 1149e78 commit 6444391
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,50 +48,50 @@ class TaskMetrics extends Serializable {
*/
private var _executorDeserializeTime: Long = _
def executorDeserializeTime = _executorDeserializeTime
def incExecutorDeserializeTime(value: Long) = _executorDeserializeTime += value
def decExecutorDeserializeTime(value: Long) = _executorDeserializeTime -= value
private[spark] def incExecutorDeserializeTime(value: Long) = _executorDeserializeTime += value
private[spark] def decExecutorDeserializeTime(value: Long) = _executorDeserializeTime -= value


/**
* Time the executor spends actually running the task (including fetching shuffle data)
*/
private var _executorRunTime: Long = _
def executorRunTime = _executorRunTime
def incExecutorRunTime(value: Long) = _executorRunTime += value
def decExecutorRunTime(value: Long) = _executorRunTime -= value
private[spark] def incExecutorRunTime(value: Long) = _executorRunTime += value
private[spark] def decExecutorRunTime(value: Long) = _executorRunTime -= value

/**
* The number of bytes this task transmitted back to the driver as the TaskResult
*/
private var _resultSize: Long = _
def resultSize = _resultSize
def incResultSize(value: Long) = _resultSize += value
def decResultSize(value: Long) = _resultSize -= value
private[spark] def incResultSize(value: Long) = _resultSize += value
private[spark] def decResultSize(value: Long) = _resultSize -= value


/**
* Amount of time the JVM spent in garbage collection while executing this task
*/
private var _jvmGCTime: Long = _
def jvmGCTime = _jvmGCTime
def incJvmGCTime(value: Long) = _jvmGCTime += value
def decJvmGCTime(value: Long) = _jvmGCTime -= value
private[spark] def incJvmGCTime(value: Long) = _jvmGCTime += value
private[spark] def decJvmGCTime(value: Long) = _jvmGCTime -= value

/**
* Amount of time spent serializing the task result
*/
private var _resultSerializationTime: Long = _
def resultSerializationTime = _resultSerializationTime
def incResultSerializationTime(value: Long) = _resultSerializationTime += value
def decResultSerializationTime(value: Long) = _resultSerializationTime -= value
private[spark] def incResultSerializationTime(value: Long) = _resultSerializationTime += value
private[spark] def decResultSerializationTime(value: Long) = _resultSerializationTime -= value

/**
* The number of in-memory bytes spilled by this task
*/
private var _memoryBytesSpilled: Long = _
def memoryBytesSpilled = _memoryBytesSpilled
def incMemoryBytesSpilled(value: Long) = _memoryBytesSpilled += value
def decMemoryBytesSpilled(value: Long) = _memoryBytesSpilled -= value
private[spark] def incMemoryBytesSpilled(value: Long) = _memoryBytesSpilled += value
private[spark] def decMemoryBytesSpilled(value: Long) = _memoryBytesSpilled -= value

/**
* The number of on-disk bytes spilled by this task
Expand Down Expand Up @@ -209,8 +209,8 @@ case class InputMetrics(readMethod: DataReadMethod.Value) {
*/
private var _bytesRead: Long = _
def bytesRead = _bytesRead
def incBytesRead(value: Long) = _bytesRead += value
def decBytesRead(value: Long) = _bytesRead -= value
private[spark] def incBytesRead(value: Long) = _bytesRead += value
private[spark] def decBytesRead(value: Long) = _bytesRead -= value
}

/**
Expand All @@ -224,8 +224,8 @@ case class OutputMetrics(writeMethod: DataWriteMethod.Value) {
*/
private var _bytesWritten: Long = _
def bytesWritten = _bytesWritten
def incBytesWritten(value : Long) = _bytesWritten += value
def decBytesWritten(value : Long) = _bytesWritten -= value
private[spark] def incBytesWritten(value : Long) = _bytesWritten += value
private[spark] def decBytesWritten(value : Long) = _bytesWritten -= value
}

/**
Expand All @@ -239,16 +239,16 @@ class ShuffleReadMetrics extends Serializable {
*/
private var _remoteBlocksFetched: Int = _
def remoteBlocksFetched = _remoteBlocksFetched
def incRemoteBlocksFetched(value: Int) = _remoteBlocksFetched += value
def defRemoteBlocksFetched(value: Int) = _remoteBlocksFetched -= value
private[spark] def incRemoteBlocksFetched(value: Int) = _remoteBlocksFetched += value
private[spark] def defRemoteBlocksFetched(value: Int) = _remoteBlocksFetched -= value

/**
* Number of local blocks fetched in this shuffle by this task
*/
private var _localBlocksFetched: Int = _
def localBlocksFetched = _localBlocksFetched
def incLocalBlocksFetched(value: Int) = _localBlocksFetched += value
def defLocalBlocksFetched(value: Int) = _localBlocksFetched -= value
private[spark] def incLocalBlocksFetched(value: Int) = _localBlocksFetched += value
private[spark] def defLocalBlocksFetched(value: Int) = _localBlocksFetched -= value


/**
Expand All @@ -258,16 +258,16 @@ class ShuffleReadMetrics extends Serializable {
*/
private var _fetchWaitTime: Long = _
def fetchWaitTime = _fetchWaitTime
def incFetchWaitTime(value: Long) = _fetchWaitTime += value
def decFetchWaitTime(value: Long) = _fetchWaitTime -= value
private[spark] def incFetchWaitTime(value: Long) = _fetchWaitTime += value
private[spark] def decFetchWaitTime(value: Long) = _fetchWaitTime -= value

/**
* Total number of remote bytes read from the shuffle by this task
*/
private var _remoteBytesRead: Long = _
def remoteBytesRead = _remoteBytesRead
def incRemoteBytesRead(value: Long) = _remoteBytesRead += value
def decRemoteBytesRead(value: Long) = _remoteBytesRead -= value
private[spark] def incRemoteBytesRead(value: Long) = _remoteBytesRead += value
private[spark] def decRemoteBytesRead(value: Long) = _remoteBytesRead -= value

/**
* Number of blocks fetched in this shuffle by this task (remote or local)
Expand All @@ -285,15 +285,17 @@ class ShuffleWriteMetrics extends Serializable {
* Number of bytes written for the shuffle by this task
*/
@volatile private var _shuffleBytesWritten: Long = _
def incShuffleBytesWritten(value: Long) = _shuffleBytesWritten += value
def decShuffleBytesWritten(value: Long) = _shuffleBytesWritten -= value
def shuffleBytesWritten = _shuffleBytesWritten
private[spark] def incShuffleBytesWritten(value: Long) = _shuffleBytesWritten += value
private[spark] def decShuffleBytesWritten(value: Long) = _shuffleBytesWritten -= value

/**
* Time the task spent blocking on writes to disk or buffer cache, in nanoseconds
*/
@volatile private var _shuffleWriteTime: Long = _
def incShuffleWriteTime(value: Long) = _shuffleWriteTime += value
def decShuffleWriteTime(value: Long) = _shuffleWriteTime -= value
def shuffleWriteTime= _shuffleWriteTime
private[spark] def incShuffleWriteTime(value: Long) = _shuffleWriteTime += value
private[spark] def decShuffleWriteTime(value: Long) = _shuffleWriteTime -= value


}

0 comments on commit 6444391

Please sign in to comment.