|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.oozie.command.XCommand<T> org.apache.oozie.command.wf.WorkflowXCommand<Void> org.apache.oozie.command.wf.ActionXCommand<T>
public abstract class ActionXCommand<T>
Base class for Action execution commands. Provides common functionality to handle different types of errors while attempting to start or end an action.
Nested Class Summary | |
---|---|
static class |
ActionXCommand.ActionExecutorContext
Workflow action executor context |
Field Summary | |
---|---|
protected static String |
INSTR_FAILED_JOBS_COUNTER
|
protected static String |
RECOVERY_ID_SEPARATOR
|
Fields inherited from class org.apache.oozie.command.XCommand |
---|
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, LOG, logInfo |
Constructor Summary | |
---|---|
ActionXCommand(String name,
String type,
int priority)
|
Method Summary | |
---|---|
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,
org.apache.oozie.client.WorkflowAction.Status status)
Takes care of errors. |
protected void |
handleNonTransient(ActionExecutor.Context context,
ActionExecutor executor,
org.apache.oozie.client.WorkflowAction.Status status)
Takes care of non transient failures. |
protected boolean |
handleTransient(ActionExecutor.Context context,
ActionExecutor executor,
org.apache.oozie.client.WorkflowAction.Status status)
Takes care of Transient failures. |
boolean |
handleUserRetry(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. |
Methods inherited from class org.apache.oozie.command.wf.WorkflowXCommand |
---|
generateEvent, generateEvent, generateEvent |
Methods inherited from class org.apache.oozie.command.XCommand |
---|
call, eagerLoadState, eagerVerifyPrecondition, execute, executeInterrupts, getCreatedTime, getEntityKey, getInstrumentation, getKey, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isLockRequired, isReQueueRequired, loadState, queue, queue, resetUsed, setInterruptMode, verifyPrecondition |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String INSTR_FAILED_JOBS_COUNTER
protected static final String RECOVERY_ID_SEPARATOR
Constructor Detail |
---|
public ActionXCommand(String name, String type, int priority)
Method Detail |
---|
protected boolean handleTransient(ActionExecutor.Context context, ActionExecutor executor, org.apache.oozie.client.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 handleNonTransient(ActionExecutor.Context context, ActionExecutor executor, org.apache.oozie.client.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, org.apache.oozie.client.WorkflowAction.Status status) throws CommandException
ActionEndCommand
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 fail
CommandException
- thrown if unable to fail jobpublic boolean handleUserRetry(WorkflowActionBean action) throws CommandException
context
- the execution context.
CommandException
- thrown if unable to fail jobprotected void incrActionCounter(String type, int count)
protected void addActionCron(String type, Instrumentation.Cron cron)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |