public class BundleEngine extends BaseEngine
USE_XCOMMAND, user
Constructor and Description |
---|
BundleEngine()
Create a system Bundle engine, with no user and no group.
|
BundleEngine(String user)
Create a Bundle 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
|
BulkResponseInfo |
getBulkJobs(String bulkFilter,
int start,
int len)
Get bulk job response
|
BundleJobBean |
getBundleJob(String jobId) |
BundleJobInfo |
getBundleJobs(String filter,
int start,
int len)
Get bundle jobs
|
CoordinatorJob |
getCoordJob(String jobId)
Return the info about a coord job.
|
CoordinatorJob |
getCoordJob(String jobId,
String filter,
int start,
int length,
boolean desc)
Return the info about a coord job with actions subset.
|
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
|
void |
kill(String jobId)
Kill a job.
|
BundleJobInfo |
killJobs(String filter,
int start,
int len)
return a list of killed Bundle job
|
static Map<String,List<String>> |
parseBulkFilter(String bulkParams)
Parse filter string to a map with key = filter name and values = filter values
Allowed keys are defined as constants on top
|
void |
reRun(String jobId,
org.apache.hadoop.conf.Configuration conf)
Deprecated.
|
void |
reRun(String jobId,
String coordScope,
String dateScope,
boolean refresh,
boolean noCleanup)
Rerun Bundle actions for given rerunType
|
void |
resume(String jobId)
Resume a job.
|
BundleJobInfo |
resumeJobs(String filter,
int start,
int len)
return a list of resumed Bundle job
|
void |
start(String jobId)
Start a job.
|
protected void |
streamJobLog(XLogStreamer logStreamer,
String jobId,
Writer writer)
Stream job log.
|
String |
submitJob(org.apache.hadoop.conf.Configuration conf,
boolean startJob)
Submit a job.
|
void |
suspend(String jobId)
Suspend a job.
|
BundleJobInfo |
suspendJobs(String filter,
int start,
int len)
return a list of suspended Bundle job
|
getJMSTopicName, getUser, streamAuditLog, streamErrorLog, streamLog
public BundleEngine()
public BundleEngine(String user)
user
- user name.public void change(String jobId, String changeValue) throws BundleEngineException
BaseEngine
change
in class BaseEngine
jobId
- job Id.changeValue
- change value.BundleEngineException
public String dryRunSubmit(org.apache.hadoop.conf.Configuration conf) throws BundleEngineException
BaseEngine
BaseEngine.submitJob(org.apache.hadoop.conf.Configuration, boolean)
but doesn't actually execute
the job.
It validates configuration properties.
dryRunSubmit
in class BaseEngine
conf
- job configuration.BundleEngineException
public CoordinatorJob getCoordJob(String jobId) throws BundleEngineException
BaseEngine
getCoordJob
in class BaseEngine
jobId
- job Id.BundleEngineException
public BundleJobBean getBundleJob(String jobId) throws BundleEngineException
BundleEngineException
public CoordinatorJob getCoordJob(String jobId, String filter, int start, int length, boolean desc) throws BundleEngineException
BaseEngine
getCoordJob
in class BaseEngine
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 orderBundleEngineException
public String getDefinition(String jobId) throws BundleEngineException
BaseEngine
getDefinition
in class BaseEngine
jobId
- job Id.BundleEngineException
public WorkflowJob getJob(String jobId) throws BundleEngineException
BaseEngine
getJob
in class BaseEngine
jobId
- job Id.BundleEngineException
public WorkflowJob getJob(String jobId, int start, int length) throws BundleEngineException
BaseEngine
getJob
in class BaseEngine
jobId
- job Idstart
- starting from this index in the list of actions belonging to the joblength
- number of actions to be returnedBundleEngineException
public String getJobIdForExternalId(String externalId) throws BundleEngineException
BaseEngine
This is reverse lookup for recovery purposes.
getJobIdForExternalId
in class BaseEngine
externalId
- external ID provided at job submission time.null
if none.BundleEngineException
public void kill(String jobId) throws BundleEngineException
BaseEngine
kill
in class BaseEngine
jobId
- job Id.BundleEngineException
@Deprecated public void reRun(String jobId, org.apache.hadoop.conf.Configuration conf) throws BundleEngineException
BaseEngine
reRun
in class BaseEngine
jobId
- job Id to rerun.conf
- configuration information for the rerun.BundleEngineException
public void reRun(String jobId, String coordScope, String dateScope, boolean refresh, boolean noCleanup) throws BaseEngineException
jobId
- bundle job idcoordScope
- the rerun scope for coordinator job names separated by ","dateScope
- the rerun scope for coordinator nominal times separated by ","refresh
- true if user wants to refresh input/outpur dataset urlsnoCleanup
- false if user wants to cleanup output events for given rerun actionsBaseEngineException
- thrown if failed to rerunpublic void resume(String jobId) throws BundleEngineException
BaseEngine
resume
in class BaseEngine
jobId
- job Id.BundleEngineException
public void start(String jobId) throws BundleEngineException
BaseEngine
start
in class BaseEngine
jobId
- job Id.BundleEngineException
protected void streamJobLog(XLogStreamer logStreamer, String jobId, Writer writer) throws IOException, BundleEngineException
BaseEngine
streamJobLog
in class BaseEngine
logStreamer
- the log streamerjobId
- the job idwriter
- the writerIOException
- Signals that an I/O exception has occurred.BundleEngineException
public String submitJob(org.apache.hadoop.conf.Configuration conf, boolean startJob) throws BundleEngineException
BaseEngine
It validates configuration properties.
submitJob
in class BaseEngine
conf
- job configuration.startJob
- indicates if the job should be started or not.BundleEngineException
public void suspend(String jobId) throws BundleEngineException
BaseEngine
suspend
in class BaseEngine
jobId
- job Id.BundleEngineException
public BundleJobInfo getBundleJobs(String filter, int start, int len) throws BundleEngineException
filter
- the filter stringstart
- start location for paginglen
- total length to getBundleEngineException
- thrown if failed to get bundle job infopublic BulkResponseInfo getBulkJobs(String bulkFilter, int start, int len) throws BundleEngineException
bulkFilter
- the filter stringstart
- start location for paginglen
- total length to getBundleEngineException
- thrown if failed to get bulk job infopublic static Map<String,List<String>> parseBulkFilter(String bulkParams) throws BundleEngineException
bulkParams
- the filter stringBundleEngineException
- thrown if failed to parse filter stringpublic String getJobStatus(String jobId) throws BundleEngineException
getJobStatus
in class BaseEngine
jobId
- job Id.BundleEngineException
- thrown if the job's status could not be obtainedpublic void enableSLAAlert(String id, String actions, String dates, String childIds) throws BaseEngineException
BaseEngine
enableSLAAlert
in class BaseEngine
id
- job IDactions
- list of actionsdates
- dateschildIds
- child IDsBaseEngineException
- thrown if SLA alert could not be enabledpublic void disableSLAAlert(String id, String actions, String dates, String childIds) throws BaseEngineException
BaseEngine
disableSLAAlert
in class BaseEngine
id
- 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
BaseEngine
changeSLA
in class BaseEngine
id
- job IDactions
- list of actionsdates
- dateschildIds
- child IDsnewParams
- parameters toBaseEngineException
- thrown if SLA alert could not be enabledpublic BundleJobInfo killJobs(String filter, int start, int len) throws BundleEngineException
filter
- the filter string for which the bundle jobs are killedstart
- the starting index for bundle jobslen
- maximum number of jobs to be killedBundleEngineException
- thrown if one or more of the jobs cannot be killedpublic BundleJobInfo suspendJobs(String filter, int start, int len) throws BundleEngineException
filter
- the filter string for which the bundle jobs are suspendedstart
- the starting index for bundle jobslen
- maximum number of jobs to be suspendedBundleEngineException
- thrown if one or more of the jobs cannot be suspendedpublic BundleJobInfo resumeJobs(String filter, int start, int len) throws BundleEngineException
filter
- the filter string for which the bundle jobs are resumedstart
- the starting index for bundle jobslen
- maximum number of jobs to be resumedBundleEngineException
- thrown if one or more of the jobs cannot be resumedCopyright © 2018 Apache Software Foundation. All rights reserved.