Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ class HadoopRDD[K, V](
val iter = new NextIterator[(K, V)] {

private val split = theSplit.asInstanceOf[HadoopPartition]
logInfo(log"Input split: ${MDC(INPUT_SPLIT, split.inputSplit)}")
logInfo(log"Task (TID ${MDC(TASK_ID, context.taskAttemptId())}) input split: " +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use TASK_ATTEMPT_ID?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

context.taskAttemptId() is task id, this was clarified in #45834 (comment)

log"${MDC(INPUT_SPLIT, split.inputSplit)}")
private val jobConf = getJobConf()

private val inputMetrics = context.taskMetrics().inputMetrics
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/scala/org/apache/spark/rdd/NewHadoopRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ class NewHadoopRDD[K, V](
override def compute(theSplit: Partition, context: TaskContext): InterruptibleIterator[(K, V)] = {
val iter = new Iterator[(K, V)] {
private val split = theSplit.asInstanceOf[NewHadoopPartition]
logInfo(log"Input split: ${MDC(INPUT_SPLIT, split.serializableHadoopSplit)}")
logInfo(log"Task (TID ${MDC(TASK_ID, context.taskAttemptId())}) input split: " +
log"${MDC(INPUT_SPLIT, split.serializableHadoopSplit)}")
private val conf = getConf

private val inputMetrics = context.taskMetrics().inputMetrics
Expand Down