Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
TokenUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addTokenForJob(Connection conn,
org.apache.hadoop.mapred.JobConf job,
User user)
Checks for an authentication token for the given user, obtaining a new token if necessary, and
adds it to the credentials for the given map reduce job.
|
static void |
addTokenForJob(Connection conn,
User user,
org.apache.hadoop.mapreduce.Job job)
Checks for an authentication token for the given user, obtaining a new token if necessary, and
adds it to the credentials for the given map reduce job.
|
static boolean |
addTokenIfMissing(Connection conn,
User user)
Checks if an authentication tokens exists for the connected cluster, obtaining one if needed
and adding it to the user's credentials.
|
private static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
getAuthToken(Connection conn,
User user)
Get the authentication token of the user for the cluster specified in the configuration
|
private static org.apache.hadoop.io.Text |
getClusterId(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token) |
static void |
obtainAndCacheToken(Connection conn,
User user)
|
static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
obtainToken(org.apache.hadoop.conf.Configuration conf)
Deprecated.
Since 2.0.0.
|
static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
obtainToken(Connection conn)
Deprecated.
External users should not use this method. Please post on the HBase dev mailing
list if you need this method. Internal HBase code should use
ClientTokenUtil instead. |
static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
obtainToken(Connection conn,
User user)
Deprecated.
External users should not use this method. Please post on the HBase dev mailing
list if you need this method. Internal HBase code should use
ClientTokenUtil instead. |
static void |
obtainTokenForJob(Connection conn,
org.apache.hadoop.mapred.JobConf job,
User user)
Obtain an authentication token on behalf of the given user and add it to the credentials for
the given map reduce job.
|
static void |
obtainTokenForJob(Connection conn,
User user,
org.apache.hadoop.mapreduce.Job job)
Obtain an authentication token on behalf of the given user and add it to the credentials for
the given map reduce job.
|
static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> |
toToken(org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token proto)
Deprecated.
External users should not use this method. Please post on the HBase dev mailing
list if you need this method. Internal HBase code should use
ClientTokenUtil instead. |
static org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token |
toToken(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token)
Deprecated.
External users should not use this method. Please post on the HBase dev mailing
list if you need this method. Internal HBase code should use
ClientTokenUtil instead. |
private static final org.slf4j.Logger LOG
public TokenUtil()
@Deprecated public static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
@Deprecated public static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(Connection conn) throws IOException
ClientTokenUtil
instead.IOException
@Deprecated public static org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token toToken(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token)
ClientTokenUtil
instead.@Deprecated public static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> obtainToken(Connection conn, User user) throws IOException, InterruptedException
ClientTokenUtil
instead.IOException
InterruptedException
public static void obtainAndCacheToken(Connection conn, User user) throws IOException, InterruptedException
IOException
InterruptedException
@Deprecated public static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> toToken(org.apache.hadoop.hbase.protobuf.generated.AuthenticationProtos.Token proto)
ClientTokenUtil
instead.ClientTokenUtil#toToken(org.apache.hadoop.hbase.shaded.protobuf.generated.AuthenticationProtos.Token)
.private static org.apache.hadoop.io.Text getClusterId(org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> token) throws IOException
IOException
public static void obtainTokenForJob(Connection conn, User user, org.apache.hadoop.mapreduce.Job job) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job instance in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static void obtainTokenForJob(Connection conn, org.apache.hadoop.mapred.JobConf job, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job configuration in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static void addTokenForJob(Connection conn, org.apache.hadoop.mapred.JobConf job, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job configuration in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static void addTokenForJob(Connection conn, User user, org.apache.hadoop.mapreduce.Job job) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenjob
- The job instance in which the token should be storedIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedpublic static boolean addTokenIfMissing(Connection conn, User user) throws IOException, InterruptedException
conn
- The HBase cluster connectionuser
- The user for whom to obtain the tokenIOException
- If making a remote call to the authentication service failsInterruptedException
- If executing as the given user is interruptedprivate static org.apache.hadoop.security.token.Token<AuthenticationTokenIdentifier> getAuthToken(Connection conn, User user) throws IOException
IOException
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.