Class Local

  • All Implemented Interfaces:
    ReplicaSelector

    public class Local
    extends java.lang.Object
    implements ReplicaSelector
    This replica selector only prefers replicas from the local host and that start with a file: URL scheme. It is useful, when you want to stagin files to a remote site from your submit host using the Condor file transfer mechanism.

    In order to use the replica selector implemented by this class,

            - the property pegasus.selector.replica must be set to value Local
     
    Version:
    $Revision$
    Author:
    Karan Vahi
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String mDescription
      A short description of the replica selector.
      protected edu.isi.pegasus.common.logging.LogManager mLogger
      The handle to the logging object that is used to log the various debug messages.
      protected edu.isi.pegasus.planner.common.PegasusProperties mProps
      The properties object containing the properties passed to the planner.
      static java.lang.String SANITY_CHECK_ERROR_MESSAGE_PREFIX
      Sanity Check Error Message.
    • Constructor Summary

      Constructors 
      Constructor Description
      Local​(edu.isi.pegasus.planner.common.PegasusProperties properties)
      The overloaded constructor, that is called by load method.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String description()
      Returns a short description of the replica selector.
      edu.isi.pegasus.planner.classes.ReplicaLocation selectAndOrderReplicas​(edu.isi.pegasus.planner.classes.ReplicaLocation rl, java.lang.String preferredSite, boolean allowLocalFileURLs)
      This chooses a location amongst all the locations returned by the Replica Mechanism.
      edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry selectReplica​(edu.isi.pegasus.planner.classes.ReplicaLocation rl, java.lang.String preferredSite, boolean allowLocalFileURLs)
      Selects a random replica from all the replica's that have their site handle set to local and the pfn's start with a file url scheme.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mDescription

        private static final java.lang.String mDescription
        A short description of the replica selector.
        See Also:
        Constant Field Values
      • SANITY_CHECK_ERROR_MESSAGE_PREFIX

        public static final java.lang.String SANITY_CHECK_ERROR_MESSAGE_PREFIX
        Sanity Check Error Message.
        See Also:
        Constant Field Values
      • mLogger

        protected edu.isi.pegasus.common.logging.LogManager mLogger
        The handle to the logging object that is used to log the various debug messages.
      • mProps

        protected edu.isi.pegasus.planner.common.PegasusProperties mProps
        The properties object containing the properties passed to the planner.
    • Constructor Detail

      • Local

        public Local​(edu.isi.pegasus.planner.common.PegasusProperties properties)
        The overloaded constructor, that is called by load method.
        Parameters:
        properties - the PegasusProperties object containing all the properties required by Pegasus.
    • Method Detail

      • selectReplica

        public edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry selectReplica​(edu.isi.pegasus.planner.classes.ReplicaLocation rl,
                                                                                         java.lang.String preferredSite,
                                                                                         boolean allowLocalFileURLs)
        Selects a random replica from all the replica's that have their site handle set to local and the pfn's start with a file url scheme.
        Specified by:
        selectReplica in interface ReplicaSelector
        Parameters:
        rl - the ReplicaLocation object containing all the pfn's associated with that LFN.
        preferredSite - the preffered site for picking up the replicas.
        allowLocalFileURLs - indicates whether Replica Selector can select a replica on the local site / submit host.
        Returns:
        ReplicaCatalogEntry corresponding to the location selected.
        See Also:
        ReplicaLocation
      • selectAndOrderReplicas

        public edu.isi.pegasus.planner.classes.ReplicaLocation selectAndOrderReplicas​(edu.isi.pegasus.planner.classes.ReplicaLocation rl,
                                                                                      java.lang.String preferredSite,
                                                                                      boolean allowLocalFileURLs)
        This chooses a location amongst all the locations returned by the Replica Mechanism. If a location is found with re/pool attribute same as the preference pool, it is taken. This returns all the locations which match to the preference pool. This function is called to determine if a file does exist on the output pool or not beforehand. We need all the location to ensure that we are able to make a match if it so exists. Else a random location is selected and returned
        Specified by:
        selectAndOrderReplicas in interface ReplicaSelector
        Parameters:
        rl - the ReplicaLocation object containing all the pfn's associated with that LFN.
        preferredSite - the preffered site for picking up the replicas.
        allowLocalFileURLs - indicates whether Replica Selector can select a replica on the local site / submit host.
        Returns:
        ReplicaLocation corresponding to the replicas selected.
        See Also:
        ReplicaLocation
      • description

        public java.lang.String description()
        Returns a short description of the replica selector.
        Specified by:
        description in interface ReplicaSelector
        Returns:
        string corresponding to the description.