T
- public abstract class RerunTransitionXCommand<T> extends TransitionXCommand<T>
updateJob() : update job status and attributes rerunChildren() : submit or queue commands to rerun children notifyParent() : update the status to upstream if any
Modifier and Type | Field and Description |
---|---|
protected String |
jobId |
protected Job.Status |
prevStatus |
protected T |
ret |
insertList, job, updateList
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG
Constructor and Description |
---|
RerunTransitionXCommand(String name,
String type,
int priority)
The constructor for abstract class
RerunTransitionXCommand |
RerunTransitionXCommand(String name,
String type,
int priority,
boolean dryrun)
The constructor for abstract class
RerunTransitionXCommand |
Modifier and Type | Method and Description |
---|---|
protected void |
eagerLoadState()
Load the necessary state to perform an eager precondition check.
|
protected void |
eagerVerifyPrecondition()
Verify the precondition for the command before obtaining a lock.
|
protected T |
execute()
Command execution body.
|
Job.Status |
getPrevStatus()
This method will return the previous status.
|
abstract void |
rerunChildren()
Rerun actions associated with the job
|
void |
transitToNext()
Transit to the next status based on the result of the Job.
|
protected void |
verifyPrecondition()
Verify the precondition for the command after a lock has been obtain, just before executing the command.
|
generateEvents, getJob, notifyParent, performWrites, setJob, updateJob
call, executeInterrupts, getCreatedTime, getEntityKey, getInstrumentation, getKey, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isLockRequired, isReQueueRequired, loadState, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString
protected Job.Status prevStatus
public RerunTransitionXCommand(String name, String type, int priority)
RerunTransitionXCommand
name
- the command nametype
- the command typepriority
- the command prioritypublic RerunTransitionXCommand(String name, String type, int priority, boolean dryrun)
RerunTransitionXCommand
name
- the command nametype
- the command typepriority
- the command prioritydryrun
- true if dryrun is enablepublic void transitToNext()
TransitionXCommand
transitToNext
in class TransitionXCommand<T>
public abstract void rerunChildren() throws CommandException
CommandException
- thrown if failed to rerun actionsprotected T 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 TransitionXCommand<T>
CommandException
- thrown if the command execution failed.protected void verifyPrecondition() throws CommandException, PreconditionException
XCommand
verifyPrecondition
in class XCommand<T>
CommandException
- thrown if the precondition is not met.PreconditionException
protected void eagerLoadState() throws CommandException
XCommand
This implementation does a NOP.
Subclasses should override this method and load the state needed to do an eager precondition check.
A trivial implementation is calling {link #loadState}.
eagerLoadState
in class XCommand<T>
CommandException
protected void eagerVerifyPrecondition() throws CommandException, PreconditionException
XCommand
This implementation does a NOP.
A trivial implementation is calling {link #verifyPrecondition}.
eagerVerifyPrecondition
in class XCommand<T>
CommandException
- thrown if the precondition is not met.PreconditionException
public Job.Status getPrevStatus()
Copyright © 2018 Apache Software Foundation. All rights reserved.