Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/20673#discussion_r173156595
--- Diff: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala ---
@@ -100,7 +102,24 @@ private[spark] object JsonProtocol {
executorMetricsUpdateToJson(metricsUpdate)
case blockUpdate: SparkListenerBlockUpdated =>
blockUpdateToJson(blockUpdate)
- case _ => parse(mapper.writeValueAsString(event))
+ case _ =>
+ // Use piped streams to avoid extra memory consumption
+ val outputStream = new PipedOutputStream()
+ val inputStream = new PipedInputStream(outputStream)
+ try {
+ val thread = new Thread("SparkListenerEvent json writer") {
--- End diff --
Hey @brkyvz, this approach with a thread seems a little bit overkill ..
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]