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 |
private java.util.Map<java.lang.String,SiteCatalogEntry> |
mStore
The internal map that maps a site catalog entry to the site handle.
|
private java.lang.String |
mWorkDir
The work dir path from the properties.
|
Constructor and Description |
---|
SiteStore()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(SiteDataVisitor visitor)
Accept method for the SiteStore object
|
SiteCatalogEntry |
addEntry(SiteCatalogEntry entry)
Adds a site catalog entry to the store.
|
java.lang.Object |
clone()
Returns the clone of the object.
|
boolean |
contains(java.lang.String handle)
Returns boolean indicating whether the store has a SiteCatalogEntry
matching a handle.
|
java.util.Iterator<SiteCatalogEntry> |
entryIterator()
Returns an iterator to SiteCatalogEntry objects in the store.
|
java.lang.String |
getEnvironmentVariable(java.lang.String handle,
java.lang.String variable)
Returns an environment variable associated with the site.
|
java.lang.String |
getExternalWorkDirectory(FileServer fs,
java.lang.String siteHandle)
Return the work directory as seen externally (including external mount point)
|
java.lang.String |
getExternalWorkDirectoryURL(FileServer server,
java.lang.String siteHandle)
Returns a URL to the work directory as seen externally ( including external
mount point ).
|
java.lang.String |
getExternalWorkDirectoryURL(java.lang.String siteHandle,
FileServerType.OPERATION operation)
Returns a URL to the work directory as seen externally ( including external
mount point ).
|
java.lang.String |
getInternalWorkDirectory(Job job)
This determines the working directory on remote execution pool for a
particular job.
|
java.lang.String |
getInternalWorkDirectory(Job job,
boolean onStagingSite)
This determines the working directory on remote execution pool or a staging
site for a particular job.
|
java.lang.String |
getInternalWorkDirectory(java.lang.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.
|
java.lang.String |
getInternalWorkDirectory(java.lang.String handle,
java.lang.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.
|
java.lang.String |
getInternalWorkDirectory(java.lang.String handle,
java.lang.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.
|
java.lang.String |
getPegasusHome(java.lang.String handle)
Deprecated.
|
java.lang.String |
getRelativeStorageDirectoryAddon()
Return the relative directory that needs to be appended to the storage
directory for the workflow.
|
SysInfo |
getSysInfo(java.lang.String handle)
Returns the
SysInfo for the site |
java.util.Map<java.lang.String,SysInfo> |
getSysInfos(java.util.List<java.lang.String> sites) |
java.lang.String |
getVDSHome(java.lang.String handle)
Deprecated.
|
VDSSysInfo |
getVDSSysInfo(java.lang.String handle)
Returns the
VDSSysInfo for the site |
private boolean |
hashedOutputMapperUsed(PegasusProperties properties)
Returns a boolean indicating whether the Hashed Output Mapper was used or
not
|
void |
initialize()
The intialize method.
|
java.util.Set<java.lang.String> |
list()
Returns the list of sites, in the store.
|
SiteCatalogEntry |
lookup(java.lang.String handle)
Returns SiteCatalogEntry matching a site handle.
|
boolean |
removeFileServer(java.lang.String handle,
java.lang.String url)
This is a soft state remove, that removes a file server from a particular
pool entry.
|
boolean |
removeGridGateway(java.lang.String handle,
java.lang.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(java.io.Writer writer,
java.lang.String indent)
Writes out the contents of the replica store as XML document
|
toString, toXML, writeAttribute
private java.util.Map<java.lang.String,SiteCatalogEntry> mStore
private java.lang.String mWorkDir
private PlannerOptions mPlannerOptions
protected boolean mDeepStorageStructure
public void initialize()
public void setForPlannerUse(PegasusProperties properties, PlannerOptions options)
properties
- the PegasusProperties
options
- the PlannerOptions
public SiteCatalogEntry addEntry(SiteCatalogEntry entry)
entry
- the site catalog entry.public java.util.Iterator<SiteCatalogEntry> entryIterator()
public java.util.Set<java.lang.String> list()
public SiteCatalogEntry lookup(java.lang.String handle)
handle
- the handle of the site to be looked up.public boolean contains(java.lang.String handle)
handle
- the site handle / identifier.public java.util.Map<java.lang.String,SysInfo> getSysInfos(java.util.List<java.lang.String> sites)
sites
- the list of site identifiers for which sysinfo is required.public VDSSysInfo getVDSSysInfo(java.lang.String handle)
VDSSysInfo
for the sitehandle
- the site handle / identifier.public SysInfo getSysInfo(java.lang.String handle)
SysInfo
for the sitehandle
- the site handle / identifier.@Deprecated public java.lang.String getVDSHome(java.lang.String handle)
handle
- the site handle / identifier.@Deprecated public java.lang.String getPegasusHome(java.lang.String handle)
handle
- the site handle / identifier.public java.lang.String getEnvironmentVariable(java.lang.String handle, java.lang.String variable)
handle
- the site handle / identifier.variable
- the name of the environment variable.public boolean removeGridGateway(java.lang.String handle, java.lang.String contact)
handle
- the site handle with which it is associated.contact
- the contact string for the grid gateway.public boolean removeFileServer(java.lang.String handle, java.lang.String url)
handle
- the site handle with which it is associated.url
- the contact string for the file server.public java.lang.String getExternalWorkDirectoryURL(java.lang.String siteHandle, FileServerType.OPERATION operation)
siteHandle
- the site handle.operation
- the operation for which we need the server.public java.lang.String getExternalWorkDirectoryURL(FileServer server, java.lang.String siteHandle)
server
- the FileServer to usesiteHandle
- the site handle.public java.lang.String getExternalWorkDirectory(FileServer fs, java.lang.String siteHandle)
fs
- the FileServer with the file systemsiteHandle
- the site for which you want the directorypublic java.lang.String getRelativeStorageDirectoryAddon()
public java.lang.String getInternalWorkDirectory(java.lang.String handle)
handle
- the site handle of the site where a job has to be executed.java.lang.RuntimeException
- in case of site not found in the site catalog.public java.lang.String getInternalWorkDirectory(Job job)
job
- Job
object for the job.java.lang.RuntimeException
- in case of site not found in the site catalog.public java.lang.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.java.lang.RuntimeException
- in case of site not found in the site catalog.public java.lang.String getInternalWorkDirectory(java.lang.String handle, java.lang.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.java.lang.RuntimeException
- in case of site not found in the site catalog.public java.lang.String getInternalWorkDirectory(java.lang.String handle, java.lang.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.java.lang.RuntimeException
- in case of site not found in the site catalog.public void toXML(java.io.Writer writer, java.lang.String indent) throws java.io.IOException
toXML
in class AbstractSiteData
writer
- indent
- java.io.IOException
public java.lang.Object clone()
clone
in class AbstractSiteData
public void accept(SiteDataVisitor visitor) throws java.io.IOException
accept
in class AbstractSiteData
visitor
- that goes through itjava.io.IOException
- if something fishy happens to the stream.private boolean hashedOutputMapperUsed(PegasusProperties properties)
properties
-