public class Restricted extends Default
A good site for a compute site X, is a preferred site from which replicas should be staged to site X. If there are more than one good sites having a particular replica, then a random siteis selected amongst these preferred sites.
A bad site for a compute site X, is a site from which replica's should not be staged. The reason of not accessing replica from a bad site can vary from the link being down, to the user not having permissions on that site's data.
The good | bad sites are specified by the properties pegasus.selector.replica.*.prefer.stagein.sites| pegasus.selector.replica.*.ignore.stagein.sites, where the * in the property name denotes the name of the compute site. A * in the property key is taken to mean all sites.
The pegasus.selector.replica.*.prefer.stagein.sites property takes precedence over pegasus.selector.replica.*.ignore.stagein.sites property i.e. if for a site X, a site Y is specified both in the ignored and the preferred set, then site Y is taken to mean as only a preferred site for a site X.
In order to use the replica selector implemented by this class,
- the property pegasus.selector.replica.selector must be set to value Restricted.
Modifier and Type | Field and Description |
---|---|
private static String |
mDescription
A short description of the replica selector.
|
private Set |
mGlobalIgnoredSites
The Set of ignored sites, that are ignored for selecting replicas for all
sites.
|
private Set |
mGlobalPreferredSites
The set of preferred sites, that are preferred stagein sites for all sites.
|
private Map |
mIgnoredSitesMap
A Map indexed by site handles, that contains a set of site handles.
|
private Map |
mPreferredSitesMap
A Map indexed by site handles, that contains a set of site handles.
|
private static String |
PROPERTY_IGNORE_SUFFIX
The property suffix for determining the ignored sites for a site x.
|
private static String |
PROPERTY_PREFER_SUFFIX
The property suffix for determining the preferred sites for a site x.
|
private static String |
PROPERTY_PREFIX
The property prefix for all properties used by this selector.
|
LOCAL_SITE_HANDLE, PRIORITY_KEY, VERSION
Constructor and Description |
---|
Restricted(edu.isi.pegasus.planner.common.PegasusProperties properties)
The overloaded constructor, that is called by load method.
|
Modifier and Type | Method and Description |
---|---|
String |
description()
Returns a short description of the replica selector.
|
protected String |
getProperty(String site,
String suffix)
Returns the name of the property, for a particular site X.
|
private Set |
getSitesSet(String value)
Returns a set of third party sites.
|
protected boolean |
globallyIgnored(String site)
Returns a boolean indicating whether a site is to be ignored as a replica
source for all compute sites.
|
protected boolean |
globallyPreferred(String site)
Returns a boolean indicating whether a site is a preferred replica source
for all compute sites.
|
protected boolean |
ignore(String source,
String destination)
Returns a boolean indicating whether a source site is to be ignored for
staging to a destination site
|
private void |
populateSiteMaps(String site)
Builds up the set of preferred and ignored sites for a site.
|
protected boolean |
prefer(String source,
String destination)
Returns a boolean indicating whether a source site is to be preffered for
staging to a destination site
|
edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry |
selectReplica(edu.isi.pegasus.planner.classes.ReplicaLocation rl,
String preferredSite,
boolean allowLocalFileURLs)
This chooses a location amongst all the locations returned by the replica
location service.
|
removeFileURL, removeFileURL, selectAndOrderReplicas
private static final String mDescription
private static final String PROPERTY_PREFIX
private static final String PROPERTY_PREFER_SUFFIX
private static final String PROPERTY_IGNORE_SUFFIX
private Map mPreferredSitesMap
private Set mGlobalPreferredSites
private Map mIgnoredSitesMap
private Set mGlobalIgnoredSites
public Restricted(edu.isi.pegasus.planner.common.PegasusProperties properties)
properties
- the PegasusProperties
object containing all
the properties required by Pegasus.public edu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntry selectReplica(edu.isi.pegasus.planner.classes.ReplicaLocation rl, String preferredSite, boolean allowLocalFileURLs)
selectReplica
in interface ReplicaSelector
selectReplica
in class Default
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.ReplicaCatalogEntry
corresponding to the location selected.org.griphyn.cPlanner.classes.ReplicaLocation
public String description()
description
in interface ReplicaSelector
description
in class Default
protected boolean prefer(String source, String destination)
source
- the source site.destination
- the destination site.protected boolean ignore(String source, String destination)
source
- the source site.destination
- the destination site.protected boolean globallyPreferred(String site)
site
- the site to test for.protected boolean globallyIgnored(String site)
site
- the site to test for.protected String getProperty(String site, String suffix)
site
- the site X.suffix
- the property suffix to be applied.private void populateSiteMaps(String site)
site
- the site for which to identify the preferred and ignored
sites.