Class AbstractRefiner

  • All Implemented Interfaces:
    Refiner, Refiner
    Direct Known Subclasses:
    MultipleFTPerXFERJobRefiner, SingleFTPerXFERJobRefiner

    public abstract class AbstractRefiner
    extends java.lang.Object
    implements Refiner
    An abstract implementation that implements some of the common functions in the Refiner Interface and member variables that are required by all the refiners.
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Field Detail

      • mTXStageInImplementation

        protected Implementation mTXStageInImplementation
        The stage-in transfer implementation that the refiner requires.
      • mTXSymbolicLinkImplementation

        protected Implementation mTXSymbolicLinkImplementation
        The stage-in symbolic link transfer implementation that refiner requires.
      • mTXInterImplementation

        protected Implementation mTXInterImplementation
        The inter transfer implementation that the refiner requires.
      • mTXStageOutImplementation

        protected Implementation mTXStageOutImplementation
        The stage-out transfer implementation that the refiner requires.
      • mDAG

        protected ADag mDAG
        The ADag object associated with the Dag. This is the object to which the transfer nodes are added. This object is initialised in the TransferEngine.
      • mProps

        protected PegasusProperties mProps
        The handle to the properties object holding the properties relevant to Pegasus.
      • mPOptions

        protected PlannerOptions mPOptions
        The options passed to the planner at runtime.
      • mLogger

        protected LogManager mLogger
        The logging object which is used to log all the messages.
      • mTPT

        protected TPT mTPT
        The handle to the Third Party State machinery.
      • mRemoteTransfers

        protected RemoteTransfer mRemoteTransfers
        The handle to the Remote Transfers State machinery.
      • mXMLStore

        protected XMLProducer mXMLStore
        The XML Producer object that records the actions.
    • Constructor Detail

      • AbstractRefiner

        public AbstractRefiner​(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

      • getWorkflow

        public ADag getWorkflow()
        Returns a reference to the workflow that is being refined by the refiner.
        Specified by:
        getWorkflow in interface Refiner
        Returns:
        ADAG object.
      • addStageInXFERNodes

        public void addStageInXFERNodes​(Job job,
                                        java.util.Collection<FileTransfer> files,
                                        java.util.Collection<FileTransfer> symlinkFiles)
        Default behaviour to preserve backward compatibility when the stage in and symbolic link jobs were not separated. The symlink transfer files are added back into the files collection and passed onto legacy implementations. Refiners that want to distinguish between symlink and stagein jobs should over ride this method.
        Specified by:
        addStageInXFERNodes in interface Refiner
        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,
                                        java.util.Collection<FileTransfer> files)
        Default behaviour to preserve backward compatibility when the stage in and symbolic link jobs were not separated.
        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.
      • getXMLProducer

        public XMLProducer getXMLProducer()
        Returns a reference to the XMLProducer, that generates the XML fragment capturing the actions of the refiner. This is used for provenace purposes.
        Specified by:
        getXMLProducer in interface Refiner
        Returns:
        XMLProducer
      • refinerPreferenceForTransferJobLocation

        public boolean refinerPreferenceForTransferJobLocation()
        Boolean indicating whether the Transfer Refiner has a preference for where a transfer job is run. By default, Refiners dont advertise any preference as to where transfer jobs run.
        Specified by:
        refinerPreferenceForTransferJobLocation in interface Refiner
        Returns:
        false
      • refinerPreferenceForLocalTransferJobs

        public boolean refinerPreferenceForLocalTransferJobs​(int type)
        Boolean indicating Refiner preference for transfer jobs to run locally. This method should be called only if refinerPreferenceForTransferJobLocation is true for a refiner.
        Specified by:
        refinerPreferenceForLocalTransferJobs in interface Refiner
        Parameters:
        type - the type of transfer job for which the URL is being constructed. Should be one of the following: stage-in stage-out inter-pool transfer
        Returns:
        boolean refiner preference for transfer job to run locally or not.
      • runTransferRemotely

        public boolean runTransferRemotely​(java.lang.String site,
                                           int type)
        Returns whether a Site prefers transfers to be run on it i.e remote transfers enabled.
        Specified by:
        runTransferRemotely in interface Refiner
        Parameters:
        site - the name of the site.
        type - the type of transfer job for which the URL is being constructed. Should be one of the following: stage-in stage-out inter-pool transfer
        Returns:
        true if site is setup for remote transfers
        See Also:
        Job.STAGE_IN_JOB, Job.INTER_POOL_JOB, Job.STAGE_OUT_JOB
      • isSiteThirdParty

        public boolean isSiteThirdParty​(java.lang.String site,
                                        int type)
        Returns whether a Site is third party enabled or not.
        Specified by:
        isSiteThirdParty in interface Refiner
        Parameters:
        site - the name of the site.
        type - the type of transfer job for which the URL is being constructed. Should be one of the following: stage-in stage-out inter-pool transfer
        Returns:
        true pool is third party enabled false pool is not third party enabled.
        Throws:
        java.lang.IllegalArgumentException
        See Also:
        Job.STAGE_IN_JOB, Job.INTER_POOL_JOB, Job.STAGE_OUT_JOB
      • runTPTOnRemoteSite

        public boolean runTPTOnRemoteSite​(java.lang.String site,
                                          int type)
        Returns whether the third party transfers for a particular site are to be run on the remote site or the submit host.
        Specified by:
        runTPTOnRemoteSite in interface Refiner
        Parameters:
        site - the name of the site.
        type - the type of transfer job for which the URL is being constructed. Should be one of the following: stage-in stage-out inter-pool transfer
        Returns:
        true if the transfers are to be run on remote site, else false.
        See Also:
        Job.STAGE_IN_JOB, Job.INTER_POOL_JOB, Job.STAGE_OUT_JOB
      • logConfigMessages

        protected void logConfigMessages()
        Logs configuration messages regarding the type of implementations loaded for various type of transfer node creations.