public class ADag extends Data implements Graph
Modifier and Type | Field and Description |
---|---|
private DagInfo |
mDAGInfo
The DagInfo object which contains the information got from parsing the
dax file.
|
private Graph |
mGraphImplementor
Handle to the Graph implementor.
|
protected Notifications |
mNotifications
All the notifications associated with the job
|
protected ReplicaStore |
mReplicaStore
Handle to the replica store that stores the replica catalog
user specifies in the DAX
|
private java.lang.String |
mRequestID
The optional request ID associated with the DAX.
|
protected java.lang.String |
mRootWorkflowUUID
The Root Workflow UUID.
|
private java.lang.String |
mSubmitDirectory
The root of the submit directory hierarchy for the DAG.
|
protected TransformationStore |
mTransformationStore
Handle to the transformation store that stores the transformation catalog
user specifies in the DAX
|
protected boolean |
mWorkflowRefinementStarted
Boolean indicating whether the refinement process on the workflow has
started or not.
|
protected java.lang.String |
mWorkflowUUID
The UUID associated with the workflow.
|
Constructor and Description |
---|
ADag()
Initialises the class member variables.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Job job)
This adds a new job to the ADAG object.
|
void |
addEdge(GraphNode parent,
GraphNode child)
Adds an edge between two already existing nodes in the graph.
|
void |
addEdge(java.lang.String parent,
java.lang.String child)
Adds an edge between two already existing nodes in the graph.
|
void |
addEdges(java.lang.String child,
java.util.List<java.lang.String> parents)
A convenience method that allows for bulk addition of edges between
already existing nodes in the graph.
|
void |
addNewRelation(java.lang.String parent,
java.lang.String child)
Adds a new PCRelation pair to the Vector of
PCRelation
pairs. |
void |
addNode(GraphNode node)
Adds a node to the Graph.
|
void |
addNotification(Invoke invoke)
Adds a Invoke object corresponding to a notification.
|
void |
addNotifications(Notifications invokes)
Adds all the notifications passed to the underlying container.
|
void |
addRoot(GraphNode root)
Adds a single root node to the Graph.
|
java.util.Iterator<GraphNode> |
bottomUpIterator()
Returns an iterator that traverses the graph bottom up from the leaves.
|
void |
checkForCorruption()
Checks the underlying graph structure for any corruption.
|
java.lang.Object |
clone()
Returns a new copy of the Object.
|
private java.lang.String |
complain(java.lang.String desc,
GraphNode node,
GraphNode linkedNode)
Convenience method to complain for a linked node from a node that
does not exist in the DAG
|
private void |
edgeToDOT(java.io.Writer stream,
java.lang.String indent,
java.lang.String parent,
java.lang.String child)
Returns the DOT description of the object.
|
void |
generateFlowID()
Generates the flow id for this current run.
|
void |
generateFlowName()
Generates the name of the flow.
|
protected java.lang.String |
generateWorkflowUUID()
Generates the UUID for the workflow
|
java.lang.String |
getAbstractWorkflowName()
Returns the workflow id
|
java.lang.String |
getBaseSubmitDirectory()
Returns the root of submit directory hierarchy for the workflow.
|
java.lang.String |
getCount()
Returns the count of the workflow, that was specified in the DAX.
|
DagInfo |
getDAGInfo()
Returns the DAGInfo that stores the metadata about the DAX
|
java.lang.String |
getDAXVersion()
Returns the dax version
|
java.lang.String |
getExecutableWorkflowName()
Returns the workflow id
|
java.lang.String |
getFlowID()
Returns the flow ID for the workflow.
|
java.lang.String |
getFlowName()
Returns the flow name
|
java.lang.String |
getFlowTimestamp()
Returns the flow timestamp for the workflow.
|
java.lang.String |
getIndex()
Returns the index of the workflow, that was specified in the DAX.
|
java.lang.String |
getLabel()
Returns the label of the workflow, that was specified in the DAX.
|
java.util.List<GraphNode> |
getLeaves()
Returns the leaf nodes of the Graph.
|
java.lang.String |
getMTime()
Returns the last modified time for the file containing the workflow
description.
|
GraphNode |
getNode(java.lang.String identifier)
Returns the node matching the id passed.
|
int |
getNoOfJobs()
Returns the number of jobs in the dag on the basis of number of elements
in the
dagJobs Vector. |
Notifications |
getNotifications()
Returns all the notifications associated with the job.
|
java.util.Collection<Invoke> |
getNotifications(Invoke.WHEN when)
Returns a collection of all the notifications that need to be
done for a particular condition
|
java.lang.String |
getReleaseVersion()
Return the release version
|
ReplicaStore |
getReplicaStore()
Returns the Replica Store
|
java.lang.String |
getRequestID()
Returns the request id.
|
java.util.List<GraphNode> |
getRoots()
Returns the root nodes of the Graph.
|
java.lang.String |
getRootWorkflowUUID()
Returns the UUID for the Root workflow
|
TransformationStore |
getTransformationStore()
Returns the Transformation Store
|
WorkflowMetrics |
getWorkflowMetrics()
Returns the metrics about the workflow.
|
java.lang.String |
getWorkflowUUID()
Returns the UUID for the workflow
|
boolean |
hasWorkflowRefinementStarted()
Returns a boolean indicating whether the workflow refinement has started
or not
|
boolean |
isEmpty()
Returns a boolean if there are no nodes in the graph.
|
java.util.Iterator<GraphNode> |
iterator()
Returns an iterator that traverses through the graph using a graph
traversal algorithm.
|
java.util.Iterator<GraphNode> |
jobIterator()
Returns an iterator for traversing through the jobs in the workflow.
|
java.util.Iterator<GraphNode> |
nodeIterator()
Returns an iterator for the nodes in the Graph.
|
boolean |
remove(Job job)
Removes a particular job from the workflow.
|
boolean |
remove(java.lang.String identifier)
Removes a node from the Graph.
|
void |
resetEdges()
Resets all the dependencies in the Graph, while preserving the nodes.
|
void |
resetStores()
Resets the replica and transformation stores;
|
void |
setBaseSubmitDirectory(java.lang.String dir)
Sets the submit directory for the workflow.
|
void |
setCount(java.lang.String count)
Set the count of the workflow, that was specified in the DAX.
|
void |
setDAXMTime(java.io.File f)
Sets the mtime (last modified time) for the DAX.
|
void |
setDAXVersion(java.lang.String version)
Sets the dax version
|
void |
setFlowTimestamp(java.lang.String timestamp)
Sets the flow timestamp for the workflow.
|
void |
setIndex(java.lang.String index)
Set the index of the workflow, that was specified in the DAX.
|
void |
setLabel(java.lang.String label)
Sets the label for the workflow.
|
void |
setReleaseVersion()
Grabs the release version from VDS.Properties file.
|
void |
setReplicaStore(ReplicaStore store)
Sets the Replica Store
|
void |
setRequestID(java.lang.String id)
Sets the request id.
|
void |
setRootWorkflowUUID(java.lang.String uuid)
Sets the root UUID for the workflow
|
void |
setTransformationStore(TransformationStore store)
Sets the Transformation Store
|
void |
setWorkflowRefinementStarted(boolean state)
Sets whether the workflow refinement has started or not
|
void |
setWorkflowUUID(java.lang.String uuid)
Sets the UUID for the workflow
|
int |
size()
Returns the number of nodes in the graph.
|
java.lang.String |
toDOT()
Returns the DOT description of the object.
|
void |
toDOT(java.io.Writer stream,
java.lang.String indent)
Returns the DOT description of the object.
|
java.util.Iterator<GraphNode> |
topologicalSortIterator()
Returns an iterator for the graph that traverses in topological sort
order.
|
java.lang.String |
toString()
Returns the String description of the dag associated with this object.
|
void |
writeDOTHeader(java.io.Writer stream,
java.lang.String indent)
Writes out the static DOT Header.
|
setToString, vectorToString
private DagInfo mDAGInfo
private java.lang.String mSubmitDirectory
private java.lang.String mRequestID
protected ReplicaStore mReplicaStore
protected TransformationStore mTransformationStore
protected java.lang.String mRootWorkflowUUID
protected java.lang.String mWorkflowUUID
protected boolean mWorkflowRefinementStarted
protected Notifications mNotifications
private Graph mGraphImplementor
public void addNotification(Invoke invoke)
invoke
- the invoke object containing the notificationpublic void addNotifications(Notifications invokes)
invokes
- the notifications to be addedpublic java.util.Collection<Invoke> getNotifications(Invoke.WHEN when)
when
- the conditionpublic Notifications getNotifications()
public void resetStores()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getRootWorkflowUUID()
public void setRootWorkflowUUID(java.lang.String uuid)
uuid
- the UUID of the workflowpublic java.lang.String getWorkflowUUID()
public void setWorkflowUUID(java.lang.String uuid)
uuid
- the UUID of the workflowprotected java.lang.String generateWorkflowUUID()
public boolean hasWorkflowRefinementStarted()
public void setWorkflowRefinementStarted(boolean state)
state
- the boolean valuepublic java.lang.String toString()
public void add(Job job)
job
- the new job that is to be added to the ADag.public boolean remove(Job job)
job
- the Job
object containing the job description.public int getNoOfJobs()
dagJobs
Vector.public void setRequestID(java.lang.String id)
id
- the request id.public java.lang.String getRequestID()
public java.lang.String getAbstractWorkflowName()
public java.lang.String getExecutableWorkflowName()
public void addNewRelation(java.lang.String parent, java.lang.String child)
PCRelation
pairs. For the new relation the isDeleted parameter is set to false.parent
- The parent in the relation pairchild
- The child in the relation pairpublic void setBaseSubmitDirectory(java.lang.String dir)
dir
- the submit directory.public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- the label to be assigned to the workflowpublic java.lang.String getIndex()
public void setIndex(java.lang.String index)
index
- the countpublic void setCount(java.lang.String count)
count
- the countpublic java.lang.String getCount()
public java.lang.String getDAXVersion()
public java.lang.String getMTime()
public java.lang.String getBaseSubmitDirectory()
public void checkForCorruption()
java.lang.RuntimeException
- in case of corruption.private java.lang.String complain(java.lang.String desc, GraphNode node, GraphNode linkedNode)
desc
- node
- linkedNode
- public void setReplicaStore(ReplicaStore store)
store
- the Replica Storepublic ReplicaStore getReplicaStore()
public void setTransformationStore(TransformationStore store)
store
- the Transformation Storepublic TransformationStore getTransformationStore()
public DagInfo getDAGInfo()
public void generateFlowID()
public java.lang.String getFlowID()
public void generateFlowName()
public java.lang.String getFlowName()
public void setDAXVersion(java.lang.String version)
version
- the version of the DAXpublic void setDAXMTime(java.io.File f)
f
- the file descriptor to the DAX|PDAX file.public java.lang.String getReleaseVersion()
public void setReleaseVersion()
public java.lang.String getFlowTimestamp()
public void setFlowTimestamp(java.lang.String timestamp)
timestamp
- the flowtimestamppublic java.util.Iterator<GraphNode> jobIterator()
public WorkflowMetrics getWorkflowMetrics()
public java.lang.String toDOT() throws java.io.IOException
java.io.IOException
- if something fishy happens to the stream.public void toDOT(java.io.Writer stream, java.lang.String indent) throws java.io.IOException
stream
- is a stream opened and ready for writing. This can also
be a StringWriter for efficient output.indent
- is a String
of spaces used for pretty
printing. The initial amount of spaces should be an empty
string. The parameter is used internally for the recursive
traversal.java.io.IOException
- if something fishy happens to the stream.private void edgeToDOT(java.io.Writer stream, java.lang.String indent, java.lang.String parent, java.lang.String child) throws java.io.IOException
stream
- is a stream opened and ready for writing. This can also
be a StringWriter for efficient output.indent
- is a String
of spaces used for pretty
printing. The initial amount of spaces should be an empty
string. The parameter is used internally for the recursive
traversal.parent
- the parentchild
- the childjava.io.IOException
- if something fishy happens to the stream.public void writeDOTHeader(java.io.Writer stream, java.lang.String indent) throws java.io.IOException
stream
- is a stream opened and ready for writing. This can also
be a StringWriter for efficient output.indent
- is a String
of spaces used for pretty
printing. The initial amount of spaces should be an empty
string. The parameter is used internally for the recursive
traversal.java.io.IOException
- if something fishy happens to the stream.public void addNode(GraphNode node)
public void addEdge(java.lang.String parent, java.lang.String child)
public void addEdge(GraphNode parent, GraphNode child)
public void addEdges(java.lang.String child, java.util.List<java.lang.String> parents)
public GraphNode getNode(java.lang.String identifier)
public void addRoot(GraphNode root)
public boolean remove(java.lang.String identifier)
public void resetEdges()
resetEdges
in interface Graph
public java.util.Iterator<GraphNode> nodeIterator()
nodeIterator
in interface Graph
public java.util.Iterator<GraphNode> iterator()
public java.util.Iterator<GraphNode> bottomUpIterator()
bottomUpIterator
in interface Graph
public java.util.Iterator<GraphNode> topologicalSortIterator()
topologicalSortIterator
in interface Graph
public int size()
public java.util.List<GraphNode> getRoots()
public java.util.List<GraphNode> getLeaves()