Github user tgravescs commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12760#discussion_r61893228
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -2179,6 +2179,24 @@ private[spark] object Utils extends Logging {
           .getOrElse(UserGroupInformation.getCurrentUser().getShortUserName())
       }
     
    +  val EMPTY_USER_GROUPS = Set[String]()
    +
    +  // Returns the groups to which the current user belongs.
    +  def getCurrentUserGroups(sparkConf: SparkConf, username: String): 
Set[String] = {
    +    val groupProviderClassName = 
sparkConf.get("spark.user.groups.mapping", "")
    +    if (groupProviderClassName != "") {
    +      try {
    +        val groupMappingServiceProvider = 
classForName(groupProviderClassName).newInstance.
    +          
asInstanceOf[org.apache.spark.security.GroupMappingServiceProvider]
    +        val currentUserGroups = 
groupMappingServiceProvider.getGroups(username)
    +        return currentUserGroups
    +      } catch {
    +        case e: Exception => logError("Unable to get groups for user=" + 
username + " msg" + e)
    --- End diff --
    
    logError has a syntax logError(msg, e) change to use that


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

Reply via email to