Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/10815#discussion_r50057880
--- Diff: core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala
---
@@ -1196,28 +1198,40 @@ class PairRDDFunctions[K, V](self: RDD[(K, V)])
writer.close()
}
writer.commit()
- bytesWrittenCallback.foreach { fn =>
outputMetrics.setBytesWritten(fn()) }
- outputMetrics.setRecordsWritten(recordsWritten)
+ outputMetrics.foreach { om =>
+ bytesWrittenCallback.foreach { fn => om.setBytesWritten(fn()) }
+ om.setRecordsWritten(recordsWritten)
+ }
}
self.context.runJob(self, writeToFile)
writer.commitJob()
}
- private def initHadoopOutputMetrics(context: TaskContext):
(OutputMetrics, Option[() => Long]) = {
+ // TODO: these don't seem like the right abstractions.
+ // We should abstract the duplicate code in a less awkward way.
+
+ private def initHadoopOutputMetrics(
+ context: TaskContext): (Option[OutputMetrics], Option[() => Long]) =
{
--- End diff --
Also we should probably do a systematic refactor here instead of trying to
marginally make it less awkward.
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]