T
- public abstract class TransitionXCommand<T> extends XCommand<T>
Modifier and Type | Field and Description |
---|---|
protected List<JsonBean> |
insertList |
protected Job |
job |
protected List<BatchQueryExecutor.UpdateEntry> |
updateList |
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG
Constructor and Description |
---|
TransitionXCommand(String name,
String type,
int priority) |
TransitionXCommand(String name,
String type,
int priority,
boolean dryrun) |
Modifier and Type | Method and Description |
---|---|
protected T |
execute()
Command execution body.
|
void |
generateEvents(CoordinatorJobBean coordJob,
Date startTime)
This will be used to generate Job Notification events on status changes
|
Job |
getJob()
Get the Job for the command.
|
abstract void |
notifyParent()
This will be used to notify the parent about the status of that perticular job.
|
abstract void |
performWrites()
This will be used to perform atomically all the writes within this command.
|
void |
setJob(Job job)
Set the Job for the command.
|
abstract void |
transitToNext()
Transit to the next status based on the result of the Job.
|
abstract void |
updateJob()
Update the parent job.
|
call, eagerLoadState, eagerVerifyPrecondition, executeInterrupts, getCreatedTime, getEntityKey, getInstrumentation, getKey, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isLockRequired, isReQueueRequired, loadState, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString, verifyPrecondition
protected List<BatchQueryExecutor.UpdateEntry> updateList
protected List<JsonBean> insertList
public TransitionXCommand(String name, String type, int priority)
public TransitionXCommand(String name, String type, int priority, boolean dryrun)
public abstract void transitToNext() throws CommandException
CommandException
public abstract void updateJob() throws CommandException
CommandException
public abstract void notifyParent() throws CommandException
CommandException
public void generateEvents(CoordinatorJobBean coordJob, Date startTime) throws CommandException
coordJob
- startTime
- CommandException
public abstract void performWrites() throws CommandException
CommandException
protected T execute() throws CommandException
XCommand
This method will be invoked after the {link #loadState} and {link #verifyPrecondition} methods.
If the command requires locking, this method will be invoked ONLY if the lock has been acquired.
execute
in class XCommand<T>
CommandException
- thrown if the command execution failed.Copyright © 2018 Apache Software Foundation. All rights reserved.