org.griphyn.cPlanner.engine
Class CreateDirectory

java.lang.Object
  extended by org.griphyn.cPlanner.engine.Engine
      extended by org.griphyn.cPlanner.engine.CreateDirectory
Direct Known Subclasses:
HourGlass, Tentacles

public abstract class CreateDirectory
extends Engine

This common interface that identifies the basic functions that need to be implemented to introduce random directories in which the jobs are executed on the remote execution pools. The implementing classes are invoked when the user gives the --randomdir option. The implementing classes determine where in the graph the nodes creating the random directories are placed and their dependencies with the rest of the nodes in the graph.

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

Field Summary
static String CREATE_DIR_SUFFIX
          Constant suffix for the names of the create directory nodes.
static String DERIVATION_NAME
          The logical name of the transformation that creates directories on the remote execution pools.
static String DERIVATION_NAMESPACE
          The derivation namespace for the create dir jobs.
static String DERIVATION_VERSION
          The version number for the derivations for create dir jobs.
protected  ADag mCurrentDag
          It is a reference to the Concrete Dag so far.
protected  LogManager mLogger
          The handle to the logging object, that is used to log the messages.
protected  UserOptions mUserOpts
          The handle to the options specified by the user at runtime.
static String PACKAGE_NAME
          The name of the package in which all the implementing classes are.
static String TRANSFORMATION_NAME
          The logical name of the transformation that creates directories on the remote execution pools.
static String TRANSFORMATION_NAMESPACE
          The transformation namespace for the create dir jobs.
static String TRANSFORMATION_VERSION
          The version number for the derivations for create dir jobs.
 
Fields inherited from class org.griphyn.cPlanner.engine.Engine
mLogMsg, mOutputPool, mPoolClass, mPoolFile, mPoolHandle, mPOptions, mProps, mRLIUrl, mTCFile, mTCHandle, mTCMode, REGISTRATION_UNIVERSE, TRANSFER_UNIVERSE
 
Constructor Summary
protected CreateDirectory(ADag concDag, PegasusProperties properties)
          Default constructor.
protected CreateDirectory(PegasusProperties properties)
          A pratically nothing constructor !
 
Method Summary
abstract  void addCreateDirectoryNodes()
          It modifies the concrete dag passed in the constructor and adds the create random directory nodes to it at the root level.
private  TransformationCatalogEntry defaultTCEntry(String site)
          Returns a default TC entry to be used in case entry is not found in the transformation catalog.
static String getCompleteTranformationName()
          A convenience method to return the complete transformation name being used to construct jobs in this class.
protected  String getCreateDirJobName(String pool)
          It returns the name of the create directory job, that is to be assigned.
protected  Set getCreateDirSites()
          Retrieves the sites for which the create dir jobs need to be created.
static CreateDirectory loadCreateDirectoryInstance(String className, ADag concDag, PegasusProperties properties)
          Loads the implementing class corresponding to the mode specified by the user at runtime.
protected  SubInfo makeCreateDirJob(String execPool, String jobName)
          It creates a make directory job that creates a directory on the remote pool using the perl executable that Gaurang wrote.
 
Methods inherited from class org.griphyn.cPlanner.engine.Engine
addVector, appendArrayList, loadProperties, printVector, stringInList, stringInPegVector, stringInVector, vectorToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATE_DIR_SUFFIX

public static final String CREATE_DIR_SUFFIX
Constant suffix for the names of the create directory nodes.

See Also:
Constant Field Values

PACKAGE_NAME

public static final String PACKAGE_NAME
The name of the package in which all the implementing classes are.

See Also:
Constant Field Values

TRANSFORMATION_NAMESPACE

public static final String TRANSFORMATION_NAMESPACE
The transformation namespace for the create dir jobs.

See Also:
Constant Field Values

TRANSFORMATION_NAME

public static final String TRANSFORMATION_NAME
The logical name of the transformation that creates directories on the remote execution pools.

See Also:
Constant Field Values

TRANSFORMATION_VERSION

public static final String TRANSFORMATION_VERSION
The version number for the derivations for create dir jobs.


DERIVATION_NAMESPACE

public static final String DERIVATION_NAMESPACE
The derivation namespace for the create dir jobs.

See Also:
Constant Field Values

DERIVATION_NAME

public static final String DERIVATION_NAME
The logical name of the transformation that creates directories on the remote execution pools.

See Also:
Constant Field Values

DERIVATION_VERSION

public static final String DERIVATION_VERSION
The version number for the derivations for create dir jobs.

See Also:
Constant Field Values

mCurrentDag

protected ADag mCurrentDag
It is a reference to the Concrete Dag so far.


mUserOpts

protected UserOptions mUserOpts
The handle to the options specified by the user at runtime. The name of the random directory is picked up from here.


mLogger

protected LogManager mLogger
The handle to the logging object, that is used to log the messages.

Constructor Detail

CreateDirectory

protected CreateDirectory(PegasusProperties properties)
A pratically nothing constructor !

Parameters:
properties - the PegasusProperties to be used.

CreateDirectory

protected CreateDirectory(ADag concDag,
                          PegasusProperties properties)
Default constructor.

Parameters:
concDag - The concrete dag so far.
properties - the PegasusProperties to be used.
Method Detail

getCompleteTranformationName

public static String getCompleteTranformationName()
A convenience method to return the complete transformation name being used to construct jobs in this class.

Returns:
the complete transformation name

loadCreateDirectoryInstance

public static CreateDirectory loadCreateDirectoryInstance(String className,
                                                          ADag concDag,
                                                          PegasusProperties properties)
                                                   throws FactoryException
Loads the implementing class corresponding to the mode specified by the user at runtime.

Parameters:
className - The name of the class that implements the mode. It is the name of the class, not the complete name with package. That is added by itself.
concDag - the workflow.
properties - the PegasusProperties to be used.
Returns:
instance of a CreateDirecctory implementation
Throws:
FactoryException - that nests any error that might occur during the instantiation of the implementation.

addCreateDirectoryNodes

public abstract void addCreateDirectoryNodes()
It modifies the concrete dag passed in the constructor and adds the create random directory nodes to it at the root level. These directory nodes have a common child that acts as a concatenating job and ensures that Condor does not start staging in the data before the directories have been added. The root nodes in the unmodified dag are now chidren of this concatenating dummy job.


getCreateDirJobName

protected String getCreateDirJobName(String pool)
It returns the name of the create directory job, that is to be assigned. The name takes into account the workflow name while constructing it, as that is thing that can guarentee uniqueness of name in case of deferred planning.

Parameters:
pool - the execution pool for which the create directory job is responsible.
Returns:
String corresponding to the name of the job.

getCreateDirSites

protected Set getCreateDirSites()
Retrieves the sites for which the create dir jobs need to be created. It returns all the sites where the compute jobs have been scheduled.

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

makeCreateDirJob

protected SubInfo makeCreateDirJob(String execPool,
                                   String jobName)
It creates a make directory job that creates a directory on the remote pool using the perl executable that Gaurang wrote. It access mkdir underneath. It gets the name of the random directory from the Pool handle. This method does not update the internal graph structure of the workflow to add the node. That is done separately.

Parameters:
execPool - the execution pool for which the create dir job is to be created.
jobName - the name that is to be assigned to the job.
Returns:
create dir job.

defaultTCEntry

private TransformationCatalogEntry defaultTCEntry(String site)
Returns a default TC entry to be used in case entry is not found in the transformation catalog.

Parameters:
site - the site for which the default entry is required.
Returns:
the default entry.


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