public abstract class SLAJobEventXCommand extends XCommand<Void>
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG
Constructor and Description |
---|
SLAJobEventXCommand(SLACalcStatus slaCalc,
long lockTimeOut) |
Modifier and Type | Method and Description |
---|---|
protected Void |
execute()
Command execution body.
|
String |
getEntityKey()
Return the entity key for the command.
|
protected long |
getLockTimeOut()
Return the time out when acquiring a lock.
|
boolean |
isEnded() |
boolean |
isEndMiss() |
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.
|
void |
setEnded(boolean isEnded) |
void |
setEndMiss(boolean isEndMiss) |
protected abstract void |
updateJobInfo()
Verify job.
|
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 SLAJobEventXCommand(SLACalcStatus slaCalc, long lockTimeOut)
protected boolean isLockRequired()
XCommand
Subclasses should override this method if they require locking.
isLockRequired
in class XCommand<Void>
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<Void>
true/false
public String getEntityKey()
XCommand
getEntityKey
in interface XCallable<Void>
getEntityKey
in class XCommand<Void>
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<Void>
protected void verifyPrecondition() throws CommandException, PreconditionException
XCommand
verifyPrecondition
in class XCommand<Void>
CommandException
- thrown if the precondition is not met.PreconditionException
protected Void 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<Void>
CommandException
- thrown if the command execution failed.protected abstract void updateJobInfo()
public boolean isEnded()
public void setEnded(boolean isEnded)
public boolean isEndMiss()
public void setEndMiss(boolean isEndMiss)
Copyright © 2018 Apache Software Foundation. All rights reserved.