RunJobSpec

Defines the attributes for starting a child job. An instance of this class is passed to self.runJob().

Constructor

RunJobSpec Construct a default RunJobSpec.

Methods

Summary:

RunJobSpec()

Construct a default RunJobSpec.

setJobArgs(PyDictionary arguments)

Define the job arguments to supply to the child job. These are any facts defined in policy for the <code>jobargs</code> namespace. If job arguments are required by the job then the arguments are required. This function is not use if no job arguments are defined for the job to run.

getJobArgs()

setJobTracing(boolean tracing)

Enable or disable job and joblet tracing (for debug purposes).

isJobTracing()

setJobName(String jobName)

Define the deployed job name of the child job to run. Required.

getJobName()

setInstanceName(String instanceName)

Define a job instance name. The default is to use the deployed job name as the instance name. Optional.

getInstanceName()

setPriority(String priority)

Set a priority for this job using supplied string. Default is the user's priority. Optional.

setPriority(int priority)

Set a priority for this job using supplied integer constant. Default is the user's priority. Optional.

getPriority()

setStartTime(long time)

Set the start time for this job based on number of milliseconds since epoch. Optional.

setStartTime(String time)

Set the start time for this job using a supplied date/time string. <p>Examples:</p> <pre> "2/15/07" "2/15/07 5 PM" "8 AM" </pre> Optional.

getStartTime()

setPolicy(String policy)

Set an additional policy of constraints to use for the new job instance. Optional

getPolicy()

setPolicyName(String policyName)

Set an additional previously deployed policy of constraints to use for the new job instance. The policy must already exist. Optional.

getPolicyName()

setConstraint(Constraint constraint)

Set an additional constraint to use for the new job instance. Optional.

getConstraint()

Examples

  • RunJobSpec here is used for starting a child job with a custom instance name and supplying a job argument:

    spec = RunJobSpec() spec.setJobName("quickie") spec.setInstanceName("quickie child") spec.setJobArgs( { "numJoblets" : 5 } ) self.runJob(spec) 
    
  • RunJobSpec here is used with a Constraint to constrain that a resource belongs to a group and use the constraint in starting a child job:

    c = ContainsConstraint() c.setFact("resource.groups") c.setValue("webserver-group") spec = RunJobSpec() spec.setJobName("myChildJob") spec.setConstraint(c) self.runJob(spec)
    

See Also

Javadoc: RunJobSpec