public abstract class ActionXCommand<T> extends WorkflowXCommand<T>
Modifier and Type | Class and Description |
---|---|
static class |
ActionXCommand.ActionExecutorContext
Workflow action executor context
|
static class |
ActionXCommand.ForkedActionExecutorContext |
Modifier and Type | Field and Description |
---|---|
protected static String |
RECOVERY_ID_SEPARATOR |
static String |
RETRY |
INSTR_FAILED_JOBS_COUNTER_NAME, INSTR_KILLED_JOBS_COUNTER_NAME, INSTR_SUCCEEDED_JOBS_COUNTER_NAME, KEEP_WF_ACTION_DIR
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, LOG
Constructor and Description |
---|
ActionXCommand(String name,
String type,
int priority) |
Modifier and Type | Method and Description |
---|---|
protected void |
addActionCron(String type,
Instrumentation.Cron cron)
Adding a cron for the instrumentation time for the given Instrumentation
group
|
void |
failJob(ActionExecutor.Context context)
Fail the job due to failed action
|
void |
failJob(ActionExecutor.Context context,
WorkflowActionBean action)
Fail the job due to failed action
|
protected void |
handleError(ActionExecutor.Context context,
ActionExecutor executor,
String message,
boolean isStart,
WorkflowAction.Status status)
Takes care of errors.
|
protected void |
handleNonTransient(ActionExecutor.Context context,
ActionExecutor executor,
WorkflowAction.Status status)
Takes care of non transient failures.
|
protected boolean |
handleTransient(ActionExecutor.Context context,
ActionExecutor executor,
WorkflowAction.Status status)
Takes care of Transient failures.
|
boolean |
handleUserRetry(ActionExecutor.Context context,
WorkflowActionBean action)
Execute retry for action if this action is eligible for user-retry
|
protected void |
incrActionCounter(String type,
int count)
Increment the action counter in the instrumentation log.
|
protected void |
queueCommandForTransientFailure(long retryDelayMillis) |
generateEvent, generateEvent, generateEvent, updateParentIfNecessary, updateParentIfNecessary
call, eagerLoadState, eagerVerifyPrecondition, execute, executeInterrupts, getCreatedTime, getEntityKey, getInstrumentation, getKey, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isLockRequired, isReQueueRequired, loadState, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString, verifyPrecondition
public static final String RETRY
protected static final String RECOVERY_ID_SEPARATOR
public ActionXCommand(String name, String type, int priority)
protected boolean handleTransient(ActionExecutor.Context context, ActionExecutor executor, WorkflowAction.Status status) throws CommandException
context
- the execution context.executor
- the executor instance being used.status
- the status to be set for the action.CommandException
- thrown if unable to handle transientprotected void queueCommandForTransientFailure(long retryDelayMillis)
protected void handleNonTransient(ActionExecutor.Context context, ActionExecutor executor, WorkflowAction.Status status) throws CommandException
context
- the execution context.executor
- the executor instance being used.status
- the status to be set for the action.CommandException
- thrown if unable to suspend jobprotected void handleError(ActionExecutor.Context context, ActionExecutor executor, String message, boolean isStart, WorkflowAction.Status status) throws CommandException
For errors while attempting to start the action, the job state is updated and an
ActionEndXCommand
is queued.
For errors while attempting to end the action, the job state is updated.
context
- the execution context.executor
- the executor instance being used.message
- isStart
- whether the error was generated while starting or ending an action.status
- the status to be set for the action.CommandException
- thrown if unable to handle action errorpublic void failJob(ActionExecutor.Context context) throws CommandException
context
- the execution context.CommandException
- thrown if unable to fail jobpublic void failJob(ActionExecutor.Context context, WorkflowActionBean action) throws CommandException
context
- the execution context.action
- the action that caused the workflow to failCommandException
- thrown if unable to fail jobpublic boolean handleUserRetry(ActionExecutor.Context context, WorkflowActionBean action) throws CommandException
action
- the Workflow action beanCommandException
- thrown if unable to fail jobprotected void incrActionCounter(String type, int count)
protected void addActionCron(String type, Instrumentation.Cron cron)
Copyright © 2018 Apache Software Foundation. All rights reserved.