public class CoordRerunXCommand extends RerunTransitionXCommand<CoordinatorActionInfo>
The "rerunType" can be set as RestConstants.JOB_COORD_SCOPE_DATE
or RestConstants.JOB_COORD_SCOPE_ACTION
.
The "refresh" is used to indicate if user wants to refresh an action's input and output events.
The "noCleanup" is used to indicate if user wants to cleanup output events for given rerun actions
Modifier and Type | Field and Description |
---|---|
protected boolean |
prevPending |
static String |
RERUN_CONF |
jobId, prevStatus, ret
insertList, job, updateList
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG
Constructor and Description |
---|
CoordRerunXCommand(String jobId,
String rerunType,
String scope,
boolean refresh,
boolean noCleanup,
boolean failed,
org.apache.hadoop.conf.Configuration actionRunConf)
The constructor for class
CoordRerunXCommand |
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.
|
String |
getEntityKey()
Return the entity key for the command.
|
Job |
getJob()
Get the Job for the command.
|
XLog |
getLog()
Get XLog log
|
protected boolean |
isLockRequired()
Indicate if the the command requires locking.
|
protected void |
loadState()
Load the necessary state to perform the precondition check and to execute the command.
|
void |
notifyParent()
This will be used to notify the parent about the status of that perticular job.
|
void |
performWrites()
This will be used to perform atomically all the writes within this command.
|
void |
rerunChildren()
Rerun actions associated with the job
|
void |
transitToNext()
Transit to the next status based on the result of the Job.
|
void |
updateJob()
Update the parent job.
|
protected void |
verifyPrecondition()
Verify the precondition for the command after a lock has been obtain, just before executing the command.
|
execute, getPrevStatus
generateEvents, setJob
call, executeInterrupts, getCreatedTime, getInstrumentation, getKey, getLockTimeOut, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isReQueueRequired, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString
public static final String RERUN_CONF
protected boolean prevPending
public CoordRerunXCommand(String jobId, String rerunType, String scope, boolean refresh, boolean noCleanup, boolean failed, org.apache.hadoop.conf.Configuration actionRunConf)
CoordRerunXCommand
jobId
- the job idrerunType
- rerun type RestConstants.JOB_COORD_SCOPE_DATE
or RestConstants.JOB_COORD_SCOPE_ACTION
scope
- the rerun scope for given rerunType separated by ","refresh
- true if user wants to refresh input/output dataset urlsnoCleanup
- false if user wants to cleanup output events for given rerun actionsfailed
- true if user wants to rerun only failed nodesactionRunConf
- configuration values for actionspublic String getEntityKey()
XCommand
getEntityKey
in interface XCallable<CoordinatorActionInfo>
getEntityKey
in class XCommand<CoordinatorActionInfo>
protected boolean isLockRequired()
XCommand
Subclasses should override this method if they require locking.
isLockRequired
in class XCommand<CoordinatorActionInfo>
true/false
protected void loadState() throws CommandException
XCommand
Subclasses must implement this method and load the state needed to do the precondition check and execute the command.
loadState
in class XCommand<CoordinatorActionInfo>
CommandException
protected void verifyPrecondition() throws CommandException, PreconditionException
XCommand
verifyPrecondition
in class RerunTransitionXCommand<CoordinatorActionInfo>
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 RerunTransitionXCommand<CoordinatorActionInfo>
CommandException
protected void eagerVerifyPrecondition() throws CommandException, PreconditionException
XCommand
This implementation does a NOP.
A trivial implementation is calling {link #verifyPrecondition}.
eagerVerifyPrecondition
in class RerunTransitionXCommand<CoordinatorActionInfo>
CommandException
- thrown if the precondition is not met.PreconditionException
public void rerunChildren() throws CommandException
RerunTransitionXCommand
rerunChildren
in class RerunTransitionXCommand<CoordinatorActionInfo>
CommandException
- thrown if failed to rerun actionspublic Job getJob()
TransitionXCommand
getJob
in class TransitionXCommand<CoordinatorActionInfo>
public void notifyParent() throws CommandException
TransitionXCommand
notifyParent
in class TransitionXCommand<CoordinatorActionInfo>
CommandException
public void updateJob()
TransitionXCommand
updateJob
in class TransitionXCommand<CoordinatorActionInfo>
public void performWrites() throws CommandException
TransitionXCommand
performWrites
in class TransitionXCommand<CoordinatorActionInfo>
CommandException
public XLog getLog()
XCommand
getLog
in class XCommand<CoordinatorActionInfo>
public final void transitToNext()
TransitionXCommand
transitToNext
in class RerunTransitionXCommand<CoordinatorActionInfo>
Copyright © 2016 Apache Software Foundation. All rights reserved.