Class Minimal

  • All Implemented Interfaces:
    Strategy

    public class Minimal
    extends AbstractStrategy
    This strategy for adding create dir jobs to the workflow only adds the minimum number of edges from the create dir job to the compute jobs in the workflow. The strategy involves in walking the graph in a BFS order, and updating a bit set associated with each job based on the BitSet of the parent jobs. The BitSet indicates whether an edge exists from the create dir job to an ancestor of the node. For a node, the bit set is the union of all the parents BitSets. The BFS traversal ensures that the bitsets are of a node are only updated once the parents have been processed
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Constructor Detail

      • Minimal

        public Minimal()
    • Method Detail

      • addCreateDirectoryNodes

        public ADag addCreateDirectoryNodes​(ADag dag)
        Modifies the workflow to add create directory nodes. The workflow passed is a worklow, where the jobs have been mapped to sites. The strategy involves in walking the graph in a BFS order, and updating a bit set associated with each job based on the BitSet of the parent jobs. The BitSet indicates whether an edge exists from the create dir job to an ancestor of the node. For a node, the bit set is the union of all the parents BitSets. The BFS traversal ensures that the bitsets are of a node are only updated once the parents have been processed.
        Parameters:
        dag - the workflow to which the nodes have to be added.
        Returns:
        the added workflow
      • addCreateDirectoryNodes

        public ADag addCreateDirectoryNodes​(ADag workflow,
                                            java.util.Set<java.lang.String> sites)
        Adds create dir nodes to the workflow. The strategy involves in walking the graph in a BFS order, and updating a bit set associated with each job based on the BitSet of the parent jobs. The BitSet indicates whether an edge exists from the create dir job to an ancestor of the node. For a node, the bit set is the union of all the parents BitSets. The BFS traversal ensures that the bitsets are of a node are only updated once the parents have been processed.
        Parameters:
        workflow - the workflow
        sites - the staging sites the workflow refers to.
        Returns:
      • getAssociatedCreateDirSite

        private java.lang.String getAssociatedCreateDirSite​(Job job)
        Returns the associated site that job is dependant on. This is site, whose create dir job should be a parent or an ancestor of the job.
        Parameters:
        job - the job for which we need the associated create dir site.
        Returns:
        the site
      • addDependency

        public boolean addDependency​(Job job)