Class Restricted
- All Implemented Interfaces:
ReplicaSelector
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.
- Version:
- $Revision$
- Author:
- Karan Vahi, Gaurang Mehta
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringA short description of the replica selector.private SetThe Set of ignored sites, that are ignored for selecting replicas for all sites.private SetThe set of preferred sites, that are preferred stagein sites for all sites.private MapA Map indexed by site handles, that contains a set of site handles.private MapA Map indexed by site handles, that contains a set of site handles.private static final StringThe property suffix for determining the ignored sites for a site x.private static final StringThe property suffix for determining the preferred sites for a site x.private static final StringThe property prefix for all properties used by this selector.Fields inherited from interface edu.isi.pegasus.planner.selector.ReplicaSelector
LOCAL_SITE_HANDLE, PRIORITY_KEY, VERSION -
Constructor Summary
ConstructorsConstructorDescriptionRestricted(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.protected StringgetProperty(String site, String suffix) Returns the name of the property, for a particular site X.private SetgetSitesSet(String value) Returns a set of third party sites.protected booleangloballyIgnored(String site) Returns a boolean indicating whether a site is to be ignored as a replica source for all compute sites.protected booleangloballyPreferred(String site) Returns a boolean indicating whether a site is a preferred replica source for all compute sites.protected booleanReturns a boolean indicating whether a source site is to be ignored for staging to a destination siteprivate voidpopulateSiteMaps(String site) Builds up the set of preferred and ignored sites for a site.protected booleanReturns a boolean indicating whether a source site is to be preffered for staging to a destination siteedu.isi.pegasus.planner.catalog.replica.ReplicaCatalogEntryselectReplica(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.Methods inherited from class edu.isi.pegasus.planner.selector.replica.Default
removeFileURL, removeFileURL, selectAndOrderReplicas, warnForFileURL
-
Field Details
-
mDescription
A short description of the replica selector.- See Also:
-
PROPERTY_PREFIX
The property prefix for all properties used by this selector.- See Also:
-
PROPERTY_PREFER_SUFFIX
The property suffix for determining the preferred sites for a site x.- See Also:
-
PROPERTY_IGNORE_SUFFIX
The property suffix for determining the ignored sites for a site x.- See Also:
-
mPreferredSitesMap
A Map indexed by site handles, that contains a set of site handles. The sites in the set are the sites from which to prefer data transfers to the site referred to by key of the map. -
mGlobalPreferredSites
The set of preferred sites, that are preferred stagein sites for all sites. Referred to by "pegasus.selector.replica.*.prefer.sites" property. -
mIgnoredSitesMap
A Map indexed by site handles, that contains a set of site handles. The sites in the set are the sites from which to ignore data transfers to the site referred to by key of the map. -
mGlobalIgnoredSites
The Set of ignored sites, that are ignored for selecting replicas for all sites. Referred to by "pegasus.selector.replica.*.default.sites" property.
-
-
Constructor Details
-
Restricted
public Restricted(edu.isi.pegasus.planner.common.PegasusProperties properties) The overloaded constructor, that is called by load method.- Parameters:
properties- thePegasusPropertiesobject 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 rl, 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:
selectReplicain interfaceReplicaSelector- Overrides:
selectReplicain classDefault- Parameters:
rl- theReplicaLocationobject 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:
ReplicaCatalogEntrycorresponding to the location selected.- See Also:
-
ReplicaLocation
-
description
Returns a short description of the replica selector.- Specified by:
descriptionin interfaceReplicaSelector- Overrides:
descriptionin classDefault- Returns:
- string corresponding to the description.
-
prefer
Returns a boolean indicating whether a source site is to be preffered for staging to a destination site- Parameters:
source- the source site.destination- the destination site.- Returns:
- true if source is a preferred site for staging to destination, else false.
-
ignore
Returns a boolean indicating whether a source site is to be ignored for staging to a destination site- Parameters:
source- the source site.destination- the destination site.- Returns:
- true if source is tp be ignored while staging to destination, else false.
-
globallyPreferred
Returns a boolean indicating whether a site is a preferred replica source for all compute sites.- Parameters:
site- the site to test for.- Returns:
- boolean.
-
globallyIgnored
Returns a boolean indicating whether a site is to be ignored as a replica source for all compute sites.- Parameters:
site- the site to test for.- Returns:
- boolean.
-
getProperty
Returns the name of the property, for a particular site X. The value of the property contains a comma separated list of site handles that are to be ignored|preferred while selecting replicas to stage to the site X.- Parameters:
site- the site X.suffix- the property suffix to be applied.- Returns:
- the name of the property.
-
populateSiteMaps
Builds up the set of preferred and ignored sites for a site.- Parameters:
site- the site for which to identify the preferred and ignored sites.
-
getSitesSet
Returns a set of third party sites. An empty set is returned if value is null.- Parameters:
value- the comma separated list in the properties file.- Returns:
- Set containing the names of the pools.
-