|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ggf.drmaa.JobTemplate
This class represents a template to be used for the creation of a job. The properties set on a JobTemplate object as used to create a new job and set up the new job's environment.
There is a 1:n relationship between JobTemplates and jobs. A single JobTemplate can be used to submit any number of jobs. Once a job has been submitted, e.g. via Session.runJob(), the JobTemplate no longer has any affect on the job. Changes made to the JobTemplate will have no affect on already running jobs. Deleting the JobTemplate (via Session.deleteJobTemplate()) also has no effect on running jobs.
Once a JobTemplate has been created (via Session.createJobTemplate()), it is the responsibility of the developer to delete it when no longer needed (via Session.deleteJobTemplate ()). Failure to do so may result in a memory leak.Example:
public static void main (String[] args) { SessionFactory factory = SessionFactory.getFactory (); Session session = factory.getSession (); try { session.init (null); JobTemplate jt = session.createJobTemplate (); jt.setRemoteCommand ("sleeper.sh"); jt.setWorkingDirectory (HOME_DIRECTORY + "/jobs"); jt.setArgs (new String[] {"5"}); String id = session.runJob (jt); session.deleteJobTemplate (jt); session.exit (); } catch (DrmaaException e) { System.out.println ("Error: " + e.getMessage ()); } }
Session
Field Summary | |
static int |
ACTIVE
jobSumissionState which means the job has been queued and is eligible to run |
protected java.lang.String[] |
args
Input parameters passed as arguments to the job |
protected boolean |
blockEmail
Blocks sending e-mail by default, regardless of the DRMS setting |
protected java.lang.String |
category
An implementation-defined string specifying how to resolve site-specific resources and/or policies |
protected java.lang.String[] |
email
E-mail addresses used to report the job completion and status |
protected java.util.Properties |
env
The environment values that define the job's remote environment |
protected java.lang.String |
errorPath
The job's standard error stream |
static int |
HOLD
jobSubmissionState which means the job has been queued but it is not eligible to run |
static java.lang.String |
HOME_DIRECTORY
Placeholder which represents the home directory in the workingDirectory, inputPath, outputPath, and errorPath properties |
protected java.lang.String |
inputPath
The job's standard input stream |
protected boolean |
join
Whether the error stream should be intermixed with the output stream |
protected java.lang.String |
name
Job name |
protected java.lang.String |
outputPath
The job's standard output stream |
static java.lang.String |
PARAMETRIC_INDEX
Placeholder which represents the task id for a task in a parametric job in the workingDirectory, inputPath, outputPath, and errorPath properties |
protected java.lang.String |
remoteCommand
Remote command to execute |
protected java.lang.String |
spec
An implementation-defined string that is passed by the end user to DRMAA to specify site-specific resources and/or policies |
protected PartialTimestamp |
startTime
The earliest time when the job may be eligible to be run |
protected int |
state
Job state at submission, either HOLD or ACTIVE |
protected java.lang.String |
wd
The directory where the job is executed. |
static java.lang.String |
WORKING_DIRECTORY
Placeholder which represents the working directory in the workingDirectory, inputPath, outputPath, and errorPath properties |
Constructor Summary | |
JobTemplate()
|
Method Summary | |
java.lang.String[] |
getArgs()
Get The parameters passed as arguments to the job. |
java.util.List |
getAttributeNames()
Returns the list of supported property names. |
boolean |
getBlockEmail()
Get whether to block sending e-mail by default, regardless of the DRMS settings. |
PartialTimestamp |
getDeadlineTime()
Sets a deadline after which the DRMS will terminate the job. |
java.lang.String[] |
getEmail()
Get the list of email addresses used to report the job completion and status. |
java.lang.String |
getErrorPath()
Gets how to direct the job's standard error. |
long |
getHardRunDurationLimit()
Gets how long the job may be in a running state before its limit has been exceeded, and therefore is terminated by the DRMS. |
long |
getHardWallclockTimeLimit()
Gets the duration of the job's wall clock time limit. |
java.lang.String |
getInputPath()
Get the job's standard input path. |
java.lang.String |
getJobCategory()
Get the opaque string specifying how to resolve site-specific resources and/or policies. |
java.util.Properties |
getJobEnvironment()
Get the environment values that define the remote environment. |
java.lang.String |
getJobName()
Get the name of the job. |
int |
getJobSubmissionState()
Get the job state at submission. |
boolean |
getJoinFiles()
Gets whether the error stream should be intermixed with the output stream. |
java.lang.String |
getNativeSpecification()
Get the opaque string that is passed by the end user to DRMAA to specify site-specific resources and/or policies. |
protected java.util.List |
getOptionalAttributeNames()
This method returns the names of all optional and implementation-specific properties supported by this DRMAA implementation. |
java.lang.String |
getOutputPath()
Gets how to direct the job's standard output. |
java.lang.String |
getRemoteCommand()
Get the command string to execute as the job. |
long |
getSoftRunDurationLimit()
Gets an estimate as to how long the job will need to remain in a running state to complete. |
long |
getSoftWallclockTimeLimit()
Gets an estimate as to how much wall clock time job will need to complete. |
PartialTimestamp |
getStartTime()
Get the earliest time when the job may be eligible to be run. |
FileTransferMode |
getTransferFiles()
Gets how to transfer files between hosts. |
java.lang.String |
getWorkingDirectory()
Get the directory where the job is executed. |
void |
setArgs(java.lang.String[] args)
Set the parameters passed as arguments to the job. |
void |
setBlockEmail(boolean blockEmail)
Set whether to block sending e-mail by default, regardless of the DRMS settings. |
void |
setDeadlineTime(PartialTimestamp deadline)
Sets a deadline after which the DRMS will terminate the job. |
void |
setEmail(java.lang.String[] email)
Set the list of email addresses used to report the job completion and status. |
void |
setErrorPath(java.lang.String errorPath)
Sets how to direct the job's standard error. |
void |
setHardRunDurationLimit(long hardRunLimit)
Sets how long the job may be in a running state before its limit has been exceeded, and therefore is terminated by the DRMS. |
void |
setHardWallclockTimeLimit(long hardWallclockLimit)
Sets when the job's wall clock time limit has been exceeded. |
void |
setInputPath(java.lang.String inputPath)
Set the job's standard input path. |
void |
setJobCategory(java.lang.String category)
Set an opaque string specifying how to resolve site-specific resources and/or policies. |
void |
setJobEnvironment(java.util.Properties env)
Set the environment values that define the remote environment. |
void |
setJobName(java.lang.String name)
Set the name of the job. |
void |
setJobSubmissionState(int state)
Set the job state at submission. |
void |
setJoinFiles(boolean join)
Sets whether the error stream should be intermixed with the output stream. |
void |
setNativeSpecification(java.lang.String spec)
Set an opaque string that is passed by the end user to DRMAA to specify site-specific resources and/or policies. |
void |
setOutputPath(java.lang.String outputPath)
Sets how to direct the job's standard output. |
void |
setRemoteCommand(java.lang.String remoteCommand)
Set the command string to execute as the job. |
void |
setSoftRunDurationLimit(long softRunLimit)
Sets an estimate as to how long the job will need to remain in a running state to complete. |
void |
setSoftWallclockTimeLimit(long softWallclockLimit)
Sets an estimate as to how much wall clock time job will need to complete. |
void |
setStartTime(PartialTimestamp startTime)
Set the earliest time when the job may be eligible to be run. |
void |
setTransferFiles(FileTransferMode mode)
Sets how to transfer files between hosts. |
void |
setWorkingDirectory(java.lang.String wd)
Set the directory where the job is executed. |
java.lang.String |
toString()
Converts this JobTemplate into a String which contains all property settings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int HOLD
public static final int ACTIVE
public static final java.lang.String HOME_DIRECTORY
public static final java.lang.String WORKING_DIRECTORY
public static final java.lang.String PARAMETRIC_INDEX
protected java.lang.String remoteCommand
protected java.lang.String[] args
protected int state
protected java.util.Properties env
protected java.lang.String wd
protected java.lang.String category
protected java.lang.String spec
protected java.lang.String[] email
protected boolean blockEmail
protected PartialTimestamp startTime
protected java.lang.String name
protected java.lang.String inputPath
protected java.lang.String outputPath
protected java.lang.String errorPath
protected boolean join
Constructor Detail |
public JobTemplate()
Method Detail |
public void setRemoteCommand(java.lang.String remoteCommand) throws DrmaaException
remoteCommand
- The command to execute as the job
DrmaaException
- Maybe be one of the following:
public java.lang.String getRemoteCommand()
public void setArgs(java.lang.String[] args) throws DrmaaException
args
- The parameters passed as arguments to the job
DrmaaException
- Maybe be one of the following:
public java.lang.String[] getArgs()
public void setJobSubmissionState(int state) throws DrmaaException
state
- The job state at submission
DrmaaException
- Maybe be one of the following:
public int getJobSubmissionState()
public void setJobEnvironment(java.util.Properties env) throws DrmaaException
env
- The environment values that define the remote environment
DrmaaException
- Maybe be one of the following:
public java.util.Properties getJobEnvironment()
public void setWorkingDirectory(java.lang.String wd) throws DrmaaException
HOME_DIRECTORY
placeholder at the beginning denotes that the
remaining portion of the directory name is resolved
relative to the job submiter's home directory on the execution host.PARAMETRIC_INDEX
placeholder can be used at any position
within the directory name of parametric jobs and will be replaced
by the underlying DRM system with the parametric jobs' index.
wd
- The directory where the job is executed
DrmaaException
- Maybe be one of the following:
public java.lang.String getWorkingDirectory()
HOME_DIRECTORY
placeholder at the beginning denotes that the
remaining portion of the directory name is resolved
relative to the job submiter's home directory on the execution host.PARAMETRIC_INDEX
placeholder can be used at any position
within the directory name of parametric jobs and will be replaced
by the underlying DRM system with the parametric jobs' index.
public void setJobCategory(java.lang.String category) throws DrmaaException
category
- An opaque string specifying how to resolve site-specific
resources and/or policies.
DrmaaException
- Maybe be one of the following:
public java.lang.String getJobCategory()
public void setNativeSpecification(java.lang.String spec) throws DrmaaException
spec
- An opaque string that is passed by the end user to DRMAA to
specify site-specific resources and/or policies
DrmaaException
- Maybe be one of the following:
public java.lang.String getNativeSpecification()
public void setEmail(java.lang.String[] email) throws DrmaaException
email
- The list of email addresses used to report the job completion
and status.
DrmaaException
- Maybe be one of the following:
public java.lang.String[] getEmail()
public void setBlockEmail(boolean blockEmail) throws DrmaaException
blockEmail
- Whether to block sending e-mail by default
DrmaaException
- Maybe be one of the following:
public boolean getBlockEmail()
public void setStartTime(PartialTimestamp startTime) throws DrmaaException
startTime
- The earliest time when the job may be eligible to be run
DrmaaException
- Maybe be one of the following:
public PartialTimestamp getStartTime()
public void setJobName(java.lang.String name) throws DrmaaException
name
- The name of the job
DrmaaException
- Maybe be one of the following:
public java.lang.String getJobName()
public void setInputPath(java.lang.String inputPath) throws DrmaaException
PARAMETRIC_INDEX
placeholder can be used at any position
within the file path of parametric job templates and will be replaced
by the underlying DRM system with the parametric job's index.HOME_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the job
submiter's home directory on the host where the file is located.WORKING_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the
job's working directory on the host where the file is located.
inputPath
- The job's standard input path
DrmaaException
- Maybe be one of the following:
public java.lang.String getInputPath()
PARAMETRIC_INDEX
placeholder can be used at any position
within the file path of parametric job templates and will be replaced
by the underlying DRM system with the parametric job's index.HOME_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the job
submiter's home directory on the host where the file is located.WORKING_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the
job's working directory on the host where the file is located.
public void setOutputPath(java.lang.String outputPath) throws DrmaaException
PARAMETRIC_INDEX
placeholder can be used at any position
within the file path of parametric job templates and will be replaced
by the underlying DRM system with the parametric job's index.HOME_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the job
submiter's home directory on the host where the file is located.WORKING_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the
job's working directory on the host where the file is located.
outputPath
- How to direct the job's standard output
DrmaaException
- Maybe be one of the following:
public java.lang.String getOutputPath()
PARAMETRIC_INDEX
placeholder can be used at any position
within the file path of parametric job templates and will be replaced
by the underlying DRM system with the parametric job's index.HOME_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the job
submiter's home directory on the host where the file is located.WORKING_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the
job's working directory on the host where the file is located.
public void setErrorPath(java.lang.String errorPath) throws DrmaaException
PARAMETRIC_INDEX
placeholder can be used at any position
within the file path of parametric job templates and will be replaced
by the underlying DRM system with the parametric job's index.HOME_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the job
submiter's home directory on the host where the file is located.WORKING_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the
job's working directory on the host where the file is located.
errorPath
- How to direct the job's standard error
DrmaaException
- Maybe be one of the following:
public java.lang.String getErrorPath()
PARAMETRIC_INDEX
placeholder can be used at any position
within the file path of parametric job templates and will be replaced
by the underlying DRM system with the parametric job's index.HOME_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the job
submiter's home directory on the host where the file is located.WORKING_DIRECTORY
placeholder at the beginning of the file path
denotes that the remaining portion of the file path is relative to the
job's working directory on the host where the file is located.
public void setJoinFiles(boolean join) throws DrmaaException
false
.true
is specified the underlying DRM system will ignore the value of
the errorPath attribute and intermix the standard error stream with the
standard output stream as specified with outputPath.
join
- Whether the error stream should be intermixed with the output
stream
DrmaaException
- Maybe be one of the following:
public boolean getJoinFiles()
true
is specified the underlying DRM system will ignore the value of
the errorPath attribute and intermix the standard error stream with the
standard output stream as specified with outputPath.
public void setTransferFiles(FileTransferMode mode) throws DrmaaException
true
, the errorPath attribute is taken to specify the
location to which error files should be transfered after the job
finishes.true
, the inputPath attribute is taken to specify the
location from which input files should be transfered before the job
starts.true
, the outputPath attribute is taken to specify the
location to which output files should be transfered after the job
finishes.
mode
- How to transfer files between hosts.
DrmaaException
- Maybe be one of the following:
public FileTransferMode getTransferFiles()
true
, the errorPath attribute is taken to specify the
location to which error files should be transfered after the job
finishes.true
, the inputPath attribute is taken to specify the
location from which input files should be transfered before the job
starts.true
, the outputPath attribute is taken to specify the
location to which output files should be transfered after the job
finishes.
public void setDeadlineTime(PartialTimestamp deadline) throws DrmaaException
deadline
- The deadline after which the DRMS will terminate the job
DrmaaException
- Maybe be one of the following:
public PartialTimestamp getDeadlineTime()
public void setHardWallclockTimeLimit(long hardWallclockLimit) throws DrmaaException
hardWallclockLimit
- When the job's wall clock time limit has been
exceeded. Specified in seconds
DrmaaException
- Maybe be one of the following:
public long getHardWallclockTimeLimit()
public void setSoftWallclockTimeLimit(long softWallclockLimit) throws DrmaaException
softWallclockLimit
- An estimate as to how much wall clock time job
will need to complete. Specified in seconds
DrmaaException
- Maybe be one of the following:
public long getSoftWallclockTimeLimit()
public void setHardRunDurationLimit(long hardRunLimit) throws DrmaaException
hardRunLimit
- How long the job may be in a running state before its
limit has been exceeded. Specified in seconds
DrmaaException
- Maybe be one of the following:
public long getHardRunDurationLimit()
public void setSoftRunDurationLimit(long softRunLimit) throws DrmaaException
softRunLimit
- An estimate as to how long the job will need to remain
in a running state to complete. Specified in seconds
DrmaaException
- Maybe be one of the following:
public long getSoftRunDurationLimit()
public java.util.List getAttributeNames()
protected java.util.List getOptionalAttributeNames()
getAttributeNames()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |