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


##########
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:
   May be persistence handling for sensitive fields:
   - When spark.authenticate=true: consider encrypting the persisted data 
instead of redacting it.
   - When spark.authenticate=false: no change to existing behavior.



-- 
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