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 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.
|
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.
|
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 |
getExternalWorkDirectory(FileServer fs,
String siteHandle)
Return the work directory as seen externally (including external mount point)
|
String |
getExternalWorkDirectoryURL(FileServer server,
String siteHandle)
Returns a URL to the work directory as seen externally ( including external
mount point ).
|
String |
getExternalWorkDirectoryURL(String siteHandle,
FileServerType.OPERATION operation)
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.
|
String |
getRelativeStorageDirectoryAddon()
Return the relative directory that needs to be appended to the storage
directory for the workflow.
|
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 |
private boolean |
hashedOutputMapperUsed(PegasusProperties properties)
Returns a boolean indicating whether the Hashed Output Mapper was used or
not
|
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
|
toString, toXML, writeAttribute
private Map<String,SiteCatalogEntry> mStore
private 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 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, FileServerType.OPERATION operation)
siteHandle
- the site handle.operation
- the operation for which we need the server.public String getExternalWorkDirectoryURL(FileServer server, String siteHandle)
server
- the FileServer to usesiteHandle
- the site handle.public String getExternalWorkDirectory(FileServer fs, String siteHandle)
fs
- the FileServer with the file systemsiteHandle
- the site for which you want the directorypublic String getRelativeStorageDirectoryAddon()
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 AbstractSiteData
writer
- indent
- IOException
public Object clone()
clone
in class AbstractSiteData
public void accept(SiteDataVisitor visitor) throws IOException
accept
in class AbstractSiteData
visitor
- that goes through itIOException
- if something fishy happens to the stream.private boolean hashedOutputMapperUsed(PegasusProperties properties)
properties
-