Class JobDescription

java.lang.Object
com.sun.grid.jsv.JobDescription
All Implemented Interfaces:
Serializable, Cloneable

public final class JobDescription extends Object implements Cloneable, Serializable
The JobDescription class represents a job to be verified by the JSV. It contains the values of all submissions attributes applied to the job as well as the job's environment variables' values if requested. All properties of this class may be null. A property with a null value indicates that the value was not set by the JSV framework, and hence was not a submission attribute of the job being verified. Care must be taken with the Boolean and Integer properties to prevent null pointer exceptions caused by autoboxing. Setting a property value to null deletes the corresponding submission attribute from the job being verified. All properties of Collection type return copies of the Collection from their getter methods. In order to make changes to the contents of the Collection, the corresponding setter method must be called. It is acceptable to make the changes to the Collection instance returned from the getter method and then commit those changes by passing that Collection instance to the setter method. The JobDescription class uses the Logger named "com.sun.grid.Jsv". By default the Logger is set not to pass log records to its parent logger because the default Logger writes to stdout and would disrupt the JSV protocol. By default, the Logger has no handlers installed. In order to enable logging, add a handler, i.e. a FileHandler instance. It is always a good idea to enabling logging, as errors in JSV protocol handling will be logged as warnings, but will not be visible any other way.
Since:
6.2u5
See Also:
  • Field Details

    • MASTER_CLIENT

      public static final String MASTER_CLIENT
      String value of the client property that indicates the JSV is running on the master node.
      See Also:
    • MASTER_CONTEXT

      public static final String MASTER_CONTEXT
      String value of the context property that indicates the JSV is running on the master node.
      See Also:
    • CLIENT_CONTEXT

      public static final String CLIENT_CONTEXT
      String value of the context property that indicates the JSV is running on the master node.
      See Also:
  • Constructor Details

    • JobDescription

      public JobDescription()
  • Method Details

    • getAccount

      public String getAccount()
      Get the account string. See qsub -A.
      Returns:
      the account string
    • getAdvanceReservationId

      public Integer getAdvanceReservationId()
      Get the advance reservation id. Note that the return value will be null if the advance reservation id has not been set. See qsub -ar.
      Returns:
      the advance reservation id
    • getCheckpointSpecifier

      public CheckpointSpecifier getCheckpointSpecifier()
      Get an object representing the checkpointing options. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance.
      Returns:
      the checkpointing options See qsub -ckpt -c.
      See Also:
    • getClient

      public String getClient()
      Get the client string. If the JSV is running on the master node, the value of this string will be "qmaster". If the JSV is running on the submission client node, the value of this string will be the name of the submission utility, e.g. qsub, qrsh, etc.
      Returns:
      the client string
      See Also:
    • getCommandArgs

      public String[] getCommandArgs()
      Get the arguments to the job. The array that is returned will be a copy of the internal command arguments array, so modifications to the returned value will have no effect on the JobDescription instance.
      Returns:
      the job arguments
    • getCommandName

      public String getCommandName()
      Get the job command.
      Returns:
      the job command
    • getContext

      public String getContext()
      Get the context string. If the JSV is running on the master node, the value of this string will be "master". If the JSV is running on the submission client node, the value of this string will be "client".
      Returns:
      the context string
      See Also:
    • getWorkingDirectory

      public String getWorkingDirectory()
      Get the working directory for the job See qsub -cwd -wd.
      Returns:
      the working directory
    • getDeadline

      public Calendar getDeadline()
      Get the job's deadline time. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -dl.
      Returns:
      the deadline time
    • getDisplay

      public String getDisplay()
      Get the job's display value. See qsub -display.
      Returns:
      the display value
    • getErrorPath

      public Map<String,String> getErrorPath()
      Get the job's error path. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -e.
      Returns:
      the error path
    • getGroup

      public String getGroup()
      Get the primary group id for the job's submitter.
      Returns:
      the group id
    • getHardQueue

      public List<String> getHardQueue()
      Get the hard queue list. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -hard -q.
      Returns:
      the hard queue list
    • getHardResourceRequirements

      public Map<String,String> getHardResourceRequirements()
      Get the hard resource requirements. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -hard -l.
      Returns:
      the hard resource requirements
    • getHoldArrayJobIds

      public List<String> getHoldArrayJobIds()
      Get the list of array job identifiers on which this job's array tasks are dependent. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -hold_jid_ad.
      Returns:
      the array job dependencies
    • getHoldJobIds

      public List<String> getHoldJobIds()
      Get the list of job identifiers on which this job is dependent. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -hold_jid.
      Returns:
      the job dependencies
    • getInputPath

      public Map<String,String> getInputPath()
      Get the job's input path. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -i.
      Returns:
      the input path
    • getJobContext

      public Map<String,String> getJobContext()
      Get the job's job context map. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -ac -dc -sc.
      Returns:
      the job context
    • getJobId

      public String getJobId()
      Get the job's id
      Returns:
      the job id
    • getJobShare

      public Integer getJobShare()
      Get the job's assigned functional ticket share. Note that the return value will be null if the value has not been set. See qsub -js.
      Returns:
      the job share
    • getMailRecipients

      public List<String> getMailRecipients()
      Get the list of email recipients for this job. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -M.
      Returns:
      the email recipient list
    • getMailSpecifier

      public MailSpecifier getMailSpecifier()
      Get a MailSpecifier object that represents the occasions when email notifications should be sent for this job. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -m.
      Returns:
      the mail specifier
      See Also:
    • getMasterQueue

      public List<String> getMasterQueue()
      Get the master queue list. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -masterq.
      Returns:
      the master queue list
    • getName

      public String getName()
      Get the job's name.
      Returns:
      the job name
    • getOutputPath

      public Map<String,String> getOutputPath()
      Get the job's output path. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -o.
      Returns:
      the output path
    • getParallelEnvironment

      public ParallelEnvironment getParallelEnvironment()
      Get the ParallelEnvironment object that represents the parallel environment settings for the job. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -pe.
      Returns:
      the pe specification
      See Also:
    • getBindingSpecifier

      public BindingSpecifier getBindingSpecifier()
      Get the BindingSpecifier object that represents the core binding settings for the job. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -binding.
      Returns:
      the binding specification
      See Also:
    • getPriority

      public Integer getPriority()
      Get the job's priority. Note that the return value will be null if the value has not been set. See qsub -p.
      Returns:
      the job priority
    • getProject

      public String getProject()
      Get the job's project See qsub -P.
      Returns:
      the job project
    • getShellPath

      public Map<String,String> getShellPath()
      Get the shell path list. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -S.
      Returns:
      the shell path list
    • getSoftQueue

      public List<String> getSoftQueue()
      Get the soft queue list. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -soft -q.
      Returns:
      the soft queue list
    • getSoftResourceRequirements

      public Map<String,String> getSoftResourceRequirements()
      Get the soft resource requirements map. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -soft -l.
      Returns:
      the soft requirements map
    • getStartTime

      public Calendar getStartTime()
      Get the job's start time. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -a.
      Returns:
      the start time
    • getTaskSpecifier

      public TaskSpecifier getTaskSpecifier()
      Get the object that represents the array task specifier. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -t.
      Returns:
      the array task specifier
      See Also:
    • getUser

      public String getUser()
      Get the submitting user.
      Returns:
      the submitting user
    • getVerification

      public JobDescription.Verification getVerification()
      Get the verification level. See qsub -w.
      Returns:
      the verification level
    • getVersion

      public String getVersion()
      Get the JSV framework version.
      Returns:
      the JSV version
    • useShell

      public Boolean useShell()
      Get whether the job should be launched via a shell. Note that the return value will be null if the value has not been set. See qsub -shell.
      Returns:
      whether to use a shell
    • hasResourceReservation

      public Boolean hasResourceReservation()
      Get whether the job uses resource reservation. Note that the return value will be null if the value has not been set. See qsub -R.
      Returns:
      whether to use resource reservation
    • isRerunnable

      public Boolean isRerunnable()
      Get whether the job can be requeued during execd failure. Note that the return value will be null if the value has not been set. See qsub -r.
      Returns:
      whether the job can be requeued
    • doNotify

      public Boolean doNotify()
      Get whether the job should be sent warning signals before being suspended or terminated. Note that the return value will be null if the value has not been set. See qsub -notify.
      Returns:
      whether the job should get warning signals
    • mergeStreams

      public Boolean mergeStreams()
      Get whether the output and error streams should be written into the same file. Note that the return value will be null if the value has not been set. See qsub -j.
      Returns:
      whether to merge the streams
    • onHold

      public Boolean onHold()
      Get whether the job is submitted in the hold state. Note that the return value will be null if the value has not been set. See qsub -h.
      Returns:
      whether the job is submitted in the hold state
    • isBinary

      public Boolean isBinary()
      Get whether the job is binary. A true value means the job is treated as a binary. A false value means the job is treated as a script. Note that the return value will be null if the value has not been set. See qsub -b.
      Returns:
      whether the job is binary
    • getEnvironment

      public Map<String,String> getEnvironment()
      Get the job's environment variables. The object that is returned will be a copy of the internal object, so modifications to the returned object will have no effect on the JobDescription instance. See qsub -v.
      Returns:
      the environment variables
    • setAccount

      public void setAccount(String account)
      Set the value of the account string. See qsub -A.
      Parameters:
      account - the account string
    • setAdvanceReservationId

      public void setAdvanceReservationId(Integer advanceReservationId)
      Set the value of the advance reservation id. See qsub -ar.
      Parameters:
      advanceReservationId - the advance reservation id
    • setBinary

      public void setBinary(Boolean binary)
      Set whether the job is binary. See qsub -b.
      Parameters:
      binary - whether the job is binary
    • setCheckpointSpecifier

      public void setCheckpointSpecifier(CheckpointSpecifier checkpointSpecifier)
      Set the CheckpointSpecifier object that defines the checkpointing settings for the job. See qsub -ckpt -c.
      Parameters:
      checkpointSpecifier - the schpoint specifier
      See Also:
    • setCommandArgs

      public void setCommandArgs(String[] commandArgs)
      Set the job's command arguments.
      Parameters:
      commandArgs - the new command arguments
    • setWorkingDirectory

      public void setWorkingDirectory(String cwd)
      Set the working directory. See qsub -wd -cwd.
      Parameters:
      cwd - the working directory
    • setDeadline

      public void setDeadline(Calendar deadline)
      Set the deadline time. See qsub -dl.
      Parameters:
      deadline - the deadline time
    • setDisplay

      public void setDisplay(String display)
      Set the display string. See qsub -display.
      Parameters:
      display - the display string
    • setErrorPath

      public void setErrorPath(Map<String,String> path)
      Set the error path. See qsub -e.
      Parameters:
      path - the error path
    • setHardQueue

      public void setHardQueue(List<String> queues)
      Set the hard queue list. See qsub -hard -q.
      Parameters:
      queues - the hard queue list
    • setHardResourceRequirements

      public void setHardResourceRequirements(Map<String,String> resources)
      Set the hard resource requirements map. See qsub -hard -l.
      Parameters:
      resources - the hard resource requirements
    • setHold

      public void setHold(Boolean hold)
      Set whether the job should be submitted in hold state. See qsub -h.
      Parameters:
      hold - whether the job should be submitted in hold state
    • setHoldJobIds

      public void setHoldJobIds(List<String> jobIds)
      Set the list of job identifiers on which the job depeneds. See qsub -hold_jid.
      Parameters:
      jobIds - the job dependency list
    • setHoldArrayJobIds

      public void setHoldArrayJobIds(List<String> jobIds)
      Set the list of array job identifiers on which the job tasks depened. See qsub -hold_jid_ad.
      Parameters:
      jobIds - the array job dependency list
    • setInputPath

      public void setInputPath(Map<String,String> path)
      Set the input path. See qsub -i.
      Parameters:
      path - the error path
    • setJobContext

      public void setJobContext(Map<String,String> context)
      Set the job's context. See qsub -ac -dc -sc.
      Parameters:
      context - the job context
    • setJobShare

      public void setJobShare(Integer jobShare)
      Set the job's functional ticket share See qsub -js.
      Parameters:
      jobShare - the job share
    • setMailRecipients

      public void setMailRecipients(List<String> recipients)
      Set the list of email recipients to be notified on job events. See qsub -M.
      Parameters:
      recipients - the email list
    • setMailSpecifier

      public void setMailSpecifier(MailSpecifier mailSpecifier)
      Set the MailSpecifier object that represents when email notifications should be sent. See qsub -m.
      Parameters:
      mailSpecifier -
      See Also:
    • setMasterQueue

      public void setMasterQueue(List<String> queues)
      Set the master queue list. See qsub -masterq.
      Parameters:
      queues - the master queue list
    • setMergeStreams

      public void setMergeStreams(Boolean mergeStreams)
      Set whether the output and error streams should be merged. See qsub -j.
      Parameters:
      mergeStreams - whether to merge the streams
    • setName

      public void setName(String name)
      Set the job's name. See qsub -N.
      Parameters:
      name - the job name
    • setNotify

      public void setNotify(Boolean notify)
      Set whether the job should be sent warning signals before being suspended or terminated. See qsub -notify.
      Parameters:
      notify - whether the job shoud receive warning signals
    • setOutputPath

      public void setOutputPath(Map<String,String> path)
      Set the output path. See qsub -o.
      Parameters:
      path - the output path
    • setParallelEnvironment

      public void setParallelEnvironment(ParallelEnvironment pe)
      Set the ParallelEnvironment object that represent's the job's PE settings. See qsub -pe.
      Parameters:
      pe - the job PE
      See Also:
    • setBindingSpecifier

      public void setBindingSpecifier(BindingSpecifier binding)
      Set the BindingSpecifier object that represents the job to core binding settings. See qsub -binding.
      Parameters:
      binding - the job binding
      See Also:
    • setPriority

      public void setPriority(Integer priority)
      Set the job's priority. See qsub -p.
      Parameters:
      priority - the job priority
    • setProject

      public void setProject(String project)
      Set the job's project. See qsub -P.
      Parameters:
      project - the job project
    • setRerunnable

      public void setRerunnable(Boolean rerunnable)
      Set whether the job can be requeued in the event of execd failure. See qsub -R.
      Parameters:
      rerunnable - whether the job can be requeued
    • setResourceReservation

      public void setResourceReservation(Boolean reservation)
      Set whether the job should use resource reservation. See qsub -r.
      Parameters:
      reservation - whether the job should use resource reservation
    • setShell

      public void setShell(Boolean shell)
      Set whether the job should be launched by a shell. See qsub -shell.
      Parameters:
      shell - whether the job should use a shell
    • setShellPath

      public void setShellPath(Map<String,String> path)
      Set the job's shell path. See qsub -S.
      Parameters:
      path - the shell path
    • setSoftQueue

      public void setSoftQueue(List<String> queues)
      Set the job's soft queue list See qsub -soft -q.
      Parameters:
      queues - the soft queue list
    • setSoftResourceRequirements

      public void setSoftResourceRequirements(Map<String,String> resources)
      Set the job's soft resource requirements map. See qsub -soft -l.
      Parameters:
      resources - the soft resource requirements
    • setStartTime

      public void setStartTime(Calendar startTime)
      Set the job's start time. See qsub -a.
      Parameters:
      startTime - the start time
    • setTaskSpecifier

      public void setTaskSpecifier(TaskSpecifier taskSpecifier)
      Set the TaskSpecifier object that defines the job's array task settings. See qsub -t.
      Parameters:
      taskSpecifier - the task specifier
      See Also:
    • setVerification

      public void setVerification(JobDescription.Verification verification)
      Set the job's verification level. See qsub -w.
      Parameters:
      verification - the verification level
    • setEnvironment

      public void setEnvironment(Map<String,String> environment)
      Set the job's environment variable. See qsub -v.
      Parameters:
      environment - the environment variables
    • clone

      protected JobDescription clone()
      Overrides:
      clone in class Object