public abstract class SLAJobHistoryXCommand extends XCommand<Boolean>
Modifier and Type | Field and Description |
---|---|
protected String |
jobId |
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG
Constructor and Description |
---|
SLAJobHistoryXCommand(String jobId) |
Modifier and Type | Method and Description |
---|---|
protected Boolean |
execute()
Command execution body.
|
String |
getEntityKey()
Return the entity key for the command.
|
protected long |
getLockTimeOut()
Return the time out when acquiring a lock.
|
protected abstract boolean |
isJobEnded()
Checks if is job ended.
|
protected boolean |
isLockRequired()
Indicate if the the command requires locking.
|
protected boolean |
isReQueueRequired()
Indicate if the the command requires to requeue itself if the lock is not acquired.
|
protected abstract void |
updateSLASummary()
Update SLASummary
|
protected void |
updateSLASummary(String id,
Date startTime,
Date endTime,
String status)
Update sla summary.
|
protected void |
verifyPrecondition()
Verify the precondition for the command after a lock has been obtain, just before executing the command.
|
call, eagerLoadState, eagerVerifyPrecondition, executeInterrupts, getCreatedTime, getInstrumentation, getKey, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, loadState, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString
public SLAJobHistoryXCommand(String jobId)
protected void verifyPrecondition() throws CommandException, PreconditionException
XCommand
verifyPrecondition
in class XCommand<Boolean>
CommandException
- thrown if the precondition is not met.PreconditionException
protected boolean isLockRequired()
XCommand
Subclasses should override this method if they require locking.
isLockRequired
in class XCommand<Boolean>
true/false
protected boolean isReQueueRequired()
XCommand
Subclasses should override this method if they don't want to requeue.
Default is true.
isReQueueRequired
in class XCommand<Boolean>
true/false
public String getEntityKey()
XCommand
getEntityKey
in interface XCallable<Boolean>
getEntityKey
in class XCommand<Boolean>
protected long getLockTimeOut()
XCommand
The value is loaded from the Oozie configuration, the property {link #DEFAULT_LOCK_TIMEOUT}.
Subclasses should override this method if they want to use a different time out.
getLockTimeOut
in class XCommand<Boolean>
protected Boolean execute() throws CommandException
XCommand
This method will be invoked after the {link #loadState} and {link #verifyPrecondition} methods.
If the command requires locking, this method will be invoked ONLY if the lock has been acquired.
execute
in class XCommand<Boolean>
CommandException
- thrown if the command execution failed.protected abstract boolean isJobEnded()
protected abstract void updateSLASummary() throws CommandException, XException
CommandException
XException
protected void updateSLASummary(String id, Date startTime, Date endTime, String status) throws JPAExecutorException
id
- the idstartTime
- the start timeendTime
- the end timestatus
- the statusJPAExecutorException
- the JPA executor exceptionCopyright © 2018 Apache Software Foundation. All rights reserved.