public class SiteStore extends AbstractSiteData
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mDeepStorageStructure
A boolean indicating whether to have a deep directory structure for
the storage directory or not.
|
private PlannerOptions |
mPlannerOptions |
protected String |
mStorageDir
This contains the storage directory relative to the se mount point of the
pool.
|
private Map<String,SiteCatalogEntry> |
mStore
The internal map that maps a site catalog entry to the site handle.
|
private String |
mWorkDir
The work dir path from the properties.
|
static String |
SCHEMA_LOCATION
The "not-so-official" location URL of the DAX schema definition.
|
static String |
SCHEMA_NAMESPACE
The "official" namespace URI of the site catalog schema.
|
static String |
SCHEMA_VERSION
The version to report.
|
| Constructor and Description |
|---|
SiteStore()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
SiteCatalogEntry |
addEntry(SiteCatalogEntry entry)
Adds a site catalog entry to the store.
|
Object |
clone()
Returns the clone of the object.
|
boolean |
contains(String handle)
Returns boolean indicating whether the store has a SiteCatalogEntry
matching a handle.
|
Iterator<SiteCatalogEntry> |
entryIterator()
Returns an iterator to SiteCatalogEntry objects in the store.
|
String |
getEnvironmentVariable(String handle,
String variable)
Returns an environment variable associated with the site.
|
String |
getExternalStorageDirectory(String site)
Return the storage mount point for a particular pool.
|
String |
getExternalWorkDirectory(FileServer fs,
String siteHandle)
Return the work directory as seen externally (including external mount point)
|
String |
getExternalWorkDirectoryURL(String siteHandle)
Returns a URL to the work directory as seen externally ( including external
mount point ).
|
String |
getInternalWorkDirectory(Job job)
This determines the working directory on remote execution pool for a
particular job.
|
String |
getInternalWorkDirectory(Job job,
boolean onStagingSite)
This determines the working directory on remote execution pool or a staging
site for a particular job.
|
String |
getInternalWorkDirectory(String handle)
This determines the working directory on remote execution pool on the
basis of whether an absolute path is specified in the pegasus.dir.exec directory
or a relative path.
|
String |
getInternalWorkDirectory(String handle,
String path)
This determines the working directory on remote execution pool on the
basis of whether an absolute path is specified in the pegasus.dir.exec
directory or a relative path.
|
String |
getInternalWorkDirectory(String handle,
String path,
int jobClass)
This determines the working directory on remote execution pool on the
basis of whether an absolute path is specified in the pegasus.dir.exec directory
or a relative path.
|
String |
getPegasusHome(String handle)
Deprecated.
|
SysInfo |
getSysInfo(String handle)
Returns the
SysInfo for the site |
Map<String,SysInfo> |
getSysInfos(List<String> sites) |
String |
getVDSHome(String handle)
Deprecated.
|
VDSSysInfo |
getVDSSysInfo(String handle)
Returns the
VDSSysInfo for the site |
void |
initialize()
The intialize method.
|
Set<String> |
list()
Returns the list of sites, in the store.
|
SiteCatalogEntry |
lookup(String handle)
Returns SiteCatalogEntry matching a site handle.
|
boolean |
removeFileServer(String handle,
String url)
This is a soft state remove, that removes a file server from a particular
pool entry.
|
boolean |
removeGridGateway(String handle,
String contact)
This is a soft state remove, that removes a GridGateway from a particular
site.
|
void |
setForPlannerUse(PegasusProperties properties,
PlannerOptions options)
A setter method that is to be set to use getWorkDirectory functions, correctly.
|
void |
toXML(Writer writer,
String indent)
Writes out the contents of the replica store as XML document
|
void |
writeXMLHeader(Writer stream,
String indent)
Writes the header of the XML output.
|
toString, toXML, writeAttributepublic static final String SCHEMA_NAMESPACE
public static final String SCHEMA_LOCATION
public static final String SCHEMA_VERSION
private Map<String,SiteCatalogEntry> mStore
private String mWorkDir
private PlannerOptions mPlannerOptions
protected String mStorageDir
protected boolean mDeepStorageStructure
public void initialize()
public void setForPlannerUse(PegasusProperties properties, PlannerOptions options)
properties - the PegasusPropertiesoptions - the PlannerOptionspublic SiteCatalogEntry addEntry(SiteCatalogEntry entry)
entry - the site catalog entry.public Iterator<SiteCatalogEntry> entryIterator()
public SiteCatalogEntry lookup(String handle)
handle - the handle of the site to be looked up.public boolean contains(String handle)
handle - the site handle / identifier.public Map<String,SysInfo> getSysInfos(List<String> sites)
sites - the list of site identifiers for which sysinfo is required.public VDSSysInfo getVDSSysInfo(String handle)
VDSSysInfo for the sitehandle - the site handle / identifier.public SysInfo getSysInfo(String handle)
SysInfo for the sitehandle - the site handle / identifier.@Deprecated public String getVDSHome(String handle)
handle - the site handle / identifier.@Deprecated public String getPegasusHome(String handle)
handle - the site handle / identifier.public String getEnvironmentVariable(String handle, String variable)
handle - the site handle / identifier.variable - the name of the environment variable.public boolean removeGridGateway(String handle, String contact)
handle - the site handle with which it is associated.contact - the contact string for the grid gateway.public boolean removeFileServer(String handle, String url)
handle - the site handle with which it is associated.url - the contact string for the file server.public String getExternalWorkDirectoryURL(String siteHandle)
siteHandle - the site handle.public String getExternalWorkDirectory(FileServer fs, String siteHandle)
fs - the FileServer with the file systemsiteHanlde - the site for which you want the directorypublic String getExternalStorageDirectory(String site)
site - the site for which you want the storage-mount-point.public String getInternalWorkDirectory(String handle)
handle - the site handle of the site where a job has to be executed.RuntimeException - in case of site not found in the site catalog.public String getInternalWorkDirectory(Job job)
job - Job object for the job.RuntimeException - in case of site not found in the site catalog.public String getInternalWorkDirectory(Job job, boolean onStagingSite)
job - Job object for the job.onStagingSite - boolean indicating whether the work directory required
is the one on staging site.RuntimeException - in case of site not found in the site catalog.public String getInternalWorkDirectory(String handle, String path)
handle - the site handle of the site where a job has to be executed.path - the relative path that needs to be appended to the
workdir from the execution pool.RuntimeException - in case of site not found in the site catalog.public String getInternalWorkDirectory(String handle, String path, int jobClass)
handle - the site handle of the site where a job has to be executed.path - the relative path that needs to be appended to the
workdir from the execution pool.jobClass - the class of the job.RuntimeException - in case of site not found in the site catalog.public void toXML(Writer writer, String indent) throws IOException
toXML in class AbstractSiteDatawriter - indent - IOExceptionpublic void writeXMLHeader(Writer stream, String indent) throws IOException
stream - is a stream opened and ready for writing. This can also
be a string stream for efficient output.indent - is a String of spaces used for pretty
printing. The initial amount of spaces should be an empty
string. The parameter is used internally for the recursive
traversal.IOException - if something fishy happens to the stream.public Object clone()
clone in class AbstractSiteDataCopyright © 2011 The University of Southern California. All Rights Reserved.