public abstract class BaseEngine extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BaseEngine.LOG_TYPE |
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 {@link BaseEngine#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
|
protected void |
fetchLog(XLogFilter filter,
Date startTime,
Date endTime,
Writer writer,
Map<String,String[]> params,
BaseEngine.LOG_TYPE logType) |
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.
|
abstract void |
streamAuditLog(String jobId,
Writer writer,
Map<String,String[]> params)
Stream Audit log of a job.
|
abstract void |
streamErrorLog(String jobId,
Writer writer,
Map<String,String[]> params)
Stream error log of a job.
|
abstract void |
streamLog(String jobId,
Writer writer,
Map<String,String[]> params)
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
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.BaseEngineException
public 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.BaseEngineException
public 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 returnedorder
- 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 abstract void streamLog(String jobId, Writer writer, Map<String,String[]> params) throws IOException, BaseEngineException
jobId
- 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 abstract void streamErrorLog(String jobId, Writer writer, Map<String,String[]> params) throws IOException, BaseEngineException
jobId
- 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 abstract void streamAuditLog(String jobId, Writer writer, Map<String,String[]> params) throws IOException, BaseEngineException
jobId
- 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 abstract String getJobIdForExternalId(String externalId) throws BaseEngineException
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
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
- actions
- dates
- childIds
- BaseEngineException
public abstract void disableSLAAlert(String id, String actions, String dates, String childIds) throws BaseEngineException
id
- actions
- dates
- childIds
- BaseEngineException
public abstract void changeSLA(String id, String actions, String dates, String childIds, String newParams) throws BaseEngineException
id
- actions
- childIds
- newParams
- BaseEngineException
protected void fetchLog(XLogFilter filter, Date startTime, Date endTime, Writer writer, Map<String,String[]> params, BaseEngine.LOG_TYPE logType) throws IOException
IOException
Copyright © 2015 Apache Software Foundation. All Rights Reserved.