|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A TaskGraph provides a building block for expressing complex
dependencies between tasks. All advanced applications require mechanisms to
execute client-side workflows that process the tasks based on user-defined
control Dependency. Hence, the TaskGraph aggregates a
set of ExecutableObjects (Task or
TaskGraph) and allows the user to define dependencies between
these tasks. In graph theoretical terms, a TaskGraph provides
the mechanism to express workflows as a hierarchical directed acyclic graph.
A TaskGraph can theoretically contain infinite levels of
hierarchy. However, practically it is constrained with the availability of
resources (memory) on a particular system.
| Field Summary | |
static int |
AbortOnFailure
Represents a failure policy whereby the execution of the TaskGraph is aborted once any of its component
Task fails. |
static int |
ContinueOnFailure
Represents a failure policy whereby the execution of the TaskGraph is continued even if its component
Task fail. |
| Fields inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject |
TASK, TASKGRAPH |
| Method Summary | |
void |
add(ExecutableObject graphNode)
Adds the ExecutableObject(Task or
TaskGraph) to this TaskGraph. |
void |
addChangeListener(ChangeListener listener)
Adds the listener to receive graph change events produced by this TaskGraph. |
void |
addDependency(ExecutableObject from,
ExecutableObject to)
Adds a single dependency between the given nodes. |
boolean |
contains(Identity id)
Returns a boolean indicating whether this TaskGraph
contains a node with the given Identity |
Enumeration |
elements()
Returns all the ExecutableObject(s) that is encapsulated by this
TaskGraph. |
ExecutableObject |
get(Identity id)
Returns the ExecutableObjectthat is represented by the given
identity. |
int |
getActiveCount()
Returns the number of ExecutableObjects that have their status
as Status.ACTIVE |
Enumeration |
getAllAttributes()
|
Object |
getAttribute(String name)
|
int |
getCanceledCount()
Returns the number of ExecutableObjects that have their status
as Status.CANCELED |
int |
getCompletedCount()
Returns the number of ExecutableObjects that have their status
as Status.COMPLETED |
Calendar |
getCompletedTime()
Returns the time when this TaskGraph was completed |
Dependency |
getDependency()
Returns the dependency object associated with this TaskGraph. |
int |
getFailedCount()
Returns the number of ExecutableObjects that have their status
as Status.FAILED |
int |
getFailureHandlingPolicy()
Returns the failure handling policy of this TaskGraph. |
int |
getResumedCount()
Returns the number of ExecutableObjects that have their status
as Status.RESUMED |
int |
getSize()
Returns the total number of ExecutableObjectencapsulated by this
TaskGraph |
int |
getSubmittedCount()
Returns the number of ExecutableObjects that have their status
as Status.SUBMITTED |
Calendar |
getSubmittedTime()
Returns the time when this TaskGraph was submitted |
int |
getSuspendedCount()
Returns the number of ExecutableObjects that have their status
as Status.SUSPENDED |
int |
getUnsubmittedCount()
Returns the number of ExecutableObjects that have their status
as Status.UNSUBMITTED |
boolean |
isEmpty()
Returns a boolean indicating whether this TaskGraph
contains any node |
ExecutableObject |
remove(Identity id)
Removes the ExecutableObjectthat is represented by the given
identity. |
void |
removeChangeListener(ChangeListener listener)
Removes the change listener for this TaskGraph. |
boolean |
removeDependency(ExecutableObject from,
ExecutableObject to)
Removes the dependency between the given nodes. |
void |
setAttribute(String name,
Object value)
|
void |
setDependency(Dependency dependency)
Sets all the dependencies associated with this TaskGraph. |
void |
setFailureHandlingPolicy(int policy)
Sets the policy adopted by this TaskGraph when any
Task fails. |
ExecutableObject[] |
toArray()
Returns all the ExecutableObject(s) that is encapsulated by this
TaskGraph. |
void |
toXML(File file)
Checkpoints the current state of this TaskGraph in XML
format. |
| Methods inherited from interface org.globus.cog.abstraction.interfaces.ExecutableObject |
addStatusListener, getIdentity, getName, getObjectType, getStatus, removeStatusListener, setIdentity, setName, setStatus, setStatus |
| Field Detail |
public static final int AbortOnFailure
TaskGraph is aborted once any of its component
Task fails.
public static final int ContinueOnFailure
TaskGraph is continued even if its component
Task fail.
| Method Detail |
public void add(ExecutableObject graphNode)
throws Exception
ExecutableObject(Task or
TaskGraph) to this TaskGraph. By default
the added node is an unconnected node without dependencies on any of the
existing nodes in this TaskGraph.
graphNode - an ExecutableObjectto be added as a node
Exception
public ExecutableObject remove(Identity id)
throws Exception
ExecutableObjectthat is represented by the given
identity.
id - the identity of the node to be removed
ExecutableObject
Exceptionpublic ExecutableObject get(Identity id)
ExecutableObjectthat is represented by the given
identity.
id - the identity of the node to be returned
ExecutableObjectrepresented by the given Identitypublic ExecutableObject[] toArray()
ExecutableObject(s) that is encapsulated by this
TaskGraph.
TaskGraphpublic Enumeration elements()
ExecutableObject(s) that is encapsulated by this
TaskGraph.
TaskGraphpublic void setDependency(Dependency dependency)
TaskGraph.
public Dependency getDependency()
TaskGraph.
public void addDependency(ExecutableObject from,
ExecutableObject to)
from - the ExecutableObjectrepresenting the parent nodeto - the ExecutableObjectrepresenting the child node
public boolean removeDependency(ExecutableObject from,
ExecutableObject to)
from - the ExecutableObjectrepresenting the parent nodeto - the ExecutableObjectrepresenting the child node
public void setAttribute(String name,
Object value)
public Object getAttribute(String name)
public Enumeration getAllAttributes()
public int getSize()
ExecutableObjectencapsulated by this
TaskGraph
public boolean isEmpty()
TaskGraph
contains any node
public boolean contains(Identity id)
TaskGraph
contains a node with the given Identity
id - the Identity of the desired nodepublic int getUnsubmittedCount()
ExecutableObjects that have their status
as Status.UNSUBMITTED
public int getSubmittedCount()
ExecutableObjects that have their status
as Status.SUBMITTED
public int getActiveCount()
ExecutableObjects that have their status
as Status.ACTIVE
public int getCompletedCount()
ExecutableObjects that have their status
as Status.COMPLETED
public int getSuspendedCount()
ExecutableObjects that have their status
as Status.SUSPENDED
public int getResumedCount()
ExecutableObjects that have their status
as Status.RESUMED
public int getFailedCount()
ExecutableObjects that have their status
as Status.FAILED
public int getCanceledCount()
ExecutableObjects that have their status
as Status.CANCELED
public void toXML(File file)
throws MarshalException
TaskGraph in XML
format. Using the TaskGraphUnmarshaller,
the checkpointed TaskGraph can once again be
re-instantiated.
file - the file to store the checkpointed task graph.
MarshalException - during an error in XML translation.public Calendar getSubmittedTime()
TaskGraph was submitted
TaskGraph submission time. null, if it is not
yet submittedpublic Calendar getCompletedTime()
TaskGraph was completed
TaskGraph completion time. null, if it is not
yet completedpublic void setFailureHandlingPolicy(int policy)
TaskGraph when any
Task fails. This policy determines the execution behaviour
of the nodes dependent on the failed nodes.
For example, if the policy is AbortOnFailure, then
dependents of a failed ExecutableObject are not executed
at all. On the other hand, if the policy is
ContinueOnFailure, then the dependents are executed
irrespective to the final status of the parents.
public int getFailureHandlingPolicy()
TaskGraph.
public void addChangeListener(ChangeListener listener)
TaskGraph. Change events are generated when an
ExecutableObject is either added or removed from this
TaskGraph.
public void removeChangeListener(ChangeListener listener)
TaskGraph.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||