public abstract class StatusTransitXCommand extends XCommand<Void>
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG| Constructor and Description |
|---|
StatusTransitXCommand(String name,
String type,
int priority)
Instantiates a new status transit x command.
|
| Modifier and Type | Method and Description |
|---|---|
protected Void |
execute()
Command execution body.
|
protected Job.Status |
getJobStatus()
Gets the job status.
|
protected long |
getLockTimeOut()
Return the time out when acquiring a lock.
|
protected abstract Job.Status |
getPausedState()
Gets the job pause state.
|
protected abstract Job.Status |
getRunningState()
Gets the job running state.
|
protected abstract Job.Status |
getSuspendedStatus()
Gets the suspended status.
|
protected abstract Job.Status |
getTerminalStatus()
Gets the job terminal status.
|
protected boolean |
isLockRequired()
Indicate if the the command requires locking.
|
protected abstract boolean |
isPausedState()
Checks if job is in paused state.
|
protected boolean |
isReQueueRequired()
Indicate if the the command requires to requeue itself if the lock is not acquired.
|
protected abstract boolean |
isRunningState()
Checks if job is in running state.
|
protected abstract boolean |
isSuspendedState()
Checks if is in suspended state.
|
protected abstract boolean |
isTerminalState()
Checks if job is in terminal state.
|
protected abstract void |
updateJobStatus(Job.Status status)
Update job status.
|
call, eagerLoadState, eagerVerifyPrecondition, executeInterrupts, getCreatedTime, getEntityKey, getInstrumentation, getKey, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, loadState, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString, verifyPreconditionpublic StatusTransitXCommand(String name, String type, int priority)
name - the nametype - the typepriority - the priorityprotected final 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<Void>protected final boolean isReQueueRequired()
XCommandSubclasses should override this method if they don't want to requeue.
Default is true.
isReQueueRequired in class XCommand<Void>true/falseprotected final boolean isLockRequired()
XCommandSubclasses should override this method if they require locking.
isLockRequired in class XCommand<Void>true/falseprotected Void 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<Void>CommandException - thrown if the command execution failed.protected Job.Status getJobStatus() throws CommandException
CommandException - the command exceptionprotected abstract boolean isTerminalState()
protected abstract Job.Status getTerminalStatus()
protected abstract boolean isPausedState()
protected abstract Job.Status getPausedState()
protected abstract boolean isSuspendedState()
protected abstract Job.Status getSuspendedStatus()
protected abstract boolean isRunningState()
protected abstract Job.Status getRunningState()
protected abstract void updateJobStatus(Job.Status status) throws JPAExecutorException, CommandException
status - the statusJPAExecutorException - the JPA executor exceptionCommandException - the command exceptionCopyright © 2018 Apache Software Foundation. All rights reserved.