org.gridlab.gat.resources
Class WrapperJobDescription

java.lang.Object
  extended by org.gridlab.gat.resources.AbstractJobDescription
      extended by org.gridlab.gat.resources.JobDescription
          extended by org.gridlab.gat.resources.WrapperJobDescription
All Implemented Interfaces:
Serializable

public class WrapperJobDescription
extends JobDescription

See Also:
Serialized Form

Nested Class Summary
static class WrapperJobDescription.ScheduledType
          An instance of this enumeration indicates the scheduled type of the WrapperJobDescription.
 class WrapperJobDescription.WrappedJobInfo
          This object contains all the information necessary to describe a wrapped Job.
 
Field Summary
static String WRAPPER_COMMON_DEST
          Attribute name of the destination directory for common files for wrapped jobs.
static String WRAPPER_COMMON_SRC
          Attribute name of the source directory for common files for wrapped jobs.
static String WRAPPER_COMMON_TRIGGER
          The copying of the wrapper common directory can be coordinated, in which case the attribute "wrapper.common.trigger" should be set to "true".
 
Constructor Summary
WrapperJobDescription(WrapperSoftwareDescription softwareDescription)
          Creates a WrapperJobDescription based on the given WrapperSoftwareDescription.
WrapperJobDescription(WrapperSoftwareDescription softwareDescription, Resource resource)
          Creates a WrapperJobDescription based on the given WrapperSoftwareDescription and the Resource.
WrapperJobDescription(WrapperSoftwareDescription softwareDescription, ResourceDescription resourceDescription)
          Creates a WrapperJobDescription based on the given WrapperSoftwareDescription and the ResourceDescription.
 
Method Summary
 void add(JobDescription[] jobDescriptions, URI brokerURI, Preferences preferences)
          Add JobDescriptions for a wrapped Job that should be submitted to a resource broker located at the given URI with the set of Preferences.
 void add(JobDescription jobDescription, URI brokerURI, Preferences preferences)
          Add a JobDescription for a wrapped Job that should be submitted to a resource broker located at the given URI with the set of Preferences.
 File getInfoFile(GATContext context)
          Returns a File containing all the information needed by the Wrapper application.
 List<WrapperJobDescription.WrappedJobInfo> getJobInfos()
          Returns a List of WrapperJobDescription.WrappedJobInfo containing the information for the wrapped Jobs.
 URI getJobStateFileName(JobDescription description)
          Returns the filename of the file that's used to forward the Job.JobState of the wrapped Job belonging to this JobDescription.
 int getLevel()
          Returns the logging level for the WrapperJob.
 WrapperJobDescription.ScheduledType getScheduledType()
          Returns the WrapperJobDescription.ScheduledType for the WrapperJob.
 int getWrapperJobIndex()
          Gets the wrapper job index.
 void setLoggingLevel(int level)
          Sets the logging level for the wrapper job
 void setScheduledType(WrapperJobDescription.ScheduledType scheduledType)
          Sets the WrapperJobDescription.ScheduledType.
static void setTriggerDirectory(URI location)
          Sets the directory where the trigger files will be written to.
 
Methods inherited from class org.gridlab.gat.resources.JobDescription
clone, getProcessCount, getResource, getResourceCount, getResourceDescription, getSoftwareDescription, setProcessCount, setResource, setResourceCount, setResourceDescription, setSoftwareDescription, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WRAPPER_COMMON_SRC

public static final String WRAPPER_COMMON_SRC
Attribute name of the source directory for common files for wrapped jobs. When set, it specifies a directory that is copied to the destination directory specified with the WRAPPER_COMMON_DEST attribute. If either WRAPPER_COMMON_SRC or WRAPPER_COMMON_DEST is not specified, the wrapper DOES NOT COPY. This mechanism may be used to copy files to the remote machine once (by the wrapper), instead of multiple times (for the wrapped jobs).

See Also:
Constant Field Values

WRAPPER_COMMON_DEST

public static final String WRAPPER_COMMON_DEST
Attribute name of the destination directory for common files for wrapped jobs. See WRAPPER_COMMON_SRC. If either WRAPPER_COMMON_SRC or WRAPPER_COMMON_DEST is not specified, the wrapper DOES NOT COPY. This mechanism may be used to copy files to the remote machine once (by the wrapper), instead of multiple times (for the wrapped jobs).

See Also:
Constant Field Values

WRAPPER_COMMON_TRIGGER

public static final String WRAPPER_COMMON_TRIGGER
The copying of the wrapper common directory can be coordinated, in which case the attribute "wrapper.common.trigger" should be set to "true". In that case, the trigger directory is used for trigger files with the name "WrapperCommonTrigger.WRAPPERNO", where WRAPPERNO stands for the wrapper number. The existence of this file will enable wrapper WRAPPERNO to copy its WRAPPER_COMMON_SRC directory and continue the run. It is up to the JavaGAT application to produce the trigger files.

See Also:
Constant Field Values
Constructor Detail

WrapperJobDescription

public WrapperJobDescription(WrapperSoftwareDescription softwareDescription)
Creates a WrapperJobDescription based on the given WrapperSoftwareDescription.

Parameters:
softwareDescription - the WrapperSoftwareDescription containing the description of the software to be run

WrapperJobDescription

public WrapperJobDescription(WrapperSoftwareDescription softwareDescription,
                             ResourceDescription resourceDescription)
Creates a WrapperJobDescription based on the given WrapperSoftwareDescription and the ResourceDescription.

Parameters:
softwareDescription - the WrapperSoftwareDescription containing the description of the software to be run
resourceDescription - the ResourceDescription containing the description of on which resource the software should be run.

WrapperJobDescription

public WrapperJobDescription(WrapperSoftwareDescription softwareDescription,
                             Resource resource)
Creates a WrapperJobDescription based on the given WrapperSoftwareDescription and the Resource.

Parameters:
softwareDescription - the WrapperSoftwareDescription containing the description of the software to be run
resource - the Resource containing the description of on which resource the software should be run.
Method Detail

getWrapperJobIndex

public int getWrapperJobIndex()
Gets the wrapper job index.

Returns:
the wrapper job index.

setScheduledType

public void setScheduledType(WrapperJobDescription.ScheduledType scheduledType)
Sets the WrapperJobDescription.ScheduledType.

Parameters:
scheduledType - a WrapperJobDescription.ScheduledType

setLoggingLevel

public void setLoggingLevel(int level)
Sets the logging level for the wrapper job

Parameters:
level - the logging level for the wrapper job

add

public void add(JobDescription jobDescription,
                URI brokerURI,
                Preferences preferences)
Add a JobDescription for a wrapped Job that should be submitted to a resource broker located at the given URI with the set of Preferences.

Parameters:
jobDescription - the JobDescription of the wrapped Job
brokerURI - the resource broker URI for the wrapped Job
preferences - the Preferences for the wrapped Job

add

public void add(JobDescription[] jobDescriptions,
                URI brokerURI,
                Preferences preferences)
Add JobDescriptions for a wrapped Job that should be submitted to a resource broker located at the given URI with the set of Preferences.

Parameters:
jobDescriptions - the JobDescriptions of the wrapped Jobs
brokerURI - the resource broker URI for the wrapped Jobs
preferences - the Preferences for the wrapped Jobs

getJobInfos

public List<WrapperJobDescription.WrappedJobInfo> getJobInfos()
Returns a List of WrapperJobDescription.WrappedJobInfo containing the information for the wrapped Jobs.

Returns:
a List of WrapperJobDescription.WrappedJobInfo containing the information for the wrapped Jobs.

getScheduledType

public WrapperJobDescription.ScheduledType getScheduledType()
Returns the WrapperJobDescription.ScheduledType for the WrapperJob.

Returns:
the WrapperJobDescription.ScheduledType for the WrapperJob.

getLevel

public int getLevel()
Returns the logging level for the WrapperJob.

Returns:
the logging level for the WrapperJob.

getInfoFile

public File getInfoFile(GATContext context)
                 throws GATObjectCreationException
Returns a File containing all the information needed by the Wrapper application.

Returns:
a File containing all the information needed by the Wrapper application.
Throws:
GATObjectCreationException

getJobStateFileName

public URI getJobStateFileName(JobDescription description)
Returns the filename of the file that's used to forward the Job.JobState of the wrapped Job belonging to this JobDescription. Path is relative to the wrapper location, or absolute.

Parameters:
description - the description of the wrapped Job.
Returns:
the filename of the file that's used to forward the Job.JobState of the wrapped Job belonging to this JobDescription.

setTriggerDirectory

public static void setTriggerDirectory(URI location)
                                throws Exception
Sets the directory where the trigger files will be written to. This method can only be invoked once. The user has to create the trigger files itself. Note: the location specified, if not absolute, is to be regarded as relative to where the wrapper job actually is running.

Parameters:
location - the location of the trigger directory.
Throws:
Exception - when the trigger directory is already set.