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, toStringpublic SLAJobHistoryXCommand(String jobId)
protected void verifyPrecondition() throws CommandException, PreconditionException
XCommandverifyPrecondition in class XCommand<Boolean>CommandException - thrown if the precondition is not met.PreconditionExceptionprotected boolean isLockRequired()
XCommandSubclasses should override this method if they require locking.
isLockRequired in class XCommand<Boolean>true/falseprotected boolean isReQueueRequired()
XCommandSubclasses should override this method if they don't want to requeue.
Default is true.
isReQueueRequired in class XCommand<Boolean>true/falsepublic String getEntityKey()
XCommandgetEntityKey in interface XCallable<Boolean>getEntityKey in class XCommand<Boolean>protected long getLockTimeOut()
XCommandThe 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
XCommandThis 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
CommandExceptionXExceptionprotected 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.