|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.security.User
public abstract class User
Wrapper to abstract out usage of user and group information in HBase.
This class provides a common interface for interacting with user and group
information across changing APIs in different versions of Hadoop. It only
provides access to the common set of functionality in
UserGroupInformation
currently needed by
HBase, but can be extended as needs change.
Note: this class does not attempt to support any of the Kerberos authentication methods exposed in security-enabled Hadoop (for the moment at least), as they're not yet needed. Properly supporting authentication is left up to implementation in secure HBase.
Field Summary | |
---|---|
protected org.apache.hadoop.security.UserGroupInformation |
ugi
|
Constructor Summary | |
---|---|
User()
|
Method Summary | ||
---|---|---|
static User |
createUserForTesting(org.apache.hadoop.conf.Configuration conf,
String name,
String[] groups)
Generates a new User instance specifically for use in test code. |
|
static User |
getCurrent()
Returns the User instance within current execution context. |
|
String |
getName()
Returns the full user name. |
|
abstract String |
getShortName()
Returns the shortened version of the user name -- the portion that maps to an operating system user name. |
|
static void |
login(org.apache.hadoop.conf.Configuration conf,
String fileConfKey,
String principalConfKey,
String localhost)
Log in the current process using the given configuration keys for the credential file and login principal. |
|
abstract
|
runAs(PrivilegedAction<T> action)
Executes the given action within the context of this user. |
|
abstract
|
runAs(PrivilegedExceptionAction<T> action)
Executes the given action within the context of this user. |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected org.apache.hadoop.security.UserGroupInformation ugi
Constructor Detail |
---|
public User()
Method Detail |
---|
public String getName()
public abstract String getShortName()
public abstract <T> T runAs(PrivilegedAction<T> action)
public abstract <T> T runAs(PrivilegedExceptionAction<T> action) throws IOException, InterruptedException
IOException
InterruptedException
public String toString()
toString
in class Object
public static User getCurrent() throws IOException
User
instance within current execution context.
IOException
public static User createUserForTesting(org.apache.hadoop.conf.Configuration conf, String name, String[] groups)
User
instance specifically for use in test code.
name
- the full usernamegroups
- the group names to which the test user will belong
User
instancepublic static void login(org.apache.hadoop.conf.Configuration conf, String fileConfKey, String principalConfKey, String localhost) throws IOException
This is only applicable when running on secure Hadoop -- see org.apache.hadoop.security.SecurityUtil#login(Configuration,String,String,String). On regular Hadoop (without security features), this will safely be ignored.
conf
- The configuration data to usefileConfKey
- Property key used to configure path to the credential fileprincipalConfKey
- Property key used to configure login principallocalhost
- Current hostname to use in any credentials
IOException
- underlying exception from SecurityUtil.login() call
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |