关注 spark技术分享,
撸spark源码 玩spark最佳实践

ShuffleWriteMetrics

ShuffleWriteMetrics

ShuffleWriteMetrics is a collection of accumulators that represents task metrics about writing shuffle data.

ShuffleWriteMetrics tracks the following task metrics:

Note
Accumulators allow tasks (running on executors) to communicate with the driver.
Table 1. ShuffleWriteMetrics’s Accumulators
Name Description

_bytesWritten

Accumulator to track how many shuffle bytes were written in a shuffle task.

Used when ShuffleWriteMetrics is requested the shuffle bytes written and to increment or decrement it.

NOTE: _bytesWritten is available as internal.metrics.shuffle.write.bytesWritten (internally shuffleWrite.BYTES_WRITTEN) in TaskMetrics.

_writeTime

Accumulator to track shuffle write time (as 64-bit integer) of a shuffle task.

Used when ShuffleWriteMetrics is requested the shuffle write time and to increment it.

NOTE: _writeTime is available as internal.metrics.shuffle.write.writeTime (internally shuffleWrite.WRITE_TIME) in TaskMetrics.

_recordsWritten

Accumulator to track how many shuffle records were written in a shuffle task.

Used when ShuffleWriteMetrics is requested the shuffle records written and to increment or decrement it.

NOTE: _recordsWritten is available as internal.metrics.shuffle.write.recordsWritten (internally shuffleWrite.RECORDS_WRITTEN) in TaskMetrics.

decRecordsWritten Method

Caution
FIXME

decBytesWritten Method

Caution
FIXME

writeTime Method

Caution
FIXME

recordsWritten Method

Caution
FIXME

Returning Number of Shuffle Bytes Written — bytesWritten Method

bytesWritten represents the shuffle bytes written metrics of a shuffle task.

Internally, bytesWritten returns the sum of _bytesWritten internal accumulator.

Incrementing Shuffle Bytes Written Metrics — incBytesWritten Method

incBytesWritten simply adds v to _bytesWritten internal accumulator.

Incrementing Shuffle Write Time Metrics — incWriteTime Method

incWriteTime simply adds v to _writeTime internal accumulator.

Note

incWriteTime is used when:

  1. SortShuffleWriter stops.

  2. BypassMergeSortShuffleWriter writes records (i.e. when it initializes DiskBlockObjectWriter partition writers) and later when concatenates per-partition files into a single file.

  3. UnsafeShuffleWriter does mergeSpillsWithTransferTo.

  4. DiskBlockObjectWriter does commitAndGet (but only when syncWrites flag is enabled that forces outstanding writes to disk).

  5. JsonProtocol creates TaskMetrics from JSON

  6. TimeTrackingOutputStream does its operation (after all it is an output stream to track shuffle write time).

Incrementing Shuffle Records Written Metrics — incRecordsWritten Method

incRecordsWritten simply adds v to _recordsWritten internal accumulator.

赞(0) 打赏
未经允许不得转载:spark技术分享 » ShuffleWriteMetrics
分享到: 更多 (0)

关注公众号:spark技术分享

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏