|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.isi.pegasus.planner.selector.replica.Default
edu.isi.pegasus.planner.selector.replica.Restricted
public class Restricted
A replica selector, that allows the user to specify good sites and bad sites for staging in data to a compute site.
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.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class edu.isi.pegasus.planner.selector.replica.Default |
|---|
FILE_URL_SCHEME, mLogger, mProps |
| Fields inherited from interface edu.isi.pegasus.planner.selector.ReplicaSelector |
|---|
LOCAL_SITE_HANDLE, VERSION |
| Constructor Summary | |
|---|---|
Restricted(PegasusProperties properties)
The overloaded constructor, that is called by load method. |
|
| Method Summary | |
|---|---|
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 |
ReplicaCatalogEntry |
selectReplica(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, selectReplicas |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public Restricted(PegasusProperties properties)
properties - the PegasusProperties object containing all
the properties required by Pegasus.| Method Detail |
|---|
public ReplicaCatalogEntry selectReplica(ReplicaLocation rl,
String preferredSite,
boolean allowLocalFileURLs)
selectReplica in interface ReplicaSelectorselectReplica in class Defaultrl - 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.ReplicaLocationpublic String description()
description in interface ReplicaSelectordescription 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.private Set getSitesSet(String value)
value - the comma separated list in the properties file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||