public class AuthOozieClient extends XOozieClient
XOozieClient
supports Kerberos HTTP SPNEGO and simple authentication.Modifier and Type | Class and Description |
---|---|
static class |
AuthOozieClient.AuthType |
OozieClient.ClientCallable<T>, OozieClient.Instrumentation, OozieClient.MapClientCallable, OozieClient.Metrics, OozieClient.SORT_BY, OozieClient.SYSTEM_MODE
Modifier and Type | Field and Description |
---|---|
static File |
AUTH_TOKEN_CACHE_FILE
File constant that defines the location of the authentication token cache file.
|
static String |
AUTHENTICATOR_CLASS_SYS_PROP
Java system property to specify a custom Authenticator implementation.
|
static String |
USE_AUTH_TOKEN_CACHE_SYS_PROP
Java system property that, if set the authentication token will be cached in the user home directory in a hidden
file
.oozie-auth-token with user read/write permissions only. |
ARCHIVES, FILES, HIVE_OPTIONS, HIVE_SCRIPT, HIVE_SCRIPT_PARAMS, IS_PROXY_SUBMISSION, NN, NN_2, PIG_OPTIONS, PIG_SCRIPT, PIG_SCRIPT_PARAMS, RM, SQOOP_COMMAND, SQOOP_OPTIONS
ACTION_MAX_RETRIES, ACTION_NOTIFICATION_URL, ACTION_RETRY_INTERVAL, APP_PATH, BUNDLE_APP_PATH, BUNDLE_ID, CHANGE_VALUE_CONCURRENCY, CHANGE_VALUE_ENDTIME, CHANGE_VALUE_PAUSETIME, CHANGE_VALUE_STATUS, CONFIG_KEY_GENERATED_XML, COORD_ACTION_NOTIFICATION_PROXY, COORD_ACTION_NOTIFICATION_URL, COORDINATOR_APP_PATH, debugMode, EXTERNAL_ID, FILTER_APPNAME, FILTER_CREATED_TIME_END, FILTER_CREATED_TIME_START, FILTER_FREQUENCY, FILTER_GROUP, FILTER_ID, FILTER_JOBID, FILTER_NAME, FILTER_NOMINAL_TIME, FILTER_SORT_BY, FILTER_STATUS, FILTER_TEXT, FILTER_UNIT, FILTER_USER, GROUP_NAME, JOB_ACL, LIBPATH, LOG_TOKEN, OOZIE_SUSPEND_ON_NODES, RERUN_FAIL_NODES, RERUN_SKIP_NODES, SLA_DISABLE_ALERT, SLA_DISABLE_ALERT_COORD, SLA_DISABLE_ALERT_OLDER_THAN, SLA_ENABLE_ALERT, USE_SYSTEM_LIBPATH, USER_NAME, WORKFLOW_NOTIFICATION_PROXY, WORKFLOW_NOTIFICATION_URL, WS_PROTOCOL_VERSION, WS_PROTOCOL_VERSION_0, WS_PROTOCOL_VERSION_1
Constructor and Description |
---|
AuthOozieClient(String oozieUrl)
Create an instance of the AuthOozieClient.
|
AuthOozieClient(String oozieUrl,
String authOption)
Create an instance of the AuthOozieClient.
|
Modifier and Type | Method and Description |
---|---|
protected HttpURLConnection |
createConnection(URL url,
String method)
Create an authenticated connection to the Oozie server.
|
protected org.apache.hadoop.security.authentication.client.Authenticator |
getAuthenticator()
Return the Hadoop-auth Authenticator to use.
|
protected Map<String,Class<? extends org.apache.hadoop.security.authentication.client.Authenticator>> |
getAuthenticators()
Get the map for classes of Authenticator.
|
String |
getAuthOption()
Get authOption
|
protected org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token |
readAuthToken()
Read a authentication token cached in the user home directory.
|
protected void |
writeAuthToken(org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token authToken)
Write the current authentication token to the user home directory.authOption
|
addArchive, addFile, setLib, submitMapReduce, submitPig, submitScriptLanguage, submitScriptLanguage, submitSqoop
bulkModifyJobs, change, createConfiguration, createRetryableConnection, doAs, dryrun, getAvailableOozieServers, getBulkInfo, getBundleJobInfo, getBundleJobsInfo, getClientBuildVersion, getCoordActionInfo, getCoordActionMissingDependencies, getCoordActionMissingDependencies, getCoordJobInfo, getCoordJobInfo, getCoordJobInfo, getCoordJobsInfo, getDebugMode, getHeader, getHeaderNames, getHeaders, getInstrumentation, getJavaSystemProperties, getJMSConnectionInfo, getJMSTopicName, getJobAuditLog, getJobDefinition, getJobErrorLog, getJobId, getJobInfo, getJobInfo, getJobLog, getJobLog, getJobLog, getJobsInfo, getJobsInfo, getMetrics, getOozieUrl, getOSEnv, getProtocolUrl, getQueueDump, getRetryCount, getServerBuildVersion, getServerConfiguration, getSlaInfo, getStatus, getSystemMode, getWfsForCoordAction, getWorkflowActionInfo, getWorkflowActionRetriesInfo, ignore, kill, kill, killJobs, listShareLib, mapToString, notEmpty, notNull, pollJob, purgeCommand, removeHeader, reRun, reRunBundle, reRunCoord, reRunCoord, resume, resumeJobs, run, run, setDebugMode, setHeader, setRetryCount, setSystemMode, slaChange, slaChange, slaChange, slaDisableAlert, slaDisableAlert, slaEnableAlert, slaEnableAlert, start, submit, submit, suspend, suspendJobs, updateCoord, updateCoord, updateShareLib, validateWSVersion, validateXML, writeToXml
public static final String AUTHENTICATOR_CLASS_SYS_PROP
public static final String USE_AUTH_TOKEN_CACHE_SYS_PROP
.oozie-auth-token
with user read/write permissions only.public static final File AUTH_TOKEN_CACHE_FILE
It resolves to ${user.home}/.oozie-auth-token
.
public AuthOozieClient(String oozieUrl)
oozieUrl
- the Oozie URLpublic AuthOozieClient(String oozieUrl, String authOption)
oozieUrl
- the Oozie URLauthOption
- the auth optionprotected HttpURLConnection createConnection(URL url, String method) throws IOException, OozieClientException
It uses Hadoop-auth client authentication which by default supports Kerberos HTTP SPNEGO, Pseudo/Simple and anonymous.
if the Java system property USE_AUTH_TOKEN_CACHE_SYS_PROP
is set to true Hadoop-auth
authentication token will be cached/used in/from the '.oozie-auth-token' file in the user
home directory.
createConnection
in class OozieClient
url
- the URL to open a HTTP connection to.method
- the HTTP method for the HTTP connection.IOException
- if an IO error occurred.OozieClientException
- if an oozie client error occurred.protected org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token readAuthToken()
protected void writeAuthToken(org.apache.hadoop.security.authentication.client.AuthenticatedURL.Token authToken)
The file is written with user only read/write permissions.
If the file cannot be updated or the user only ready/write permissions cannot be set the file is deleted.
authToken
- the authentication token to cache.protected org.apache.hadoop.security.authentication.client.Authenticator getAuthenticator() throws OozieClientException
It first looks for value of command line option 'auth', if not set it continues to check
AUTHENTICATOR_CLASS_SYS_PROP
Java system property for Authenticator.
It the value of the AUTHENTICATOR_CLASS_SYS_PROP
is not set it uses
Hadoop-auth KerberosAuthenticator
which supports both Kerberos HTTP SPNEGO and Pseudo/simple
authentication.
NULL
if none.OozieClientException
- thrown if the authenticator could not be instantiated.protected Map<String,Class<? extends org.apache.hadoop.security.authentication.client.Authenticator>> getAuthenticators()
public String getAuthOption()
Copyright © 2019 Apache Software Foundation. All rights reserved.