This is an automated email from the ASF dual-hosted git repository.
huaxingao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 63f0f91b3f5 [SPARK-39390][CORE] Hide and optimize
`viewAcls`/`viewAclsGroups`/`modifyAcls`/`modifyAclsGroups` from INFO log
63f0f91b3f5 is described below
commit 63f0f91b3f5c5d1dee9236824027bd978192a9ff
Author: Qian.Sun <[email protected]>
AuthorDate: Mon Jun 6 21:21:45 2022 -0700
[SPARK-39390][CORE] Hide and optimize
`viewAcls`/`viewAclsGroups`/`modifyAcls`/`modifyAclsGroups` from INFO log
### What changes were proposed in this pull request?
This PR aims to hide and optimize
`viewAcls`/`viewAclsGroups`/`modifyAcls`/`modifyAclsGroups` from INFO log.
### Why are the changes needed?
* In case of empty Set, `Set()`, there is no much information to users.
* In case of non-empty Set, `Set(root)`, there is poor reading experience
to users.
```scala
2022-06-02 22:02:48.328 - stderr> 22/06/03 05:02:48 INFO SecurityManager:
SecurityManager: authentication
disabled; ui acls disabled; users with view permissions: Set(root); groups
with view permissions: Set();
users with modify permissions: Set(root); groups with modify permissions:
Set()
```
### Does this PR introduce _any_ user-facing change?
This is a INFO log only change.
### How was this patch tested?
Manually.
**BEFORE**
```scala
2022-06-02 22:02:48.328 - stderr> 22/06/03 05:02:48 INFO SecurityManager:
SecurityManager: authentication
disabled; ui acls disabled; users with view permissions: Set(root); groups
with view permissions: Set();
users with modify permissions: Set(root); groups with modify permissions:
Set()
```
**AFTER**
```scala
2022-06-02 22:02:48.328 - stderr> 22/06/03 05:02:48 INFO SecurityManager:
SecurityManager: authentication
disabled; ui acls disabled; users with view permissions: root; groups with
view permissions: EMPTY;
users with modify permissions: root; groups with modify permissions: root,
spark
```
Closes #36777 from dcoliversun/SPARK-39390.
Authored-by: Qian.Sun <[email protected]>
Signed-off-by: huaxingao <[email protected]>
---
core/src/main/scala/org/apache/spark/SecurityManager.scala | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/core/src/main/scala/org/apache/spark/SecurityManager.scala
b/core/src/main/scala/org/apache/spark/SecurityManager.scala
index f11176cc233..7e72ae8d89e 100644
--- a/core/src/main/scala/org/apache/spark/SecurityManager.scala
+++ b/core/src/main/scala/org/apache/spark/SecurityManager.scala
@@ -87,10 +87,14 @@ private[spark] class SecurityManager(
private var secretKey: String = _
logInfo("SecurityManager: authentication " + (if (authOn) "enabled" else
"disabled") +
"; ui acls " + (if (aclsOn) "enabled" else "disabled") +
- "; users with view permissions: " + viewAcls.toString() +
- "; groups with view permissions: " + viewAclsGroups.toString() +
- "; users with modify permissions: " + modifyAcls.toString() +
- "; groups with modify permissions: " + modifyAclsGroups.toString())
+ "; users with view permissions: " +
+ (if (viewAcls.nonEmpty) viewAcls.mkString(", ") else "EMPTY") +
+ "; groups with view permissions: " +
+ (if (viewAclsGroups.nonEmpty) viewAclsGroups.mkString(", ") else "EMPTY") +
+ "; users with modify permissions: " +
+ (if (modifyAcls.nonEmpty) modifyAcls.mkString(", ") else "EMPTY") +
+ "; groups with modify permissions: " +
+ (if (modifyAclsGroups.nonEmpty) modifyAclsGroups.mkString(", ") else
"EMPTY"))
private val hadoopConf = SparkHadoopUtil.get.newConfiguration(sparkConf)
// the default SSL configuration - it will be used by all communication
layers unless overwritten
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]