public class JobStatus extends TypedAtomicActor
Check the status of a Job
This actor uses the Job class to ask for the status of a submitted job.
The input should be a previously submitted job. i.e. the output from a JobSubmitter. When the job contains more than one task also provide the number of tasks using the numTasks parameter
Optional inputs - 1. you could specify the actor to wait for a specific status - for example Running 2. or wait till one of many status - for example Error,NotInQueue 3. Or you could ask the actor to all status changes as and when it is detected.
The output is the status code of the job:
If not such job exists, the result will be also the Error status.
For convenience, the job is also passed on output port jobOut if the status is NOT Error and NOT NotInQueue. This token can be used (delaying it with a Sleep actor) to ask its Status again and again until the job is finished or aborted.
When numTasks input is greater than zero, in addition to job's overall status code the actor also outputs task id and task status of individual tasks
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
job_tokenProdRate |
TypedIOPort |
jobIn
A submitted job This port is an output port of type Object.
|
TypedIOPort |
jobOut
The job is passed on in this actor.
|
Parameter |
log_tokenProdRate |
TypedIOPort |
logport
Logging information of job status query.
|
Parameter |
numTasks
Parameter to set if the workflow is task parallel.
|
Parameter |
sendAllChanges
Parameter to set if you want job status to ignore waitUntil parameter
and send out every status change
|
Parameter |
sleepWhileWaiting
Amount of time (in milliseconds) to sleep between checking job status.
|
TypedIOPort |
statusCode
Status code of the job 0 : for some error during execution or if jobID is
invalid 1 : not in queue: i.e. already finished if it had ever been there
(this is good news!)
|
Parameter |
statuscode_tokenProdRate
The rate parameter for the output port.
|
TypedIOPort |
taskId
Task ID : this is the task id for the status code
|
TypedIOPort |
taskStatusCode
Task status code : for some error during execution or if jobID is
invalid 1 : not in queue: i.e. already finished if it had ever been there
(this is good news!)
|
Parameter |
waitUntil
Wait until the job has a specific status.
|
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
JobStatus(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute.
|
void |
fire()
fire
|
void |
initialize()
Initialize this actor.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public TypedIOPort jobIn
public TypedIOPort jobOut
public TypedIOPort statusCode
public TypedIOPort taskStatusCode
public TypedIOPort taskId
public TypedIOPort logport
public Parameter sleepWhileWaiting
public Parameter sendAllChanges
public Parameter numTasks
public Parameter statuscode_tokenProdRate
public Parameter log_tokenProdRate
public Parameter job_tokenProdRate
public JobStatus(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained by the proposed
container.NameDuplicationException
- If the container already has an actor with this name.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the change is not acceptable
to this container (not thrown in this base class).public void initialize()
AtomicActor
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- Not thrown.