Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/962#discussion_r14305949
--- Diff: core/src/main/scala/org/apache/spark/rdd/HadoopRDD.scala ---
@@ -196,6 +197,17 @@ class HadoopRDD[K, V](
context.addOnCompleteCallback{ () => closeIfNeeded() }
val key: K = reader.createKey()
val value: V = reader.createValue()
+
+ // Set the task input metrics.
+ val inputMetrics = new InputMetrics(DataReadMethod.Hadoop)
+ try {
+ inputMetrics.bytesRead = split.inputSplit.value.getLength()
+ } catch {
+ case e: java.io.IOException =>
+ logWarning("Unable to get input size to set InputMetrics for
task", e)
+ }
+ context.taskMetrics.inputMetrics = Some(inputMetrics)
--- End diff --
Actually, now that we display the read method on the UI, we should set this
only if `bytesRead` exists (in the try block). Otherwise we end up with a bunch
of `0 bytes (memory)`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---