org.ggf.drmaa
public class SimpleJobTemplate extends java.lang.Object implements JobTemplate, java.io.Serializable
All non-primitive properties default to null
. All boolean
properties default to false
. All other primitive properties
default to zero.
The SimpleJobTemplate class is not thread safe. No attempt is made to prevent setters and getters from interfering with each other or the toString() method.
JobTemplate
,
Serialized FormACTIVE_STATE, HOLD_STATE, HOME_DIRECTORY, PARAMETRIC_INDEX, WORKING_DIRECTORY
Constructor and Description |
---|
SimpleJobTemplate()
Create a new instance of a JobTemplate.
|
Modifier and Type | Method and Description |
---|---|
java.util.List |
getArgs()
Get the arguments to the job.
|
java.util.Set |
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.util.Set |
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.
|
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.Map |
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.
|
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.util.List args)
Sets the 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.util.Set 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.Map 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)
Specifies, which of the standard I/O files (stdin, stdout and stderr) are
to be transferred to/from the execution host.
|
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.
|
public SimpleJobTemplate()
public void setRemoteCommand(java.lang.String remoteCommand) throws DrmaaException
JobTemplate
setRemoteCommand
in interface JobTemplate
remoteCommand
- the command to execute as the jobDrmaaException
- May be one of the following:
public java.lang.String getRemoteCommand() throws DrmaaException
JobTemplate
getRemoteCommand
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setRemoteCommand(String)
public void setArgs(java.util.List args) throws DrmaaException
JobTemplate
setArgs
in interface JobTemplate
args
- the parameters passed as arguments to the jobDrmaaException
- May be one of the following:
public java.util.List getArgs() throws DrmaaException
JobTemplate
getArgs
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setArgs(List)
public void setJobSubmissionState(int state) throws DrmaaException
JobTemplate
A job submitted in the HOLD_STATE state can be made eligible to run through the Session.control() method using the Session.RELEASE constant.
setJobSubmissionState
in interface JobTemplate
state
- the job state at submissionDrmaaException
- May be one of the following:
public int getJobSubmissionState() throws DrmaaException
JobTemplate
getJobSubmissionState
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setJobSubmissionState(int)
public void setJobEnvironment(java.util.Map env) throws DrmaaException
JobTemplate
setJobEnvironment
in interface JobTemplate
env
- the environment values that define the remote environmentDrmaaException
- May be one of the following:
public java.util.Map getJobEnvironment() throws DrmaaException
JobTemplate
getJobEnvironment
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setJobEnvironment(Map)
public void setWorkingDirectory(java.lang.String wd) throws DrmaaException
JobTemplate
A 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.
The PARAMETRIC_INDEX
placeholder can be used at any position
within the directory name of a parametric job and will be replaced
by the underlying DRM system with the parametric job's index.
The directory name must be specified in a syntax that is common at the host where the job will be executed.
If no placeholder is used, an absolute directory specification is expected.
If the directory does not exist when the job is run, the job enters the state Session.FAILED.
setWorkingDirectory
in interface JobTemplate
wd
- the directory where the job is executedDrmaaException
- May be one of the following:
public java.lang.String getWorkingDirectory() throws DrmaaException
JobTemplate
getWorkingDirectory
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setWorkingDirectory(String)
public void setJobCategory(java.lang.String category) throws DrmaaException
JobTemplate
setJobCategory
in interface JobTemplate
category
- an opaque string specifying how to resolve site-specific
resources and/or policies.DrmaaException
- May be one of the following:
public java.lang.String getJobCategory() throws DrmaaException
JobTemplate
getJobCategory
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setJobCategory(String)
public void setNativeSpecification(java.lang.String spec) throws DrmaaException
JobTemplate
setNativeSpecification
in interface JobTemplate
spec
- an opaque string that is passed by the end user to DRMAA to
specify site-specific resources and/or policiesDrmaaException
- May be one of the following:
public java.lang.String getNativeSpecification() throws DrmaaException
JobTemplate
getNativeSpecification
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setNativeSpecification(String)
public void setEmail(java.util.Set email) throws DrmaaException
JobTemplate
setEmail
in interface JobTemplate
email
- the list of email addresses used to report the job
completion and status.DrmaaException
- May be one of the following:
public java.util.Set getEmail() throws DrmaaException
JobTemplate
getEmail
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setEmail(Set)
public void setBlockEmail(boolean blockEmail) throws DrmaaException
JobTemplate
setBlockEmail
in interface JobTemplate
blockEmail
- whether to block sending e-mail by defaultDrmaaException
- May be one of the following:
public boolean getBlockEmail() throws DrmaaException
JobTemplate
getBlockEmail
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setBlockEmail(boolean)
public void setStartTime(PartialTimestamp startTime) throws DrmaaException
JobTemplate
setStartTime
in interface JobTemplate
startTime
- the earliest time when the job may be eligible to be runDrmaaException
- May be one of the following:
public PartialTimestamp getStartTime() throws DrmaaException
JobTemplate
getStartTime
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setStartTime(PartialTimestamp)
public void setJobName(java.lang.String name) throws DrmaaException
JobTemplate
setJobName
in interface JobTemplate
name
- the name of the jobDrmaaException
- May be one of the following:
public java.lang.String getJobName() throws DrmaaException
JobTemplate
getJobName
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setJobName(String)
public void setInputPath(java.lang.String inputPath) throws DrmaaException
JobTemplate
If set, specifies the network path of the job's input stream in the form of [hostname]:file_path
When the transferFiles property is supported and has it's inputStream property set, the input file will be fetched by the underlying DRM system from the specified host or from the submit host if no hostname is specified.
When the transferFiles property is not supported or does not have its inputStream property set, the input file is always expected to be at the host where the job is executed irrespective of a whether a hostname is specified in the path.
The 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.
A 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.
A 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.
The file path must be specified in a syntax that is common at the host where the file is located.
When the job is run, if this property is set, and the file can't be read, the job will enter the state Session.FAILED.
setInputPath
in interface JobTemplate
inputPath
- the job's standard input pathDrmaaException
- May be one of the following:
public java.lang.String getInputPath() throws DrmaaException
JobTemplate
getInputPath
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setInputPath(String)
public void setOutputPath(java.lang.String outputPath) throws DrmaaException
JobTemplate
When the transferFiles property is supported and has its outputStream property set, the output file will be transferred by the underlying DRM system to the specified host or to the submit host if no hostname is specified.
When the transferFiles property is not supported or does not have it's outputStream property set, the output file is always kept at the host where the job is executed irrespective of a whether a hostname is specified in the path.
The 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.
A 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.
A 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.
The file path must be specified in a syntax that is common at the host where the file is located.
When the job is run, if this property is set, and the file can't be written before execution the job will enter the state Session.FAILED.
setOutputPath
in interface JobTemplate
outputPath
- how to direct the job's standard outputDrmaaException
- May be one of the following:
public java.lang.String getOutputPath() throws DrmaaException
JobTemplate
getOutputPath
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setOutputPath(String)
public void setErrorPath(java.lang.String errorPath) throws DrmaaException
JobTemplate
When the transferFiles property is supported and has its errorStream property set, the error file will be transferred by the underlying DRM system to the specified host or to the submit host if no hostname is specified.
When the transferFiles property is not supported or does not have it's errorStream property set, the error file is always kept at the host where the job is executed irrespective of a whether a hostname is specified in the path.
The 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.
A 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.
A 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.
The file path must be specified in a syntax that is common at the host where the file is located.
When the job is run, if this property is set, and the file can't be written before execution the job will enter the state Session.FAILED.
setErrorPath
in interface JobTemplate
errorPath
- how to direct the job's standard errorDrmaaException
- May be one of the following:
public java.lang.String getErrorPath() throws DrmaaException
JobTemplate
getErrorPath
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setErrorPath(String)
public void setJoinFiles(boolean join) throws DrmaaException
JobTemplate
false
.
If true
is specified the underlying DRM system will ignore
the value of the errorPath property and intermix the standard error
stream with the standard output stream as specified by the outputPath
property.
setJoinFiles
in interface JobTemplate
join
- whether the error stream should be intermixed with the output
streamDrmaaException
- May be one of the following:
public boolean getJoinFiles() throws DrmaaException
JobTemplate
getJoinFiles
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setJoinFiles(boolean)
public void setTransferFiles(FileTransferMode mode) throws DrmaaException
JobTemplate
If the FileTransferMode instance's errorStream property is set to
true
, the errorPath property is taken to specify the
location to which error files should be transfered after the job
finishes.
If the FileTransferMode instance's inputStream property is set to
true
, the inputPath property is taken to specify the
location from which input files should be transfered before the job
starts.
If the FileTransferMode instance's outputStream property is set to
true
, the outputPath property is taken to specify the
location to which output files should be transfered after the job
finishes.
setTransferFiles
in interface JobTemplate
mode
- how to transfer files between hosts.DrmaaException
- May be one of the following:
JobTemplate.setInputPath(String)
,
JobTemplate.setOutputPath(String)
,
JobTemplate.setErrorPath(String)
public FileTransferMode getTransferFiles() throws DrmaaException
JobTemplate
getTransferFiles
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setTransferFiles(FileTransferMode)
public void setDeadlineTime(PartialTimestamp deadline) throws DrmaaException
JobTemplate
setDeadlineTime
in interface JobTemplate
deadline
- the deadline after which the DRMS will terminate the jobDrmaaException
- May be one of the following:
public PartialTimestamp getDeadlineTime() throws DrmaaException
JobTemplate
getDeadlineTime
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setDeadlineTime(PartialTimestamp)
public void setHardWallclockTimeLimit(long hardWallclockLimit) throws DrmaaException
JobTemplate
setHardWallclockTimeLimit
in interface JobTemplate
hardWallclockLimit
- when the job's wall clock time limit has been
exceeded. Specified in secondsDrmaaException
- May be one of the following:
public long getHardWallclockTimeLimit() throws DrmaaException
JobTemplate
getHardWallclockTimeLimit
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setHardWallclockTimeLimit(long)
public void setSoftWallclockTimeLimit(long softWallclockLimit) throws DrmaaException
JobTemplate
This attribute is intended to assist the scheduler. If the time specified in insufficient, the drmaa-implementation may impose a scheduling penalty.
setSoftWallclockTimeLimit
in interface JobTemplate
softWallclockLimit
- an estimate as to how much wall clock time job
will need to complete. Specified in secondsDrmaaException
- May be one of the following:
public long getSoftWallclockTimeLimit() throws DrmaaException
JobTemplate
getSoftWallclockTimeLimit
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setSoftWallclockTimeLimit(long)
public void setHardRunDurationLimit(long hardRunLimit) throws DrmaaException
JobTemplate
setHardRunDurationLimit
in interface JobTemplate
hardRunLimit
- how long the job may be in a running state before its
limit has been exceeded. Specified in secondsDrmaaException
- May be one of the following:
public long getHardRunDurationLimit() throws DrmaaException
JobTemplate
getHardRunDurationLimit
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setHardRunDurationLimit(long)
public void setSoftRunDurationLimit(long softRunLimit) throws DrmaaException
JobTemplate
setSoftRunDurationLimit
in interface JobTemplate
softRunLimit
- an estimate as to how long the job will need to
remain in a running state to complete. Specified in secondsDrmaaException
- May be one of the following:
public long getSoftRunDurationLimit() throws DrmaaException
JobTemplate
getSoftRunDurationLimit
in interface JobTemplate
DrmaaException
- May be one of the following:
JobTemplate.setSoftRunDurationLimit(long)
public java.util.Set getAttributeNames() throws DrmaaException
JobTemplate
getAttributeNames
in interface JobTemplate
DrmaaException
- May be one of the following:
public java.lang.String toString()
toString
in class java.lang.Object
The contents of this file are licensed under the Sun Industry Standards Source License version 1.2.
Copyright 2008, Sun Microsystems, Inc.