public class ImpersonationUtil extends Object
Modifier and Type | Method and Description |
---|---|
static DrillFileSystem |
createFileSystem(String proxyUserName,
org.apache.hadoop.conf.Configuration fsConf)
Create DrillFileSystem for given proxyUserName and configuration.
|
static org.apache.hadoop.security.UserGroupInformation |
createProxyUgi(String proxyUserName)
Create and return proxy user
UserGroupInformation for given user name. |
static org.apache.hadoop.security.UserGroupInformation |
createProxyUgi(String opUserName,
String queryUserName)
Create and return proxy user
UserGroupInformation of operator owner if operator
owner is valid. |
static String[] |
getProcessUserGroupNames()
Return the list of groups to which the process user belongs.
|
static String |
getProcessUserName()
Return the name of the user who is running the Drillbit.
|
static org.apache.hadoop.security.UserGroupInformation |
getProcessUserUGI()
Return the
UserGroupInformation of user who is running the Drillbit. |
static boolean |
hasAdminPrivileges(String userName,
String adminUsers,
String adminGroups)
Given admin user/group list, finds whether the given username has admin privileges.
|
static String |
resolveUserName(String userName)
If the given user name is empty, return the current process user name.
|
public static org.apache.hadoop.security.UserGroupInformation createProxyUgi(String opUserName, String queryUserName)
UserGroupInformation
of operator owner if operator
owner is valid. Otherwise create and return proxy user UserGroupInformation
for
query user.opUserName
- Name of the user whom to impersonate while setting up the operator.queryUserName
- Name of the user who issues the query. If opUserName is invalid,
then this parameter must be valid user name.public static org.apache.hadoop.security.UserGroupInformation createProxyUgi(String proxyUserName)
UserGroupInformation
for given user name.proxyUserName
- Proxy user name (must be valid)public static String resolveUserName(String userName)
userName
- User name found in GroupScan POP definition.public static String getProcessUserName()
public static String[] getProcessUserGroupNames()
public static org.apache.hadoop.security.UserGroupInformation getProcessUserUGI()
UserGroupInformation
of user who is running the Drillbit.UserGroupInformation
.public static DrillFileSystem createFileSystem(String proxyUserName, org.apache.hadoop.conf.Configuration fsConf)
proxyUserName
- Name of the user whom to impersonate while accessing the FileSystem contents.fsConf
- FileSystem configuration.public static boolean hasAdminPrivileges(String userName, String adminUsers, String adminGroups)
userName
- User who is checked for administrative privileges.adminUsers
- Comma separated list of admin usernames,adminGroups
- Comma separated list of admin usergroupsCopyright © 1970 The Apache Software Foundation. All rights reserved.