public abstract class BaseEngine extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
USE_XCOMMAND |
protected String |
user |
| Constructor and Description |
|---|
BaseEngine() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
change(String jobId,
String changeValue)
Change a coordinator job.
|
abstract void |
changeSLA(String id,
String actions,
String dates,
String childIds,
String newParams)
Change SLA properties for job
|
abstract void |
disableSLAAlert(String id,
String actions,
String dates,
String childIds)
Disable SLA alert for job
|
abstract String |
dryRunSubmit(org.apache.hadoop.conf.Configuration conf)
Dry run a job; like
submitJob(org.apache.hadoop.conf.Configuration, boolean) but doesn't actually execute
the job. |
abstract void |
enableSLAAlert(String id,
String actions,
String dates,
String childIds)
Enable SLA alert for job
|
abstract CoordinatorJob |
getCoordJob(String jobId)
Return the info about a coord job.
|
abstract CoordinatorJob |
getCoordJob(String jobId,
String filter,
int start,
int length,
boolean desc)
Return the info about a coord job with actions subset.
|
abstract String |
getDefinition(String jobId)
Return the a job definition.
|
String |
getJMSTopicName(String jobId)
Return the jms topic name for the job.
|
abstract WorkflowJob |
getJob(String jobId)
Return the info about a wf job.
|
abstract WorkflowJob |
getJob(String jobId,
int start,
int length)
Return the info about a wf job with actions subset.
|
abstract String |
getJobIdForExternalId(String externalId)
Return the workflow Job ID for an external ID.
|
abstract String |
getJobStatus(String jobId)
Return the status for a Job ID
|
String |
getUser()
Return the user name.
|
abstract void |
kill(String jobId)
Kill a job.
|
abstract void |
reRun(String jobId,
org.apache.hadoop.conf.Configuration conf)
Rerun a job.
|
abstract void |
resume(String jobId)
Resume a job.
|
abstract void |
start(String jobId)
Start a job.
|
void |
streamAuditLog(String jobId,
Writer writer,
Map<String,String[]> requestParameters)
Stream Audit log of a job.
|
void |
streamErrorLog(String jobId,
Writer writer,
Map<String,String[]> requestParameters)
Stream error log of a job.
|
protected abstract void |
streamJobLog(XLogStreamer logStreamer,
String jobId,
Writer writer)
Stream job log.
|
void |
streamLog(String jobId,
Writer writer,
Map<String,String[]> requestParameters)
Stream the log of a job.
|
abstract String |
submitJob(org.apache.hadoop.conf.Configuration conf,
boolean startJob)
Submit a job.
|
abstract void |
suspend(String jobId)
Suspend a job.
|
public static final String USE_XCOMMAND
public BaseEngine()
public abstract String submitJob(org.apache.hadoop.conf.Configuration conf, boolean startJob) throws BaseEngineException
It validates configuration properties.
conf - job configuration.startJob - indicates if the job should be started or not.BaseEngineException - thrown if the job could not be created.public abstract void start(String jobId) throws BaseEngineException
jobId - job Id.BaseEngineException - thrown if the job could not be started.public abstract void resume(String jobId) throws BaseEngineException
jobId - job Id.BaseEngineException - thrown if the job could not be resumed.public abstract void suspend(String jobId) throws BaseEngineException
jobId - job Id.BaseEngineException - thrown if the job could not be suspended.public abstract void kill(String jobId) throws BaseEngineException
jobId - job Id.BaseEngineException - thrown if the job could not be killed.public abstract void change(String jobId, String changeValue) throws BaseEngineException
jobId - job Id.changeValue - change value.BaseEngineException - thrown if the job could not be changed.public abstract void reRun(String jobId, org.apache.hadoop.conf.Configuration conf) throws BaseEngineException
jobId - job Id to rerun.conf - configuration information for the rerun.BaseEngineException - thrown if the job could not be rerun.public abstract WorkflowJob getJob(String jobId) throws BaseEngineException
jobId - job Id.DagEngineException - thrown if the job info could not be obtained.BaseEngineExceptionpublic abstract WorkflowJob getJob(String jobId, int start, int length) throws BaseEngineException
jobId - 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 abstract CoordinatorJob getCoordJob(String jobId) throws BaseEngineException
jobId - job Id.BaseEngineException - thrown if the job info could not be obtained.public abstract CoordinatorJob getCoordJob(String jobId, String filter, int start, int length, boolean desc) throws BaseEngineException
jobId - job Id.filter - the status filterstart - 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 abstract String getDefinition(String jobId) throws BaseEngineException
jobId - job Id.BaseEngineException - thrown if the job definition could no be obtained.public void streamLog(String jobId, Writer writer, Map<String,String[]> requestParameters) throws IOException, BaseEngineException
jobId - job Id.writer - writer to stream the log to.requestParameters - 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 streamErrorLog(String jobId, Writer writer, Map<String,String[]> requestParameters) throws IOException, BaseEngineException
jobId - job Id.writer - writer to stream the log to.requestParameters - 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 streamAuditLog(String jobId, Writer writer, Map<String,String[]> requestParameters) throws IOException, BaseEngineException
jobId - job Id.writer - writer to stream the log to.requestParameters - 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 abstract String getJobIdForExternalId(String externalId) throws BaseEngineException
This is reverse lookup for recovery purposes.
externalId - external ID provided at job submission time.null if none.BaseEngineException - thrown if the lookup could not be done.public abstract String dryRunSubmit(org.apache.hadoop.conf.Configuration conf) throws BaseEngineException
submitJob(org.apache.hadoop.conf.Configuration, boolean) but doesn't actually execute
the job.
It validates configuration properties.
conf - job configuration.BaseEngineException - thrown if there was a problem doing the dryrunpublic String getJMSTopicName(String jobId) throws DagEngineException
jobId - job Id.DagEngineException - thrown if the jms info could not be obtained.public abstract String getJobStatus(String jobId) throws BaseEngineException
jobId - job Id.BaseEngineException - thrown if the job's status could not be obtainedpublic abstract void enableSLAAlert(String id, String actions, String dates, String childIds) throws BaseEngineException
id - job IDactions - list of actionsdates - dateschildIds - child IDsBaseEngineException - thrown if SLA alert could not be enabledpublic abstract void disableSLAAlert(String id, String actions, String dates, String childIds) throws BaseEngineException
id - job IDactions - list of actionsdates - dateschildIds - child IDsBaseEngineException - thrown if SLA alert could not be disabledpublic abstract void changeSLA(String id, String actions, String dates, String childIds, String newParams) throws BaseEngineException
id - job IDactions - list of actionsdates - dateschildIds - child IDsnewParams - parameters toBaseEngineException - thrown if SLA alert could not be enabledprotected abstract void streamJobLog(XLogStreamer logStreamer, String jobId, Writer writer) throws IOException, BaseEngineException
logStreamer - the log streamerjobId - the job idwriter - the writerIOException - Signals that an I/O exception has occurred.BaseEngineException - the base engine exceptionCopyright © 2018 Apache Software Foundation. All rights reserved.