Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/5064#discussion_r34398124
--- Diff: core/src/main/scala/org/apache/spark/executor/TaskMetrics.scala
---
@@ -212,10 +213,26 @@ class TaskMetrics extends Serializable {
private[spark] def updateInputMetrics(): Unit = synchronized {
inputMetrics.foreach(_.updateBytesRead())
}
+
+ @throws(classOf[IOException])
+ private def readObject(in: ObjectInputStream): Unit =
Utils.tryOrIOException {
+ in.defaultReadObject()
+ // Get the hostname from cached data, since hostname is the order of
number of nodes in
+ // cluster, so using cached hostname will decrease the object number
and alleviate the GC
+ // overhead.
+ _hostname = TaskMetrics.getCachedHostName(_hostname)
+ }
}
private[spark] object TaskMetrics {
+ private val hostNameCache = new ConcurrentHashMap[String, String]()
--- End diff --
I think its fine for now. It may be a problem for really long running
applications with lots of node churn (executors are dead and wont be needed but
still occupy this hashmap). But thats a really far fetched problem.
---
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]