public class CoordMaterializeTransitionXCommand extends MaterializeTransitionXCommand
Modifier and Type | Field and Description |
---|---|
static String |
CONF_DEFAULT_MAX_TIMEOUT
Default MAX timeout in minutes, after which coordinator input check will timeout
|
insertList, job, updateList
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG
Constructor and Description |
---|
CoordMaterializeTransitionXCommand(CoordinatorJobBean coordJob,
int materializationWindow,
Date startTime,
Date endTime) |
CoordMaterializeTransitionXCommand(String jobId,
int materializationWindow)
The constructor for class
CoordMaterializeTransitionXCommand |
Modifier and Type | Method and Description |
---|---|
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.
|
execute
generateEvents, getJob, setJob
call, eagerLoadState, eagerVerifyPrecondition, executeInterrupts, getCreatedTime, getInstrumentation, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isReQueueRequired, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString
public static final String CONF_DEFAULT_MAX_TIMEOUT
public CoordMaterializeTransitionXCommand(String jobId, int materializationWindow)
CoordMaterializeTransitionXCommand
jobId
- coordinator job idmaterializationWindow
- materialization window to calculate end timepublic CoordMaterializeTransitionXCommand(CoordinatorJobBean coordJob, int materializationWindow, Date startTime, Date endTime)
public void transitToNext() throws CommandException
TransitionXCommand
transitToNext
in class MaterializeTransitionXCommand
CommandException
public void updateJob() throws CommandException
TransitionXCommand
updateJob
in class TransitionXCommand<Void>
CommandException
public void performWrites() throws CommandException
TransitionXCommand
performWrites
in class TransitionXCommand<Void>
CommandException
public String getEntityKey()
XCommand
getEntityKey
in interface XCallable<Void>
getEntityKey
in class XCommand<Void>
protected boolean isLockRequired()
XCommand
Subclasses should override this method if they require locking.
isLockRequired
in class XCommand<Void>
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<Void>
CommandException
protected void calcMatdTime() throws CommandException
CommandException
- thrown if failed to calculate startMatdTime and endMatdTimeprotected void verifyPrecondition() throws CommandException, PreconditionException
XCommand
verifyPrecondition
in class XCommand<Void>
CommandException
- thrown if the precondition is not met.PreconditionException
protected void materialize() throws CommandException
MaterializeTransitionXCommand
materialize
in class MaterializeTransitionXCommand
CommandException
- thrown if failed to materializeprotected String materializeActions(boolean dryrun) throws Exception
dryrun
- if this is a dry runException
- thrown if failed to materialize actionspublic void notifyParent() throws CommandException
TransitionXCommand
notifyParent
in class TransitionXCommand<Void>
CommandException
Copyright © 2016 Apache Software Foundation. All rights reserved.