org.apache.oozie.command.coord
Class CoordMaterializeTransitionXCommand

java.lang.Object
  extended by org.apache.oozie.command.XCommand<T>
      extended by org.apache.oozie.command.TransitionXCommand<Void>
          extended by org.apache.oozie.command.MaterializeTransitionXCommand
              extended by org.apache.oozie.command.coord.CoordMaterializeTransitionXCommand
All Implemented Interfaces:
Callable<Void>, XCallable<Void>

public class CoordMaterializeTransitionXCommand
extends MaterializeTransitionXCommand

Materialize actions for specified start and end time for coordinator job.


Field Summary
static String CONF_DEFAULT_MAX_TIMEOUT
          Default MAX timeout in minutes, after which coordinator input check will timeout
 
Fields inherited from class org.apache.oozie.command.TransitionXCommand
insertList, job, updateList
 
Fields inherited from class org.apache.oozie.command.XCommand
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, instrumentation, INSTRUMENTATION_GROUP, LOG, logInfo
 
Constructor Summary
CoordMaterializeTransitionXCommand(String jobId, int materializationWindow)
          The constructor for class CoordMaterializeTransitionXCommand
 
Method Summary
protected  void calcMatdTime()
          Calculate startMatdTime and endMatdTime from job's start time if next materialized time is null
 String getEntityKey()
          Return the entity key for the command.
 String getKey()
          Get command key
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.
protected  void materialize()
          Materialize the actions for current job
protected  String materializeActions(boolean dryrun)
          Create action instances starting from "startMatdTime" to "endMatdTime" and store them into coord action table.
 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 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.
 
Methods inherited from class org.apache.oozie.command.MaterializeTransitionXCommand
execute
 
Methods inherited from class org.apache.oozie.command.TransitionXCommand
getJob, setJob
 
Methods inherited from class org.apache.oozie.command.XCommand
call, eagerLoadState, eagerVerifyPrecondition, executeInterrupts, getCreatedTime, getInstrumentation, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isReQueueRequired, queue, queue, resetUsed, setInterruptMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_DEFAULT_MAX_TIMEOUT

public static final String CONF_DEFAULT_MAX_TIMEOUT
Default MAX timeout in minutes, after which coordinator input check will timeout

See Also:
Constant Field Values
Constructor Detail

CoordMaterializeTransitionXCommand

public CoordMaterializeTransitionXCommand(String jobId,
                                          int materializationWindow)
The constructor for class CoordMaterializeTransitionXCommand

Parameters:
jobId - coordinator job id
materializationWindow - materialization window to calculate end time
Method Detail

transitToNext

public void transitToNext()
                   throws CommandException
Description copied from class: TransitionXCommand
Transit to the next status based on the result of the Job.

Overrides:
transitToNext in class MaterializeTransitionXCommand
Throws:
CommandException

updateJob

public void updateJob()
               throws CommandException
Description copied from class: TransitionXCommand
Update the parent job.

Specified by:
updateJob in class TransitionXCommand<Void>
Throws:
CommandException

performWrites

public void performWrites()
                   throws CommandException
Description copied from class: TransitionXCommand
This will be used to perform atomically all the writes within this command.

Specified by:
performWrites in class TransitionXCommand<Void>
Throws:
CommandException

getEntityKey

public String getEntityKey()
Description copied from class: XCommand
Return the entity key for the command.

Specified by:
getEntityKey in interface XCallable<Void>
Specified by:
getEntityKey in class XCommand<Void>
Returns:
the entity key for the command.

isLockRequired

protected boolean isLockRequired()
Description copied from class: XCommand
Indicate if the the command requires locking.

Subclasses should override this method if they require locking.

Specified by:
isLockRequired in class XCommand<Void>
Returns:
true/false

loadState

protected void loadState()
                  throws CommandException
Description copied from class: XCommand
Load the necessary state to perform the precondition check and to execute the command.

Subclasses must implement this method and load the state needed to do the precondition check and execute the command.

Specified by:
loadState in class XCommand<Void>
Throws:
CommandException

calcMatdTime

protected void calcMatdTime()
                     throws CommandException
Calculate startMatdTime and endMatdTime from job's start time if next materialized time is null

Throws:
CommandException - thrown if failed to calculate startMatdTime and endMatdTime

verifyPrecondition

protected void verifyPrecondition()
                           throws CommandException,
                                  PreconditionException
Description copied from class: XCommand
Verify the precondition for the command after a lock has been obtain, just before executing the command.

Specified by:
verifyPrecondition in class XCommand<Void>
Throws:
CommandException - thrown if the precondition is not met.
PreconditionException

materialize

protected void materialize()
                    throws CommandException
Description copied from class: MaterializeTransitionXCommand
Materialize the actions for current job

Specified by:
materialize in class MaterializeTransitionXCommand
Throws:
CommandException - thrown if failed to materialize

materializeActions

protected String materializeActions(boolean dryrun)
                             throws Exception
Create action instances starting from "startMatdTime" to "endMatdTime" and store them into coord action table.

Parameters:
dryrun - if this is a dry run
Throws:
Exception - thrown if failed to materialize actions

getKey

public String getKey()
Description copied from class: XCommand
Get command key

Specified by:
getKey in interface XCallable<Void>
Overrides:
getKey in class XCommand<Void>
Returns:
command key

notifyParent

public void notifyParent()
                  throws CommandException
Description copied from class: TransitionXCommand
This will be used to notify the parent about the status of that perticular job.

Specified by:
notifyParent in class TransitionXCommand<Void>
Throws:
CommandException


Copyright © 2013 Apache Software Foundation. All Rights Reserved.