public class LocalOozieClient extends org.apache.oozie.client.OozieClient
getJobsInfo(String)
getJobsInfo(String, int, int)
methods:
[NAME=VALUE][;NAME=VALUE]*
. Valid filter names are: 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, COORD_ACTION_NOTIFICATION_URL, COORDINATOR_APP_PATH, debugMode, EXTERNAL_ID, FILTER_APPNAME, FILTER_FREQUENCY, FILTER_GROUP, FILTER_ID, FILTER_JOBID, FILTER_NAME, FILTER_NOMINAL_TIME, FILTER_SLA_APPNAME, FILTER_SLA_ID, FILTER_SLA_NOMINAL_END, FILTER_SLA_NOMINAL_START, FILTER_SLA_PARENT_ID, FILTER_STATUS, FILTER_UNIT, FILTER_USER, GROUP_NAME, JOB_ACL, LIBPATH, LOG_TOKEN, OOZIE_SUSPEND_ON_NODES, RERUN_FAIL_NODES, RERUN_SKIP_NODES, USE_SYSTEM_LIBPATH, USER_NAME, WORKFLOW_NOTIFICATION_URL, WS_PROTOCOL_VERSION, WS_PROTOCOL_VERSION_0, WS_PROTOCOL_VERSION_1
Constructor and Description |
---|
LocalOozieClient(DagEngine dagEngine)
Create a workflow client for Oozie local use.
|
Modifier and Type | Method and Description |
---|---|
Properties |
createConfiguration()
Create an empty configuration with just the
OozieClient.USER_NAME set to the JVM user name and the OozieClient.GROUP_NAME set to 'other'. |
String |
getHeader(String name)
Get the value of a set HTTP header from the workflow instance.
|
Iterator<String> |
getHeaderNames()
Return an iterator with all the header names set in the workflow instance.
|
String |
getJobId(String externalId)
Return the workflow job Id for an external Id.
|
org.apache.oozie.client.WorkflowJob |
getJobInfo(String jobId)
Get the info of a workflow job.
|
List<org.apache.oozie.client.WorkflowJob> |
getJobsInfo(String filter)
Return the info of the workflow jobs that match the filter.
|
List<org.apache.oozie.client.WorkflowJob> |
getJobsInfo(String filter,
int start,
int len)
Return the info of the workflow jobs that match the filter.
|
String |
getOozieUrl()
Return the Oozie URL of the workflow client instance.
|
String |
getProtocolUrl()
Return the Oozie URL used by the client and server for WS communications.
|
void |
kill(String jobId)
Kill a workflow job.
|
void |
removeHeader(String name)
Remove a HTTP header from the workflow client instance.
|
void |
reRun(String jobId,
Properties conf)
Rerun a workflow job.
|
void |
resume(String jobId)
Resume a workflow job.
|
String |
run(Properties conf)
Submit and start a workflow job.
|
void |
setHeader(String name,
String value)
Set a HTTP header to be used in the WS requests by the workflow instance.
|
void |
start(String jobId)
Start a workflow job.
|
String |
submit(Properties conf)
Submit a workflow job.
|
void |
suspend(String jobId)
Suspend a workflow job.
|
void |
validateWSVersion()
Validate that the Oozie client and server instances are protocol compatible.
|
change, createConnection, createRetryableConnection, doAs, dryrun, getAvailableOozieServers, getBulkInfo, getBundleJobInfo, getBundleJobsInfo, getClientBuildVersion, getCoordActionInfo, getCoordJobInfo, getCoordJobInfo, getCoordJobInfo, getCoordJobsInfo, getDebugMode, getHeaders, getJMSConnectionInfo, getJMSTopicName, getJobDefinition, getJobInfo, getJobLog, getJobLog, getJobLog, getQueueDump, getRetryCount, getServerBuildVersion, getSlaInfo, getSystemMode, getWfsForCoordAction, getWorkflowActionInfo, ignore, kill, listShareLib, notEmpty, notNull, reRunBundle, reRunCoord, setDebugMode, setRetryCount, setSystemMode, updateCoord, updateCoord, updateShareLib, writeToXml
public LocalOozieClient(DagEngine dagEngine)
dagEngine
- the dag engine instance to use.public String getOozieUrl()
getOozieUrl
in class org.apache.oozie.client.OozieClient
public String getProtocolUrl() throws org.apache.oozie.client.OozieClientException
getProtocolUrl
in class org.apache.oozie.client.OozieClient
org.apache.oozie.client.OozieClientException
- thrown in the client and the server are not protocol
compatible.public void validateWSVersion() throws org.apache.oozie.client.OozieClientException
validateWSVersion
in class org.apache.oozie.client.OozieClient
org.apache.oozie.client.OozieClientException
- thrown in the client and the server are not protocol
compatible.public Properties createConfiguration()
OozieClient.USER_NAME
set to the JVM user name and the OozieClient.GROUP_NAME
set to 'other'.createConfiguration
in class org.apache.oozie.client.OozieClient
public void setHeader(String name, String value)
setHeader
in class org.apache.oozie.client.OozieClient
name
- header name.value
- header value.public String getHeader(String name)
getHeader
in class org.apache.oozie.client.OozieClient
name
- header name.null
if not set.public void removeHeader(String name)
removeHeader
in class org.apache.oozie.client.OozieClient
name
- header name.public Iterator<String> getHeaderNames()
getHeaderNames
in class org.apache.oozie.client.OozieClient
public String submit(Properties conf) throws org.apache.oozie.client.OozieClientException
submit
in class org.apache.oozie.client.OozieClient
conf
- job configuration.org.apache.oozie.client.OozieClientException
- thrown if the job could not be submitted.public void start(String jobId) throws org.apache.oozie.client.OozieClientException
start
in class org.apache.oozie.client.OozieClient
jobId
- job Id.org.apache.oozie.client.OozieClientException
- thrown if the job could not be started.public String run(Properties conf) throws org.apache.oozie.client.OozieClientException
run
in class org.apache.oozie.client.OozieClient
conf
- job configuration.org.apache.oozie.client.OozieClientException
- thrown if the job could not be submitted.public void reRun(String jobId, Properties conf) throws org.apache.oozie.client.OozieClientException
reRun
in class org.apache.oozie.client.OozieClient
jobId
- job Id to rerun.conf
- configuration information for the rerun.org.apache.oozie.client.OozieClientException
- thrown if the job could not be started.public void suspend(String jobId) throws org.apache.oozie.client.OozieClientException
suspend
in class org.apache.oozie.client.OozieClient
jobId
- job Id.org.apache.oozie.client.OozieClientException
- thrown if the job could not be suspended.public void resume(String jobId) throws org.apache.oozie.client.OozieClientException
resume
in class org.apache.oozie.client.OozieClient
jobId
- job Id.org.apache.oozie.client.OozieClientException
- thrown if the job could not be resume.public void kill(String jobId) throws org.apache.oozie.client.OozieClientException
kill
in class org.apache.oozie.client.OozieClient
jobId
- job Id.org.apache.oozie.client.OozieClientException
- thrown if the job could not be killed.public org.apache.oozie.client.WorkflowJob getJobInfo(String jobId) throws org.apache.oozie.client.OozieClientException
getJobInfo
in class org.apache.oozie.client.OozieClient
jobId
- job Id.org.apache.oozie.client.OozieClientException
- thrown if the job info could not be retrieved.public List<org.apache.oozie.client.WorkflowJob> getJobsInfo(String filter, int start, int len) throws org.apache.oozie.client.OozieClientException
getJobsInfo
in class org.apache.oozie.client.OozieClient
filter
- job filter. Refer to the LocalOozieClient
for the filter syntax.start
- jobs offset, base 1.len
- number of jobs to return.org.apache.oozie.client.OozieClientException
- thrown if the jobs info could not be retrieved.public List<org.apache.oozie.client.WorkflowJob> getJobsInfo(String filter) throws org.apache.oozie.client.OozieClientException
getJobsInfo
in class org.apache.oozie.client.OozieClient
filter
- job filter. Refer to the LocalOozieClient
for the filter syntax.org.apache.oozie.client.OozieClientException
- thrown if the jobs info could not be retrieved.public String getJobId(String externalId) throws org.apache.oozie.client.OozieClientException
getJobId
in class org.apache.oozie.client.OozieClient
externalId
- external Id given at job creation time.null
if none.org.apache.oozie.client.OozieClientException
- thrown if the operation could not be done.Copyright © 2014 Apache Software Foundation. All Rights Reserved.