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.
|
void |
changeSLA(String id,
String actions,
String dates,
String childIds,
String newParams)
Change SLA properties for job
|
void |
disableSLAAlert(String id,
String actions,
String dates,
String childIds)
Disable SLA alert for job
|
String |
dryRunSubmit(org.apache.hadoop.conf.Configuration conf)
Dry run a job; like
BaseEngine.submitJob(org.apache.hadoop.conf.Configuration, boolean) but doesn't actually execute
the job. |
void |
enableSLAAlert(String id,
String actions,
String dates,
String childIds)
Enable SLA alert for job
|
String |
getActionStatus(String actionId)
Return the status for an Action ID
|
CoordinatorActionBean |
getCoordAction(String actionId) |
List<Pair<CoordinatorActionBean,Map<String,ActionDependency>>> |
getCoordActionMissingDependencies(String id,
String actions,
String dates)
Get coord action missing dependencies
|
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.
|
WorkflowJob |
getJob(String jobId)
Return the info about a wf job.
|
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.
|
String |
getJobStatus(String jobId)
Return the status for a Job ID
|
List<WorkflowJobBean> |
getReruns(String coordActionId) |
List<CoordinatorWfActionBean> |
getWfActionByJobIdAndName(String jobId,
String wfActionName,
int offset,
int len)
get wf actions by action name in a coordinator job
|
CoordinatorActionInfo |
ignore(String jobId,
String type,
String scope) |
void |
kill(String jobId)
Kill a job.
|
CoordinatorActionInfo |
killActions(String jobId,
String rangeType,
String scope) |
CoordinatorJobInfo |
killJobs(String filter,
int start,
int length)
return a list of killed Coordinator job
|
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,
boolean failed,
org.apache.hadoop.conf.Configuration conf)
Rerun coordinator actions for given rerunType
|
void |
resume(String jobId)
Resume a job.
|
CoordinatorJobInfo |
resumeJobs(String filter,
int start,
int length)
return the jobs that've been resumed
|
void |
start(String jobId)
Deprecated.
|
protected void |
streamJobLog(XLogStreamer logStreamer,
String jobId,
Writer writer)
Stream job log.
|
void |
streamLog(String jobId,
String logRetrievalScope,
String logRetrievalType,
Writer writer,
Map<String,String[]> requestParameters)
Add list of actions to the filter based on conditions
|
String |
submitJob(org.apache.hadoop.conf.Configuration conf,
boolean startJob)
Submit a job.
|
void |
suspend(String jobId)
Suspend a job.
|
CoordinatorJobInfo |
suspendJobs(String filter,
int start,
int length)
return the jobs that've been suspended
|
String |
updateJob(org.apache.hadoop.conf.Configuration conf,
String jobId,
boolean dryrun,
boolean showDiff)
Update coord job definition.
|
getJMSTopicName, getUser, streamAuditLog, streamErrorLog, streamLogpublic 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 - the ID of the actionBaseEngineException - if the bean could not be retrievedpublic 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 returneddesc - true if actions are sorted in a descending order of nominal time, false if asc orderBaseEngineException - thrown if the job info could not be obtained.public String getJobIdForExternalId(String externalId) throws CoordinatorEngineException
BaseEngineThis is reverse lookup for recovery purposes.
getJobIdForExternalId 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, boolean failed, org.apache.hadoop.conf.Configuration conf) throws BaseEngineException
jobId - the job IDrerunType - rerun type RestConstants.JOB_COORD_SCOPE_DATE or RestConstants.JOB_COORD_SCOPE_ACTIONscope - the rerun scope for given rerunType separated by ","refresh - true if user wants to refresh input/output dataset urlsnoCleanup - false if user wants to cleanup output events for given rerun actionsfailed - true if user wants to rerun only failed nodesconf - configuration values for actionsBaseEngineException - thrown if the actions could not be rerunpublic 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.protected void streamJobLog(XLogStreamer logStreamer, String jobId, Writer writer) throws IOException, BaseEngineException
BaseEnginestreamJobLog in class BaseEnginelogStreamer - the log streamerjobId - the job idwriter - the writerIOException - Signals that an I/O exception has occurred.BaseEngineException - the base engine exceptionpublic void streamLog(String jobId, String logRetrievalScope, String logRetrievalType, Writer writer, Map<String,String[]> requestParameters) 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 torequestParameters - additional parameters from the requestIOException - in case of IO errorBaseEngineException - if there is an error during streamingCommandException - if a parameter could not be parsedpublic String submitJob(org.apache.hadoop.conf.Configuration conf, boolean startJob) throws CoordinatorEngineException
BaseEngineIt validates configuration properties.
submitJob 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
BaseEngineBaseEngine.submitJob(org.apache.hadoop.conf.Configuration, boolean) but doesn't actually execute
the job.
It validates configuration properties.
dryRunSubmit in class BaseEngineconf - job configuration.CoordinatorEngineExceptionpublic void suspend(String jobId) throws CoordinatorEngineException
BaseEnginesuspend in class BaseEnginejobId - job Id.CoordinatorEngineExceptionpublic WorkflowJob getJob(String jobId) throws BaseEngineException
BaseEnginegetJob in class BaseEnginejobId - job Id.DagEngineException - thrown if the job info could not be obtained.BaseEngineExceptionpublic 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 - he filter to parse. Elements must be semicolon-separated name=value pairs.
Supported names are inFILTER_NAMES.start - start from this job in the coordinatorlen - maximum number of resultsCoordinatorEngineException - if the job info could no be retrievedpublic 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 exceptionpublic String getJobStatus(String jobId) throws CoordinatorEngineException
getJobStatus in class BaseEnginejobId - job Id.CoordinatorEngineException - thrown if the job's status could not be obtainedpublic String getActionStatus(String actionId) throws CoordinatorEngineException
actionId - action Id.CoordinatorEngineException - thrown if the action's status could not be obtainedpublic void disableSLAAlert(String id, String actions, String dates, String childIds) throws BaseEngineException
BaseEnginedisableSLAAlert in class BaseEngineid - job IDactions - list of actionsdates - dateschildIds - child IDsBaseEngineException - thrown if SLA alert could not be disabledpublic void changeSLA(String id, String actions, String dates, String childIds, String newParams) throws BaseEngineException
BaseEnginechangeSLA in class BaseEngineid - job IDactions - list of actionsdates - dateschildIds - child IDsnewParams - parameters toBaseEngineException - thrown if SLA alert could not be enabledpublic void enableSLAAlert(String id, String actions, String dates, String childIds) throws BaseEngineException
BaseEngineenableSLAAlert in class BaseEngineid - job IDactions - list of actionsdates - dateschildIds - child IDsBaseEngineException - thrown if SLA alert could not be enabledpublic CoordinatorJobInfo killJobs(String filter, int start, int length) throws CoordinatorEngineException
filter - the filter string for which the coordinator jobs are killedstart - the starting index for coordinator jobslength - maximum number of jobs to be killedCoordinatorEngineException - thrown if one or more of the jobs cannot be killedpublic CoordinatorJobInfo suspendJobs(String filter, int start, int length) throws CoordinatorEngineException
filter - Filter for jobs that will be suspended, can be name, user, group, status, id or combination of anystart - Offset for the jobs that will be suspendedlength - maximum number of jobs that will be suspendedCoordinatorEngineException - if the jobs could not be suspendedpublic CoordinatorJobInfo resumeJobs(String filter, int start, int length) throws CoordinatorEngineException
filter - Filter for jobs that will be resumed, can be name, user, group, status, id or combination of anystart - Offset for the jobs that will be resumedlength - maximum number of jobs that will be resumedCoordinatorEngineException - if the jobs could not be resumedpublic List<Pair<CoordinatorActionBean,Map<String,ActionDependency>>> getCoordActionMissingDependencies(String id, String actions, String dates) throws CommandException
id - jobIDactions - action listdates - nominal time listCommandException - if the actions could not be retrievedpublic List<CoordinatorWfActionBean> getWfActionByJobIdAndName(String jobId, String wfActionName, int offset, int len) throws CoordinatorEngineException
jobId - coordinator job idwfActionName - workflow action nameoffset - offset in the coordinator joblen - maximum number of resultsCoordinatorEngineException - if the actions could not be retrievedCopyright © 2018 Apache Software Foundation. All rights reserved.