wangyum commented on code in PR #57796:
URL: https://github.com/apache/spark/pull/57796#discussion_r3726088010


##########
core/src/main/scala/org/apache/spark/deploy/master/ApplicationInfo.scala:
##########
@@ -204,4 +205,23 @@ private[spark] class ApplicationInfo(
       System.currentTimeMillis() - startTime
     }
   }
+
+  private[deploy] def redactedCopy(conf: SparkConf): ApplicationInfo = {
+    val redactedCommand = desc.command.copy(
+      environment = Utils.redact(conf, desc.command.environment.toSeq).toMap,
+      javaOpts = Utils.redactCommandLineArgs(conf, desc.command.javaOpts))
+    val redactedDesc = desc.copy(command = redactedCommand)
+    new ApplicationInfo(startTime, id, redactedDesc, submitDate, driver, 
defaultCores)
+  }
+
+  @transient private var _conf: SparkConf = _
+
+  private[deploy] def withConf(conf: SparkConf): this.type = {
+    _conf = conf
+    this
+  }
+
+  private def writeReplace(): AnyRef = {
+    if (_conf == null) this else redactedCopy(_conf)
+  }
 }

Review Comment:
   Thank you @uros-b, I reduced the scope to RPC only, and this only affects 
Spark Standalone mode. ApplicationInfo/DriverInfo are 
Standalone/Master-specific classes; YARN and Kubernetes do not use them or have 
an equivalent RPC.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to