org.griphyn.cPlanner.classes
Class DagInfo

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

public class DagInfo
extends Data

Holds the information needed to make one dag file corresponding to a Abstract Dag. It holds information to generate the .dax file which is submitted to Condor.

Version:
$Revision: 314 $
Author:
Karan Vahi, Gaurang Mehta

Field Summary
 String count
          Refers to the number of the Abstract Dags which are being sent to the Concrete Planner in response to the user's request.
 Vector dagJobs
          Vector of String objects containing the jobname_id of jobs making the abstract dag.
private static String DEFAULT_NAME
          The default name for the ADag object, if not supplied in the DAX.
 String flowID
          It is a unique identifier identifying the concrete DAG generated by Pegasus.
 String flowIDName
          It is the name of the dag as generated by Chimera in the dax.
 String index
          Refers to the number of the Dag.
 TreeMap lfnMap
          Contains a unique ordered listing of the logical names referred to by the dag.
private  String mDAXMTime
          Keeps the last modified time of the DAX.
private  String mFlowTimestamp
          The ISO timestamp corresponding to the time when Pegasus is invoked for a dax.
private  WorkflowMetrics mWFMetrics
          The workflow metric objects that contains metrics about the workflow being planned.
 String nameOfADag
          The name of the Abstract Dag taken from the adag element of the DAX generated by the Abstract Planner.
 Vector relations
          Captures the parent child relations making up the DAG.
 String releaseVersion
          Identifies the release version of the VDS software that was used to generate the workflow.
 
Fields inherited from class org.griphyn.cPlanner.classes.Data
mLogger, mLogMsg
 
Constructor Summary
DagInfo()
          The default constructor.
 
Method Summary
 void addNewJob(SubInfo job)
          Adds a new job to the dag.
 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.
 Object clone()
          Returns a new copy of the Object.
 void generateFlowID()
          Generates the flow id for this current run.
 void generateFlowName()
          Generates the name of the flow.
 Vector getChildren(String node)
          Get all the children of a particular node.
 String getFlowTimestamp()
          Returns the flow timestamp for the workflow.
 String getLabel()
          Returns the label of the workflow, that was specified in the DAX.
 Vector getLeafNodes()
          This returns all the leaf nodes of the dag.
 Set getLFNs()
          It returns the list of lfns referred to by the DAG.
 Set getLFNs(boolean onlyInput)
          Returns the list of lfns referred to by 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.
 Vector getRootNodes()
          It determines the root Nodes for the ADag looking at the relation pairs of the adag.
 WorkflowMetrics getWorkflowMetrics()
          Returns the workflow metrics so far.
 boolean remove(SubInfo job)
          Removes a job from the dag/graph structure.
 void setDAXMTime(String path)
          Sets the mtime (last modified time) for the DAX.
 void setFlowTimestamp(String timestamp)
          Sets the flow timestamp for the workflow.
 void setLabel(String label)
          Sets the label for the workflow.
 void setReleaseVersion()
          Grabs the release version from VDS.Properties file.
 String toString()
          Returns the a textual description of the object.
 void updateLFNMap(String lfn, String type)
          Updates the lfn map, that contains the mapping of an lfn with the type.
 
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

DEFAULT_NAME

private static final String DEFAULT_NAME
The default name for the ADag object, if not supplied in the DAX.

See Also:
Constant Field Values

dagJobs

public Vector dagJobs
Vector of String objects containing the jobname_id of jobs making the abstract dag.


relations

public Vector relations
Captures the parent child relations making up the DAG. It is a Vector of PCRelation objects.


nameOfADag

public String nameOfADag
The name of the Abstract Dag taken from the adag element of the DAX generated by the Abstract Planner.


count

public String count
Refers to the number of the Abstract Dags which are being sent to the Concrete Planner in response to the user's request.


index

public String index
Refers to the number of the Dag. Index can vary from 0 to count - 1.


flowID

public String flowID
It is a unique identifier identifying the concrete DAG generated by Pegasus. It consists of the dag name and the timestamp.

See Also:
flowIDName, mFlowTimestamp

flowIDName

public String flowIDName
It is the name of the dag as generated by Chimera in the dax. If none is specified then a default name of PegasusRun is assigned.


mFlowTimestamp

private String mFlowTimestamp
The ISO timestamp corresponding to the time when Pegasus is invoked for a dax. It is used to generate the random directory names also if required.


mDAXMTime

private String mDAXMTime
Keeps the last modified time of the DAX.


releaseVersion

public String releaseVersion
Identifies the release version of the VDS software that was used to generate the workflow. It is populated from Version.java.

See Also:
Version

mWFMetrics

private WorkflowMetrics mWFMetrics
The workflow metric objects that contains metrics about the workflow being planned.


lfnMap

public TreeMap lfnMap
Contains a unique ordered listing of the logical names referred to by the dag. The TreeMap implementation guarentees us a log(n) execution time for the basic operations. Hence should scale well. The key for the map is the lfn name. The value is a String flag denoting whether this file is an input(i) or output(o) or both (b) or none(n). A value of none(n) would denote an error condition.

Constructor Detail

DagInfo

public DagInfo()
The default constructor.

Method Detail

addNewJob

public void addNewJob(SubInfo job)
Adds a new job to the dag.

Parameters:
job - the job to be added

addNewRelation

public void addNewRelation(String parent,
                           String child)
Adds a new PCRelation pair to the Vector of PCRelation pairs. Since we are adding a new relation the isDeleted parameter should be false.

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

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:
relations

remove

public boolean remove(SubInfo job)
Removes a job from the dag/graph structure. It however does not delete the relations the edges that refer to the job.

Parameters:
job - the job to be removed
Returns:
boolean indicating whether removal was successful or not.

getLFNs

public Set getLFNs()
It returns the list of lfns referred to by the DAG. The list is unique as it is gotten from iterating through the lfnMap.

Returns:
a Set of String objects corresponding to the logical filenames

getLFNs

public Set getLFNs(boolean onlyInput)
Returns the list of lfns referred to by the DAG. The list is unique as it is gotten from iterating through the lfnMap. The contents of the list are determined on the basis of the command line options passed by the user at runtime. For e.g. if the user has specified force, then one needs to search only for the input files.

Parameters:
onlyInput - a boolean flag indicating that you need only the input files to the whole workflow
Returns:
a set of logical filenames.

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

getFlowTimestamp

public String getFlowTimestamp()
Returns the flow timestamp for the workflow.

Returns:
the flowtimestamp

setFlowTimestamp

public void setFlowTimestamp(String timestamp)
Sets the flow timestamp for the workflow.

Parameters:
timestamp - the flowtimestamp

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 the jobs.

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()
This 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 if of order n^2.

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

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, relations

getWorkflowMetrics

public WorkflowMetrics getWorkflowMetrics()
Returns the workflow metrics so far.

Returns:
the workflow metrics

generateFlowID

public void generateFlowID()
Generates the flow id for this current run. It is made of the name of the dag and a timestamp. This is a simple concat of the mFlowTimestamp and the flowName. For it work correctly the function needs to be called after the flow name and timestamp have been generated.


generateFlowName

public void generateFlowName()
Generates the name of the flow. It is same as the nameOfADag if specified in dax generated by Chimera.


setLabel

public void setLabel(String label)
Sets the label for the workflow.

Parameters:
label - the label to be assigned to the workflow

setDAXMTime

public void setDAXMTime(String path)
Sets the mtime (last modified time) for the DAX. It is the time, when the DAX file was last modified. If the DAX file does not exist or an IO error occurs, the MTime is set to OL i.e . The DAX mTime is always generated in an extended format. Generating not in extended format, leads to the XML parser tripping while parsing the invocation record generated by Kickstart.

Parameters:
path - the path to the DAX|PDAX file.

setReleaseVersion

public void setReleaseVersion()
Grabs the release version from VDS.Properties file.

See Also:
Version

updateLFNMap

public void updateLFNMap(String lfn,
                         String type)
Updates the lfn map, that contains the mapping of an lfn with the type.

Parameters:
lfn - the logical file name.
type - type the type of lfn (i|o|b). usually a character.

clone

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

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

toString

public String toString()
Returns the a textual description of the object.

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


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