edu.isi.pegasus.planner.partitioner
Class PartitionAndPlan

java.lang.Object
  extended by edu.isi.pegasus.planner.partitioner.PartitionAndPlan

public class PartitionAndPlan
extends Object

The class that triggers the partition and plan structure in pegasus.

Version:
$Revision$
Author:
Karan Vahi

Field Summary
private  PegasusBag mBag
          Bag of Pegasus objects
private  LogManager mLogger
          Handle to the logging manager.
private  NumberFormat mNumFormatter
          The number formatter to format the run submit dir entries.
private  PlannerOptions mPegasusPlanOptions
          The object containing all the options passed to the Concrete Planner.
private  PegasusProperties mProps
          The handle to Pegasus Properties.
private  String mUser
          The username of the user running the program.
 
Constructor Summary
PartitionAndPlan()
          The default constructor.
 
Method Summary
protected  String createSubmitDirectory(ADag dag, String dir, String user, String vogroup, boolean timestampBased)
          Creates the submit directory for the workflow.
protected  String createSubmitDirectory(String label, String dir, String user, String vogroup, boolean timestampBased)
          Creates the submit directory for the workflow.
protected  boolean createSymbolicLink(String source, String destination)
          This method generates a symlink between two files
 Collection<File> doPartitionAndPlan(PegasusProperties properties, PlannerOptions options)
          Partitions and plans the workflow.
 Collection<File> doPartitionAndPlan(String arguments)
          This function is passed command line arguments.
 void initialize(PegasusBag bag)
          Initializes the class.
protected static void sanityCheck(File dir)
          Checks the destination location for existence, if it can be created, if it is writable etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mUser

private String mUser
The username of the user running the program.


mNumFormatter

private NumberFormat mNumFormatter
The number formatter to format the run submit dir entries.


mPegasusPlanOptions

private PlannerOptions mPegasusPlanOptions
The object containing all the options passed to the Concrete Planner.


mProps

private PegasusProperties mProps
The handle to Pegasus Properties.


mLogger

private LogManager mLogger
Handle to the logging manager.


mBag

private PegasusBag mBag
Bag of Pegasus objects

Constructor Detail

PartitionAndPlan

public PartitionAndPlan()
The default constructor.

Method Detail

initialize

public void initialize(PegasusBag bag)
Initializes the class.

Parameters:
bag - the bag of objects required for initialization

doPartitionAndPlan

public Collection<File> doPartitionAndPlan(String arguments)
This function is passed command line arguments. In this function you generate the valid options and parse the options specified at run time.

Parameters:
arguments - the arguments passed at runtime
Returns:
the Collection of File objects for the files written out.

doPartitionAndPlan

public Collection<File> doPartitionAndPlan(PegasusProperties properties,
                                           PlannerOptions options)
Partitions and plans the workflow. First step of merging DAGMan and Condor

Parameters:
properties - the properties passed to the planner.
options - the options passed to the planner.
Returns:
the Collection of File objects for the files written out.

createSubmitDirectory

protected String createSubmitDirectory(ADag dag,
                                       String dir,
                                       String user,
                                       String vogroup,
                                       boolean timestampBased)
                                throws IOException
Creates the submit directory for the workflow. This is not thread safe.

Parameters:
dag - the workflow being worked upon.
dir - the base directory specified by the user.
user - the username of the user.
vogroup - the vogroup to which the user belongs to.
timestampBased - boolean indicating whether to have a timestamp based dir or not
Returns:
the directory name created relative to the base directory passed as input.
Throws:
IOException - in case of unable to create submit directory.

createSubmitDirectory

protected String createSubmitDirectory(String label,
                                       String dir,
                                       String user,
                                       String vogroup,
                                       boolean timestampBased)
                                throws IOException
Creates the submit directory for the workflow. This is not thread safe.

Parameters:
label - the label of the workflow
dir - the base directory specified by the user.
user - the username of the user.
vogroup - the vogroup to which the user belongs to.
timestampBased - boolean indicating whether to have a timestamp based dir or not
Returns:
the directory name created relative to the base directory passed as input.
Throws:
IOException - in case of unable to create submit directory.

sanityCheck

protected static void sanityCheck(File dir)
                           throws IOException
Checks the destination location for existence, if it can be created, if it is writable etc.

Parameters:
dir - is the new base directory to optionally create.
Throws:
IOException - in case of error while writing out files.

createSymbolicLink

protected boolean createSymbolicLink(String source,
                                     String destination)
This method generates a symlink between two files

Parameters:
source - the file that has to be symlinked
destination - the destination of the symlink
Returns:
boolean indicating if creation of symlink was successful or not


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