org.apache.oozie.command.wf
Class SuspendCommand

java.lang.Object
  extended by org.apache.oozie.command.Command<T,WorkflowStore>
      extended by org.apache.oozie.command.wf.WorkflowCommand<Void>
          extended by org.apache.oozie.command.wf.SuspendCommand
All Implemented Interfaces:
Callable<Void>, XCallable<Void>

public class SuspendCommand
extends WorkflowCommand<Void>


Field Summary
 
Fields inherited from class org.apache.oozie.command.Command
dryrun, instrumentation, LOCK_FAILURE_REQUEUE_INTERVAL
 
Constructor Summary
SuspendCommand(String id)
           
 
Method Summary
protected  Void call(WorkflowStore store)
          DagCallable subclasses must implement this method to perform their task.
protected  Void execute(WorkflowStore store)
           
static void setPendingFalseForActions(WorkflowStore store, String id, String actionId)
          Set pending flag to false for the actions that are START_RETRY or START_MANUAL or END_RETRY or END_MANUAL

static void suspendJob(WorkflowStore store, WorkflowJobBean workflow, String id, String actionId)
          Suspend the workflow job and pending flag to false for the actions that are START_RETRY or START_MANUAL or END_RETRY or END_MANUAL
 
Methods inherited from class org.apache.oozie.command.wf.WorkflowCommand
getStoreClass
 
Methods inherited from class org.apache.oozie.command.Command
call, getCreatedTime, getInstrumentation, getKey, getName, getPriority, getType, incrCommandCounter, incrJobCounter, incrJobCounter, lock, logQueueCallableFalse, queueCallable, queueCallable, queueCallable, queueCallableForException, resetLogInfoAction, resetLogInfoWorkflow, setLogInfo, setLogInfo, setLogInfo, setLogInfo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuspendCommand

public SuspendCommand(String id)
Method Detail

call

protected Void call(WorkflowStore store)
             throws StoreException,
                    CommandException
Description copied from class: Command
DagCallable subclasses must implement this method to perform their task.

The workflow store works in transactional mode. The transaction is committed only if this method ends successfully. Otherwise the transaction is rolledback.

Specified by:
call in class Command<Void,WorkflowStore>
Parameters:
store - the workflow store instance for the callable, null if the callable does not use a store.
Returns:
the return value of the callable.
Throws:
StoreException - thrown if the workflow store could not perform an operation.
CommandException - thrown if the command could not perform its operation.

suspendJob

public static void suspendJob(WorkflowStore store,
                              WorkflowJobBean workflow,
                              String id,
                              String actionId)
                       throws WorkflowException,
                              StoreException
Suspend the workflow job and pending flag to false for the actions that are START_RETRY or START_MANUAL or END_RETRY or END_MANUAL

Parameters:
store - WorkflowStore
workflow - WorkflowJobBean
id - String
actionId - String
Throws:
WorkflowException
StoreException

setPendingFalseForActions

public static void setPendingFalseForActions(WorkflowStore store,
                                             String id,
                                             String actionId)
                                      throws StoreException
Set pending flag to false for the actions that are START_RETRY or START_MANUAL or END_RETRY or END_MANUAL

Parameters:
store - WorkflowStore
id - workflow id
actionId - workflow action id
Throws:
StoreException

execute

protected Void execute(WorkflowStore store)
                throws CommandException,
                       StoreException
Overrides:
execute in class Command<Void,WorkflowStore>
Throws:
CommandException
StoreException


Copyright © 2012 Apache Software Foundation. All Rights Reserved.