Class Default
java.lang.Object
edu.isi.pegasus.planner.selector.replica.Default
- All Implemented Interfaces:
ReplicaSelector
- Direct Known Subclasses:
Regex
,Restricted
The default replica selector that is used if non is specified by the user. This gives preference
to a replica residing on the same site as the site, where it is required to be staged to. If
there is no such replica, then a random replica is selected.
In order to use the replica selector implemented by this class,
- the property pegasus.selector.replica must be set to value Default, or the property should be left undefined in the properties.
- Version:
- $Revision$
- Author:
- Karan Vahi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static String
A short description of the replica selector.protected edu.isi.pegasus.common.logging.LogManager
The handle to the logging object that is used to log the various debug messages.protected edu.isi.pegasus.planner.common.PegasusProperties
The properties object containing the properties passed to the planner.private static final String
private static final String
Fields inherited from interface edu.isi.pegasus.planner.selector.ReplicaSelector
LOCAL_SITE_HANDLE, PRIORITY_KEY, VERSION
-
Constructor Summary
ConstructorsConstructorDescriptionDefault
(edu.isi.pegasus.planner.common.PegasusProperties properties) The overloaded constructor, that is called by load method. -
Method Summary
Modifier and TypeMethodDescriptionReturns a short description of the replica selector.boolean
removeFileURL
(edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry rce, String preferredSite, boolean allowLocalFileURLs) A convenience function that determines whether we should be removing a file URL from replica selection or not.protected boolean
removeFileURL
(String pfn, String site, String preferredSite, boolean allowLocalFileURLs) A convenience function that determines whether we should be removing a file URL from replica selection or not.edu.isi.pegasus.planner.classes.ReplicaLocation
selectAndOrderReplicas
(edu.isi.pegasus.planner.classes.ReplicaLocation rl, String preferredSite, boolean allowLocalFileURLs) This orders all valid location amongst all the locations returned by the Replica Mechanism.edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry
selectReplica
(edu.isi.pegasus.planner.classes.ReplicaLocation candidates, String preferredSite, boolean allowLocalFileURLs) This chooses a location amongst all the locations returned by the replica location service.protected void
warnForFileURL
(edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry rce, String destinationSite, boolean allowLocalFileURLs) * Warn for file URL not being selected because of mismatch in site attributes
-
Field Details
-
mDescription
A short description of the replica selector. -
mLogger
protected edu.isi.pegasus.common.logging.LogManager mLoggerThe handle to the logging object that is used to log the various debug messages. -
mProps
protected edu.isi.pegasus.planner.common.PegasusProperties mPropsThe properties object containing the properties passed to the planner. -
FILE_URLS_PRIORITY_KEY
- See Also:
-
PREFERRED_SITE_PRIORITY_KEY
- See Also:
-
NON_PREFERRED_SITE_PRIORITY_KEY
- See Also:
-
-
Constructor Details
-
Default
public Default(edu.isi.pegasus.planner.common.PegasusProperties properties) The overloaded constructor, that is called by load method.- Parameters:
properties
- thePegasusProperties
object containing all the properties required by Pegasus.
-
-
Method Details
-
selectReplica
public edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry selectReplica(edu.isi.pegasus.planner.classes.ReplicaLocation candidates, String preferredSite, boolean allowLocalFileURLs) This chooses a location amongst all the locations returned by the replica location service. If a location is found with re attribute same as the preference pool, it is taken. Else a random location is selected and returned. If more than one location for the lfn is found at the preference pool, then also a random location amongst the ones at the preference pool is selected.- Specified by:
selectReplica
in interfaceReplicaSelector
- Parameters:
candidates
- theReplicaLocation
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, String preferredSite, boolean allowLocalFileURLs) This orders all valid location amongst all the locations returned by the Replica Mechanism. The following ordering mechanism is employed- valid file URL's - all URL's from preferred site - all other URL's
- Specified by:
selectAndOrderReplicas
in interfaceReplicaSelector
- Parameters:
rl
- theReplicaLocation
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
-
removeFileURL
public boolean removeFileURL(edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry rce, String preferredSite, boolean allowLocalFileURLs) A convenience function that determines whether we should be removing a file URL from replica selection or not. The file urls make sense only- if associated with the preference site or - if local File URL are allowed and rce is associated with local site
- Parameters:
rce
- the ReplicaCatalogEntry object.preferredSite
- the preferred site.allowLocalFileURLs
- indicates whether Replica Selector can select a replica on the local site / submit host.- Returns:
- boolean
-
removeFileURL
protected boolean removeFileURL(String pfn, String site, String preferredSite, boolean allowLocalFileURLs) A convenience function that determines whether we should be removing a file URL from replica selection or not. The file urls make sense only- if associated with the preference site or - if local File URL are allowed and rce is associated with local site
- Parameters:
pfn
- the file urlsite
- the site associated with the pfn.preferredSite
- the preferred site.allowLocalFileURLs
- indicates whether Replica Selector can select a replica on the local site / submit host.- Returns:
- boolean
-
description
Returns a short description of the replica selector.- Specified by:
description
in interfaceReplicaSelector
- Returns:
- string corresponding to the description.
-
warnForFileURL
protected void warnForFileURL(edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry rce, String destinationSite, boolean allowLocalFileURLs) * Warn for file URL not being selected because of mismatch in site attributes- Parameters:
rce
- ReplicaCatalogEntrydestinationSite
- destinationSiteallowLocalFileURLs
- boolean
-