edu.isi.pegasus.planner.refiner.createdir

## Class Minimal

- java.lang.Object
- - edu.isi.pegasus.planner.refiner.createdir.AbstractStrategy
  - - edu.isi.pegasus.planner.refiner.createdir.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

### Field Summary

### Fields inherited from class edu.isi.pegasus.planner.refiner.createdir.AbstractStrategy

`CREATE_DIR_PREFIX, CREATE_DIR_SUFFIX, mImpl, mJobPrefix, mLogger, mSiteStore, mUseMkdir`

### Fields inherited from interface edu.isi.pegasus.planner.refiner.createdir.Strategy

`VERSION`

### Constructor Summary

Constructors
Constructor and Description
`Minimal()`

### Method Summary

All Methods Instance Methods Concrete Methods
`ADag` `addCreateDirectoryNodes(ADag dag)` Modifies the workflow to add create directory nodes.
`ADag` `addCreateDirectoryNodes(ADag workflow, java.util.Set<java.lang.String> sites)` Adds create dir nodes to the workflow.
`boolean` `addDependency(Job job)`
`private java.lang.String` `getAssociatedCreateDirSite(Job job)` Returns the associated site that job is dependant on.
`void` `initialize(PegasusBag bag, Implementation impl)` Intializes the class.

### Methods inherited from class edu.isi.pegasus.planner.refiner.createdir.AbstractStrategy

`getCreateDirJobName, getCreateDirSites`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Minimal

    public Minimal()

### Method Detail

#### initialize

    public void initialize(PegasusBag bag,
                           Implementation impl)

Intializes the class.

Specified by:
  `initialize` in interface `Strategy`
Overrides:
  `initialize` in class `AbstractStrategy`
Parameters:
  `bag` - bag of initialization objects
  `impl` - the implementation instance that creates create dir job

#### 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)