public class CoordinatorEngine extends BaseEngine
| Modifier and Type | Class and Description |
|---|---|
static class |
CoordinatorEngine.FILTER_COMPARATORS |
| Modifier and Type | Field and Description |
|---|---|
static String |
COORD_ACTIONS_LOG_MAX_COUNT |
static String[] |
VALID_JOB_FILTERS |
USE_XCOMMAND, user| Constructor and Description |
|---|
CoordinatorEngine()
Create a system Coordinator engine, with no user and no group.
|
CoordinatorEngine(String user)
Create a Coordinator engine to perform operations on behave of a user.
|
| Modifier and Type | Method and Description |
|---|---|
void |
change(String jobId,
String changeValue)
Change a coordinator job.
|
String |
dryRunSubmit(org.apache.hadoop.conf.Configuration conf)
Dry run a job; like {@link BaseEngine#submitJob(org.apache.hadoop.conf.Configuration, boolean) but doesn't actually execute
the job.
|
CoordinatorActionBean |
getCoordAction(String actionId) |
CoordinatorJobBean |
getCoordJob(String jobId)
Return the info about a coord job.
|
CoordinatorJobBean |
getCoordJob(String jobId,
String filter,
int offset,
int length,
boolean desc)
Return the info about a coord job with actions subset.
|
CoordinatorJobInfo |
getCoordJobs(String filter,
int start,
int len) |
String |
getDefinition(String jobId)
Return the a job definition.
|
org.apache.oozie.client.WorkflowJob |
getJob(String jobId)
Return the info about a wf job.
|
org.apache.oozie.client.WorkflowJob |
getJob(String jobId,
int start,
int length)
Return the info about a wf job with actions subset.
|
String |
getJobIdForExternalId(String externalId)
Return the workflow Job ID for an external ID.
|
List<WorkflowJobBean> |
getReruns(String coordActionId) |
CoordinatorActionInfo |
ignore(String jobId,
String type,
String scope) |
void |
kill(String jobId)
Kill a job.
|
CoordinatorActionInfo |
killActions(String jobId,
String rangeType,
String scope) |
Map<Pair<String,CoordinatorEngine.FILTER_COMPARATORS>,List<Object>> |
parseJobFilter(String filter) |
void |
reRun(String jobId,
org.apache.hadoop.conf.Configuration conf)
Deprecated.
|
CoordinatorActionInfo |
reRun(String jobId,
String rerunType,
String scope,
boolean refresh,
boolean noCleanup)
Rerun coordinator actions for given rerunType
|
void |
resume(String jobId)
Resume a job.
|
void |
start(String jobId)
Deprecated.
|
void |
streamLog(String jobId,
String logRetrievalScope,
String logRetrievalType,
Writer writer,
Map<String,String[]> params)
Add list of actions to the filter based on conditions
|
void |
streamLog(String jobId,
Writer writer,
Map<String,String[]> params)
Stream the log of a job.
|
String |
submitJob(org.apache.hadoop.conf.Configuration conf,
boolean startJob)
Submit a job.
|
void |
suspend(String jobId)
Suspend a job.
|
String |
updateJob(org.apache.hadoop.conf.Configuration conf,
String jobId,
boolean dryrun,
boolean showDiff)
Update coord job definition.
|
getJMSTopicName, getUserpublic static final String COORD_ACTIONS_LOG_MAX_COUNT
public static final String[] VALID_JOB_FILTERS
public CoordinatorEngine()
public CoordinatorEngine(String user)
user - user name.public String getDefinition(String jobId) throws BaseEngineException
BaseEnginegetDefinition in class BaseEnginejobId - job Id.BaseEngineException - thrown if the job definition could no be obtained.public CoordinatorActionBean getCoordAction(String actionId) throws BaseEngineException
actionId - BaseEngineExceptionpublic CoordinatorJobBean getCoordJob(String jobId) throws BaseEngineException
BaseEnginegetCoordJob in class BaseEnginejobId - job Id.BaseEngineException - thrown if the job info could not be obtained.public CoordinatorJobBean getCoordJob(String jobId, String filter, int offset, int length, boolean desc) throws BaseEngineException
BaseEnginegetCoordJob in class BaseEnginejobId - job Id.filter - the status filteroffset - starting from this index in the list of actions belonging to the joblength - number of actions to be returnedBaseEngineException - thrown if the job info could not be obtained.public String getJobIdForExternalId(String externalId) throws CoordinatorEngineException
BaseEnginegetJobIdForExternalId in class BaseEngineexternalId - external ID provided at job submission time.null if none.CoordinatorEngineExceptionpublic void kill(String jobId) throws CoordinatorEngineException
BaseEnginekill in class BaseEnginejobId - job Id.CoordinatorEngineExceptionpublic CoordinatorActionInfo killActions(String jobId, String rangeType, String scope) throws CoordinatorEngineException
CoordinatorEngineExceptionpublic void change(String jobId, String changeValue) throws CoordinatorEngineException
BaseEnginechange in class BaseEnginejobId - job Id.changeValue - change value.CoordinatorEngineExceptionpublic CoordinatorActionInfo ignore(String jobId, String type, String scope) throws CoordinatorEngineException
CoordinatorEngineException@Deprecated public void reRun(String jobId, org.apache.hadoop.conf.Configuration conf) throws BaseEngineException
BaseEnginereRun in class BaseEnginejobId - job Id to rerun.conf - configuration information for the rerun.BaseEngineException - thrown if the job could not be rerun.public CoordinatorActionInfo reRun(String jobId, String rerunType, String scope, boolean refresh, boolean noCleanup) throws BaseEngineException
jobId - rerunType - scope - refresh - noCleanup - BaseEngineExceptionpublic void resume(String jobId) throws CoordinatorEngineException
BaseEngineresume in class BaseEnginejobId - job Id.CoordinatorEngineException@Deprecated public void start(String jobId) throws BaseEngineException
BaseEnginestart in class BaseEnginejobId - job Id.BaseEngineException - thrown if the job could not be started.public void streamLog(String jobId, Writer writer, Map<String,String[]> params) throws IOException, BaseEngineException
BaseEnginestreamLog in class BaseEnginejobId - job Id.writer - writer to stream the log to.params - additional parameters from the requestIOException - thrown if the log cannot be streamed.BaseEngineException - thrown if there is error in getting the Workflow/Coordinator Job Information for
jobId.public void streamLog(String jobId, String logRetrievalScope, String logRetrievalType, Writer writer, Map<String,String[]> params) throws IOException, BaseEngineException, CommandException
jobId - Job IdlogRetrievalScope - Value for the retrieval typelogRetrievalType - Based on which filter criteria the log is retrievedwriter - writer to stream the log toparams - additional parameters from the requestIOExceptionBaseEngineExceptionCommandExceptionpublic String submitJob(org.apache.hadoop.conf.Configuration conf, boolean startJob) throws CoordinatorEngineException
BaseEnginesubmitJob in class BaseEngineconf - job configuration.startJob - indicates if the job should be started or not.CoordinatorEngineExceptionpublic String dryRunSubmit(org.apache.hadoop.conf.Configuration conf) throws CoordinatorEngineException
BaseEnginedryRunSubmit in class BaseEngineconf - job configuration.CoordinatorEngineExceptionpublic void suspend(String jobId) throws CoordinatorEngineException
BaseEnginesuspend in class BaseEnginejobId - job Id.CoordinatorEngineExceptionpublic org.apache.oozie.client.WorkflowJob getJob(String jobId) throws BaseEngineException
BaseEnginegetJob in class BaseEnginejobId - job Id.DagEngineException - thrown if the job info could not be obtained.BaseEngineExceptionpublic org.apache.oozie.client.WorkflowJob getJob(String jobId, int start, int length) throws BaseEngineException
BaseEnginegetJob in class BaseEnginejobId - job Idstart - starting from this index in the list of actions belonging to the joblength - number of actions to be returnedDagEngineException - thrown if the job info could not be obtained.BaseEngineExceptionpublic CoordinatorJobInfo getCoordJobs(String filter, int start, int len) throws CoordinatorEngineException
filter - start - len - CoordinatorEngineExceptionpublic Map<Pair<String,CoordinatorEngine.FILTER_COMPARATORS>,List<Object>> parseJobFilter(String filter) throws CoordinatorEngineException
CoordinatorEngineExceptionpublic List<WorkflowJobBean> getReruns(String coordActionId) throws CoordinatorEngineException
CoordinatorEngineExceptionpublic String updateJob(org.apache.hadoop.conf.Configuration conf, String jobId, boolean dryrun, boolean showDiff) throws CoordinatorEngineException
conf - the confjobId - the job iddryrun - the dryrunshowDiff - the show diffCoordinatorEngineException - the coordinator engine exceptionCopyright © 2014 Apache Software Foundation. All Rights Reserved.