org.griphyn.cPlanner.classes
Class ADag

java.lang.Object
  extended by org.griphyn.cPlanner.classes.Data
      extended by org.griphyn.cPlanner.classes.ADag
All Implemented Interfaces:
Cloneable

public class ADag
extends Data

This class object contains the info about a Dag. DagInfo object contains the information to create the .dax file. vJobSubInfos is a Vector containing SubInfo objects of jobs making the Dag. Each subinfo object contains information needed to generate a submit file for that job.

Version:
$Revision: 351 $
Author:
Karan Vahi, Gaurang Mehta
See Also:
DagInfo, SubInfo

Field Summary
 DagInfo dagInfo
          The DagInfo object which contains the information got from parsing the dax file.
private  String mRequestID
          The optional request ID associated with the DAX.
private  String mSubmitDirectory
          The root of the submit directory hierarchy for the DAG.
 Vector vJobSubInfos
          Vector of SubInfo objects.
 
Fields inherited from class org.griphyn.cPlanner.classes.Data
mLogger, mLogMsg
 
Constructor Summary
ADag()
          Initialises the class member variables.
ADag(DagInfo dg, Vector vSubs)
          Overloaded constructor.
 
Method Summary
 void add(SubInfo job)
          This adds a new job to the ADAG object.
 void addNewRelation(String parent, String child)
          Adds a new PCRelation pair to the Vector of PCRelation pairs.
 void addNewRelation(String parent, String child, boolean isDeleted)
          Adds a new PCRelation pair to the Vector of PCRelation pairs.
 void clearJobs()
          Removes all the jobs from the workflow, and all the edges between the workflows.
 Object clone()
          Returns a new copy of the Object.
 String getBaseSubmitDirectory()
          Returns the root of submit directory hierarchy for the workflow.
 Vector getChildren(String node)
          Get all the children of a particular node.
 Set getExecutionSites()
          It returns the a unique list of the execution sites that the Planner has mapped the dax to so far in it's stage of planning .
 String getLabel()
          Returns the label of the workflow, that was specified in the DAX.
 Vector getLeafNodes()
          Returns all the leaf nodes of the dag.
 String getMTime()
          Returns the last modified time for the file containing the workflow description.
 int getNoOfJobs()
          Returns the number of jobs in the dag on the basis of number of elements in the dagJobs Vector.
 Vector getParents(String node)
          Gets all the parents of a particular node
 String getRequestID()
          Returns the request id.
 Vector getRootNodes()
          It determines the root Nodes for the ADag looking at the relation pairs of the adag.
 SubInfo getSubInfo(String job)
          This returns a SubInfo object corresponding to the job by looking through all the subInfos.
 WorkflowMetrics getWorkflowMetrics()
          Returns the metrics about the workflow.
 boolean isEmpty()
          Returns whether the workflow is empty or not.
 Iterator jobIterator()
          Returns an iterator for traversing through the jobs in the workflow.
 boolean remove(SubInfo job)
          Removes a particular job from the workflow.
 void setBaseSubmitDirectory(String dir)
          Sets the submit directory for the workflow.
 void setRequestID(String id)
          Sets the request id.
 String toDOT()
          Returns the DOT description of the object.
 void toDOT(Writer stream, String indent)
          Returns the DOT description of the object.
 String toString()
          Returns the String description of the dag associated with this object.
 void writeDOTHeader(Writer stream, String indent)
          Writes out the static DOT Header.
 
Methods inherited from class org.griphyn.cPlanner.classes.Data
setToString, vectorToString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dagInfo

public DagInfo dagInfo
The DagInfo object which contains the information got from parsing the dax file.


vJobSubInfos

public Vector vJobSubInfos
Vector of SubInfo objects. Each SubInfo object contains information corresponding to the submit file for one job.


mSubmitDirectory

private String mSubmitDirectory
The root of the submit directory hierarchy for the DAG. This is the directory where generally the DAG related files like the log files, .dag and dagman output files reside.


mRequestID

private String mRequestID
The optional request ID associated with the DAX.

Constructor Detail

ADag

public ADag()
Initialises the class member variables.


ADag

public ADag(DagInfo dg,
            Vector vSubs)
Overloaded constructor.

Parameters:
dg - the DagInfo
vSubs - the jobs in the workflow.
Method Detail

clone

public Object clone()
Returns a new copy of the Object.

Overrides:
clone in class Object
Returns:
the clone of the object.

toString

public String toString()
Returns the String description of the dag associated with this object.

Specified by:
toString in class Data
Returns:
textual description.

add

public void add(SubInfo job)
This adds a new job to the ADAG object. It ends up adding both the job name and the job description to the internal structure.

Parameters:
job - the new job that is to be added to the ADag.

clearJobs

public void clearJobs()
Removes all the jobs from the workflow, and all the edges between the workflows. The only thing that remains is the meta data about the workflow.


isEmpty

public boolean isEmpty()
Returns whether the workflow is empty or not.

Returns:
boolean

remove

public boolean remove(SubInfo job)
Removes a particular job from the workflow. It however does not delete the relations the edges that refer to the job.

Parameters:
job - the SubInfo object containing the job description.
Returns:
boolean indicating whether the removal was successful or not.

getNoOfJobs

public int getNoOfJobs()
Returns the number of jobs in the dag on the basis of number of elements in the dagJobs Vector.

Returns:
the number of jobs.

setRequestID

public void setRequestID(String id)
Sets the request id.

Parameters:
id - the request id.

getRequestID

public String getRequestID()
Returns the request id.

Returns:
the request id.

addNewRelation

public void addNewRelation(String parent,
                           String child)
Adds a new PCRelation pair to the Vector of PCRelation pairs. For the new relation the isDeleted parameter is set to false.

Parameters:
parent - The parent in the relation pair
child - The child in the relation pair
See Also:
PCRelation

addNewRelation

public void addNewRelation(String parent,
                           String child,
                           boolean isDeleted)
Adds a new PCRelation pair to the Vector of PCRelation pairs.

Parameters:
parent - The parent in the relation pair
child - The child in the relation pair
isDeleted - Whether the relation has been deleted due to the reduction algorithm or not.
See Also:
PCRelation

setBaseSubmitDirectory

public void setBaseSubmitDirectory(String dir)
Sets the submit directory for the workflow.

Parameters:
dir - the submit directory.

getLabel

public String getLabel()
Returns the label of the workflow, that was specified in the DAX.

Returns:
the label of the workflow.

getMTime

public String getMTime()
Returns the last modified time for the file containing the workflow description.

Returns:
the MTime

getBaseSubmitDirectory

public String getBaseSubmitDirectory()
Returns the root of submit directory hierarchy for the workflow.

Returns:
the directory.

getParents

public Vector getParents(String node)
Gets all the parents of a particular node

Parameters:
node - the name of the job whose parents are to be found.
Returns:
Vector corresponding to the parents of the node

getChildren

public Vector getChildren(String node)
Get all the children of a particular node.

Parameters:
node - the name of the node whose children we want to find.
Returns:
Vector containing the children of the node

getLeafNodes

public Vector getLeafNodes()
Returns all the leaf nodes of the dag. The way the structure of Dag is specified, in terms of the parent child relationship pairs, the determination of the leaf nodes can be computationally intensive. The complexity is of order n^2

Returns:
Vector of String corresponding to the job names of the leaf nodes.
See Also:
PCRelation, DagInfo.relations

getExecutionSites

public Set getExecutionSites()
It returns the a unique list of the execution sites that the Planner has mapped the dax to so far in it's stage of planning . This is a subset of the pools specified by the user at runtime.

Returns:
a TreeSet containing a list of siteID's of the sites where the dag has to be run.

getRootNodes

public Vector getRootNodes()
It determines the root Nodes for the ADag looking at the relation pairs of the adag. The way the structure of Dag is specified in terms of the parent child relationship pairs, the determination of the leaf nodes can be computationally intensive. The complexity if of order n^2.

Returns:
the root jobs of the Adag
See Also:
PCRelation, DagInfo.relations

jobIterator

public Iterator jobIterator()
Returns an iterator for traversing through the jobs in the workflow.

Returns:
Iterator

getSubInfo

public SubInfo getSubInfo(String job)
This returns a SubInfo object corresponding to the job by looking through all the subInfos.

Parameters:
job - jobName of the job for which we need the subInfo object.
Returns:
the SubInfo objects corresponding to the job

getWorkflowMetrics

public WorkflowMetrics getWorkflowMetrics()
Returns the metrics about the workflow.

Returns:
the WorkflowMetrics

toDOT

public String toDOT()
             throws IOException
Returns the DOT description of the object. This is used for visualizing the workflow.

Returns:
String containing the Partition object in XML.
Throws:
IOException - if something fishy happens to the stream.

toDOT

public void toDOT(Writer stream,
                  String indent)
           throws IOException
Returns the DOT description of the object. This is used for visualizing the workflow.

Parameters:
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.
Throws:
IOException - if something fishy happens to the stream.

writeDOTHeader

public void writeDOTHeader(Writer stream,
                           String indent)
                    throws IOException
Writes out the static DOT Header.

Parameters:
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.
Throws:
IOException - if something fishy happens to the stream.


Copyright © 2007 The University of Southern California. All Rights Reserved.