public class BundleSubmitXCommand extends SubmitTransitionXCommand
Modifier and Type | Field and Description |
---|---|
static String |
BUNDLE_XML_FILE |
static String |
CONFIG_DEFAULT |
insertList, job, updateList
DEFAULT_LOCK_TIMEOUT, DEFAULT_REQUEUE_DELAY, dryrun, eventService, instrumentation, INSTRUMENTATION_GROUP, LOG
Constructor and Description |
---|
BundleSubmitXCommand(boolean dryrun,
org.apache.hadoop.conf.Configuration conf)
Constructor to create the bundle submit command.
|
BundleSubmitXCommand(org.apache.hadoop.conf.Configuration conf)
Constructor to create the bundle submit command.
|
Modifier and Type | Method and Description |
---|---|
static ELEvaluator |
createELEvaluatorForGroup(org.apache.hadoop.conf.Configuration conf,
String group) |
ELEvaluator |
createEvaluator(org.apache.hadoop.conf.Configuration conf)
Create ELEvaluator
|
protected void |
eagerLoadState()
Load the necessary state to perform an eager precondition check.
|
protected void |
eagerVerifyPrecondition()
Verify the precondition for the command before obtaining a lock.
|
String |
getEntityKey()
Return the entity key for the command.
|
Job |
getJob()
Get the Job for the command.
|
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 |
mergeDefaultConfig()
Merge default configuration with user-defined configuration.
|
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.
|
protected String |
readDefinition(String appPath)
Read bundle definition.
|
protected String |
submit()
Submit 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, transitToNext
generateEvents, setJob
call, executeInterrupts, getCreatedTime, getInstrumentation, getKey, getLockTimeOut, getLog, getName, getPriority, getRequeueDelay, getType, inInterruptMode, isReQueueRequired, queue, queue, resetUsed, setInterruptMode, setLogInfo, toString
public static final String CONFIG_DEFAULT
public static final String BUNDLE_XML_FILE
public BundleSubmitXCommand(org.apache.hadoop.conf.Configuration conf)
conf
- configuration for bundle jobpublic BundleSubmitXCommand(boolean dryrun, org.apache.hadoop.conf.Configuration conf)
dryrun
- true if dryrun is enableconf
- configuration for bundle jobprotected String submit() throws CommandException
SubmitTransitionXCommand
submit
in class SubmitTransitionXCommand
CommandException
- thrown if unable to submitpublic void notifyParent() throws CommandException
TransitionXCommand
notifyParent
in class TransitionXCommand<String>
CommandException
public String getEntityKey()
XCommand
getEntityKey
in interface XCallable<String>
getEntityKey
in class XCommand<String>
protected boolean isLockRequired()
XCommand
Subclasses should override this method if they require locking.
isLockRequired
in class XCommand<String>
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<String>
CommandException
protected void verifyPrecondition() throws CommandException, PreconditionException
XCommand
verifyPrecondition
in class XCommand<String>
CommandException
- thrown if the precondition is not met.PreconditionException
protected void eagerLoadState() throws CommandException
XCommand
This implementation does a NOP.
Subclasses should override this method and load the state needed to do an eager precondition check.
A trivial implementation is calling {link #loadState}.
eagerLoadState
in class XCommand<String>
CommandException
protected void eagerVerifyPrecondition() throws CommandException, PreconditionException
XCommand
This implementation does a NOP.
A trivial implementation is calling {link #verifyPrecondition}.
eagerVerifyPrecondition
in class XCommand<String>
CommandException
- thrown if the precondition is not met.PreconditionException
protected void mergeDefaultConfig() throws CommandException
CommandException
- thrown if failed to merge configurationprotected String readDefinition(String appPath) throws BundleJobException
appPath
- application path.BundleJobException
- thrown if the definition could not be read.public Job getJob()
TransitionXCommand
getJob
in class TransitionXCommand<String>
public static ELEvaluator createELEvaluatorForGroup(org.apache.hadoop.conf.Configuration conf, String group)
public ELEvaluator createEvaluator(org.apache.hadoop.conf.Configuration conf) throws BundleJobException
conf
- job configurationBundleJobException
- thrown if failed to create evaluatorpublic void updateJob() throws CommandException
TransitionXCommand
updateJob
in class TransitionXCommand<String>
CommandException
public void performWrites() throws CommandException
TransitionXCommand
performWrites
in class TransitionXCommand<String>
CommandException
Copyright © 2018 Apache Software Foundation. All rights reserved.