public class TokenUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
KEY_NAME_PREFIX |
| Constructor and Description |
|---|
TokenUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addTokenForJob(org.elasticsearch.hadoop.rest.RestClient client,
org.elasticsearch.hadoop.util.ClusterName clusterName,
User user,
Job job)
Retrieves an authentication token from the given user, obtaining a new token if necessary,
and adds it to the credentials for the given map reduce job.
|
static void |
addTokenForJobConf(org.elasticsearch.hadoop.rest.RestClient client,
org.elasticsearch.hadoop.util.ClusterName clusterName,
User user,
JobConf job)
Retrieves an authentication token from the given user, obtaining a new token if necessary,
and adds it to the credentials for the given map reduce job configuration.
|
static void |
obtainAndCache(org.elasticsearch.hadoop.rest.RestClient client,
User user)
Obtain an authentication token for the given user and add it to the
user's credentials.
|
static Token<EsTokenIdentifier> |
obtainToken(org.elasticsearch.hadoop.rest.RestClient client,
User user)
Obtain and return an authentication token for the current user.
|
static void |
obtainTokenForJob(org.elasticsearch.hadoop.rest.RestClient client,
User user,
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 void |
obtainTokenForJob(org.elasticsearch.hadoop.rest.RestClient client,
User user,
JobConf jobConf)
Obtain an authentication token on behalf of the given user and add it to
the credentials for the given map reduce job.
|
public static final java.lang.String KEY_NAME_PREFIX
public static Token<EsTokenIdentifier> obtainToken(org.elasticsearch.hadoop.rest.RestClient client, User user)
client - The Elasticsearch clientpublic static void obtainAndCache(org.elasticsearch.hadoop.rest.RestClient client,
User user)
throws java.io.IOException
client - The Elasticsearch clientuser - The user for obtaining and storing the tokenjava.io.IOException - If making a remote call to the authentication service failspublic static void obtainTokenForJob(org.elasticsearch.hadoop.rest.RestClient client,
User user,
Job job)
client - The Elasticsearch clientuser - The user for whom to obtain the tokenjob - The job instance in which the token should be storedpublic static void obtainTokenForJob(org.elasticsearch.hadoop.rest.RestClient client,
User user,
JobConf jobConf)
client - The Elasticsearch clientuser - The user for whom to obtain the tokenjobConf - The job configuration in which the token should be storedpublic static void addTokenForJob(org.elasticsearch.hadoop.rest.RestClient client,
org.elasticsearch.hadoop.util.ClusterName clusterName,
User user,
Job job)
client - The Elasticsearch clientclusterName - the name of the cluster you are connecting touser - The user for whom to obtain the tokenjob - The job instance in which the token should be storedjava.io.IOException - If making a remote call failsjava.lang.InterruptedException - If executing as the given user is interruptedpublic static void addTokenForJobConf(org.elasticsearch.hadoop.rest.RestClient client,
org.elasticsearch.hadoop.util.ClusterName clusterName,
User user,
JobConf job)
client - The Elasticsearch clientclusterName - the name of the cluster you are connecting touser - The user for whom to obtain the tokenjob - The job instance in which the token should be storedjava.io.IOException - If making a remote call failsjava.lang.InterruptedException - If executing as the given user is interrupted