edu.isi.pegasus.planner.transfer.refiner
Class Default

java.lang.Object
  extended by edu.isi.pegasus.planner.transfer.AbstractRefiner
      extended by edu.isi.pegasus.planner.transfer.MultipleFTPerXFERJobRefiner
          extended by edu.isi.pegasus.planner.transfer.refiner.Default
All Implemented Interfaces:
Refiner
Direct Known Subclasses:
Bundle, Chain

public class Default
extends MultipleFTPerXFERJobRefiner

The default transfer refiner, that implements the multiple refiner. For each compute job if required it creates the following - a single stagein transfer job - a single stageout transfer job - a single interpool transfer job In addition this implementation prevents file clobbering while staging in data to a remote site, that is shared amongst jobs.

Version:
$Revision: 2764 $
Author:
Karan Vahi

Field Summary
static String DESCRIPTION
          A short description of the transfer refinement.
protected  Boolean mCreateRegistrationJobs
          Boolean indicating whether to create registration jobs or not.
protected  Map mFileTable
          A Map containing information about which logical file has been transferred to which site and the name of the stagein transfer node that is transferring the file from the location returned from the replica catalog.
protected  String mLogMsg
          The string holding the logging messages
protected  PPS mPPS
          The handle to the provenance store implementation.
 
Fields inherited from class edu.isi.pegasus.planner.transfer.AbstractRefiner
mDAG, mLogger, mPOptions, mProps, mRemoteTransfers, mTPT, mTXInterImplementation, mTXStageInImplementation, mTXStageOutImplementation, mTXSymbolicLinkImplementation, mXMLStore
 
Fields inherited from interface edu.isi.pegasus.planner.transfer.Refiner
INTER_POOL_PREFIX, LOCAL_PREFIX, REGISTER_PREFIX, REMOTE_PREFIX, STAGE_IN_PREFIX, STAGE_OUT_PREFIX
 
Fields inherited from interface edu.isi.pegasus.planner.refiner.Refiner
VERSION
 
Constructor Summary
Default(ADag dag, PegasusBag bag)
          The overloaded constructor.
 
Method Summary
 void addInterSiteTXNodes(Job job, Collection files, boolean localTransfer)
          Adds the inter pool transfer nodes that are required for transferring the output files of the parents to the jobs execution site.
 void addJob(Job job)
          Add a new job to the workflow being refined.
 void addRelation(String parent, String child)
          Adds a new relation to the workflow being refiner.
 void addRelation(String parent, String child, String site, boolean parentNew)
          Adds a new relation to the workflow.
 void addStageInXFERNodes(Job job, Collection<FileTransfer> files, Collection<FileTransfer> symlinkFiles)
          Adds the stage in transfer nodes which transfer the input files for a job, from the location returned from the replica catalog to the job's execution pool.
 void addStageInXFERNodes(Job job, Collection<FileTransfer> files, String prefix, Implementation implementation)
          Adds the stage in transfer nodes which transfer the input files for a job, from the location returned from the replica catalog to the job's execution pool.
 void addStageOutXFERNodes(Job job, Collection files, ReplicaCatalogBridge rcb, boolean localTransfer)
          Adds the stageout transfer nodes, that stage data to an output site specified by the user.
 void addStageOutXFERNodes(Job job, Collection files, ReplicaCatalogBridge rcb, boolean localTransfer, boolean deletedLeaf)
          Adds the stageout transfer nodes, that stage data to an output site specified by the user.
protected  void appendAttribute(StringBuffer xmlFeed, String key, String value)
          Appends an xml attribute to the xml feed.
protected  String constructFileKey(String lfn, String siteHandle)
          Constructs the key for an entry to the file table.
protected  Job createRegistrationJob(String regJobName, Job job, Collection files, ReplicaCatalogBridge rcb)
          Creates the registration jobs, which registers the materialized files on the output site in the Replica Catalog.
 void done()
          Signals that the traversal of the workflow is done.
 String getDescription()
          Returns a textual description of the transfer mode.
protected  void logRefinerAction(Job computeJob, Job txJob, Collection files, String type)
          Records the refiner action into the Provenace Store as a XML fragment.
 
Methods inherited from class edu.isi.pegasus.planner.transfer.MultipleFTPerXFERJobRefiner
loadImplementations
 
Methods inherited from class edu.isi.pegasus.planner.transfer.AbstractRefiner
addStageInXFERNodes, getWorkflow, getXMLProducer, isSiteThirdParty, logConfigMessages, refinerPreferenceForLocalTransferJobs, refinerPreferenceForTransferJobLocation, runTPTOnRemoteSite, runTransferRemotely
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCRIPTION

public static final String DESCRIPTION
A short description of the transfer refinement.

See Also:
Constant Field Values

mLogMsg

protected String mLogMsg
The string holding the logging messages


mFileTable

protected Map mFileTable
A Map containing information about which logical file has been transferred to which site and the name of the stagein transfer node that is transferring the file from the location returned from the replica catalog. The key for the hashmap is logicalfilename:sitehandle and the value would be the name of the transfer node.


mPPS

protected PPS mPPS
The handle to the provenance store implementation.


mCreateRegistrationJobs

protected Boolean mCreateRegistrationJobs
Boolean indicating whether to create registration jobs or not.

Constructor Detail

Default

public Default(ADag dag,
               PegasusBag bag)
The overloaded constructor.

Parameters:
dag - the workflow to which transfer nodes need to be added.
bag - the bag of initialization objects.
Method Detail

addStageInXFERNodes

public void addStageInXFERNodes(Job job,
                                Collection<FileTransfer> files,
                                Collection<FileTransfer> symlinkFiles)
Adds the stage in transfer nodes which transfer the input files for a job, from the location returned from the replica catalog to the job's execution pool.

Overrides:
addStageInXFERNodes in class AbstractRefiner
Parameters:
job - Job object corresponding to the node to which the files are to be transferred to.
files - Collection of FileTransfer objects containing the information about source and destURL's.
symlinkFiles - Collection of FileTransfer objects containing source and destination file url's for symbolic linking on compute site.

addStageInXFERNodes

public void addStageInXFERNodes(Job job,
                                Collection<FileTransfer> files,
                                String prefix,
                                Implementation implementation)
Adds the stage in transfer nodes which transfer the input files for a job, from the location returned from the replica catalog to the job's execution pool.

Parameters:
job - Job object corresponding to the node to which the files are to be transferred to.
files - Collection of FileTransfer objects containing the information about source and destURL's.
prefix - the prefix to be used while constructing the transfer jobname.
implementation - the transfer implementation to use

addInterSiteTXNodes

public void addInterSiteTXNodes(Job job,
                                Collection files,
                                boolean localTransfer)
Adds the inter pool transfer nodes that are required for transferring the output files of the parents to the jobs execution site.

Parameters:
job - Job object corresponding to the node to which the files are to be transferred to.
files - Collection of FileTransfer objects containing the information about source and destURL's.
localTransfer - boolean indicating that associated transfer job will run on local site.

addStageOutXFERNodes

public void addStageOutXFERNodes(Job job,
                                 Collection files,
                                 ReplicaCatalogBridge rcb,
                                 boolean localTransfer)
Adds the stageout transfer nodes, that stage data to an output site specified by the user.

Parameters:
job - Job object corresponding to the node to which the files are to be transferred to.
files - Collection of FileTransfer objects containing the information about source and destURL's.
rcb - bridge to the Replica Catalog. Used for creating registration nodes in the workflow.
localTransfer - boolean indicating that associated transfer job will run on local site.

addStageOutXFERNodes

public void addStageOutXFERNodes(Job job,
                                 Collection files,
                                 ReplicaCatalogBridge rcb,
                                 boolean localTransfer,
                                 boolean deletedLeaf)
Adds the stageout transfer nodes, that stage data to an output site specified by the user.

Parameters:
job - Job object corresponding to the node to which the files are to be transferred to.
files - Collection of FileTransfer objects containing the information about source and destURL's.
rcb - bridge to the Replica Catalog. Used for creating registration nodes in the workflow.
localTransfer - boolean indicating that associated transfer job will run on local site.
deletedLeaf - to specify whether the node is being added for a deleted node by the reduction engine or not. default: false

createRegistrationJob

protected Job createRegistrationJob(String regJobName,
                                    Job job,
                                    Collection files,
                                    ReplicaCatalogBridge rcb)
Creates the registration jobs, which registers the materialized files on the output site in the Replica Catalog.

Parameters:
regJobName - The name of the job which registers the files in the Replica Mechanism.
job - The job whose output files are to be registered in the Replica Mechanism.
files - Collection of FileTransfer objects containing the information about source and destURL's.
rcb - bridge to the Replica Catalog. Used for creating registration nodes in the workflow.
Returns:
the registration job.

done

public void done()
Signals that the traversal of the workflow is done. It signals to the Provenace Store, that refinement is complete.


addJob

public void addJob(Job job)
Add a new job to the workflow being refined.

Parameters:
job - the job to be added.

addRelation

public void addRelation(String parent,
                        String child)
Adds a new relation to the workflow being refiner.

Parameters:
parent - the jobname of the parent node of the edge.
child - the jobname of the child node of the edge.

addRelation

public void addRelation(String parent,
                        String child,
                        String site,
                        boolean parentNew)
Adds a new relation to the workflow. In the case when the parent is a transfer job that is added, the parentNew should be set only the first time a relation is added. For subsequent compute jobs that maybe dependant on this, it needs to be set to false.

Parameters:
parent - the jobname of the parent node of the edge.
child - the jobname of the child node of the edge.
site - the execution pool where the transfer node is to be run.
parentNew - the parent node being added, is the new transfer job and is being called for the first time.

getDescription

public String getDescription()
Returns a textual description of the transfer mode.

Returns:
a short textual description

logRefinerAction

protected void logRefinerAction(Job computeJob,
                                Job txJob,
                                Collection files,
                                String type)
Records the refiner action into the Provenace Store as a XML fragment.

Parameters:
computeJob - the compute job.
txJob - the associated transfer job.
files - list of FileTransfer objects containing file transfers.
type - the type of transfer job

appendAttribute

protected void appendAttribute(StringBuffer xmlFeed,
                               String key,
                               String value)
Appends an xml attribute to the xml feed.

Parameters:
xmlFeed - the xmlFeed to which xml is being written
key - the attribute key
value - the attribute value

constructFileKey

protected String constructFileKey(String lfn,
                                  String siteHandle)
Constructs the key for an entry to the file table. The key returned is lfn:siteHandle

Parameters:
lfn - the logical filename of the file that has to be transferred.
siteHandle - the name of the site to which the file is being transferred.
Returns:
the key for the entry to be made in the filetable.


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