|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.zos.jdl.RunJobSpec
public class RunJobSpec
Defines the attributes for starting a child job or a stand-alone job.
An instance of this class is passed to self.runJob()
.
Example of using RunJobSpec
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)
Example of using RunJobSpec
with a resource Constraint
.
The constraint only chooses resources that belong to a specific resource group:
c = ContainsConstraint() c.setFact("resource.groups") c.setValue("webserver-group") spec = RunJobSpec() spec.setJobName("myChildJob") spec.setConstraint(c) self.runJob(spec)Example of starting a stand-alone job. The new Job will not be a child job of the current job.
spec = RunJobSpec() spec.setJobName("quickie") spec.setInstanceName("quickie stand-alone") spec.setJobArgs( { "numJoblets" : 5 } ) spec.setStandAlone(True) self.runJob(spec)
Constructor Summary | |
---|---|
RunJobSpec()
Construct a default RunJobSpec. |
Method Summary | |
---|---|
void |
setConstraint(Constraint constraint)
Set an additional constraint to use for the new job instance. |
void |
setInstanceName(java.lang.String instanceName)
Define a job instance name. |
void |
setJobArgs(org.python.core.PyDictionary arguments)
Define the job arguments to supply to the child job. |
void |
setJobName(java.lang.String jobName)
Define the deployed job name of the child job to run. |
void |
setJobTracing(boolean tracing)
Enable or disable job and joblet tracing (for debug purposes). |
void |
setPolicy(java.lang.String policy)
Set an additional policy of constraints to use for the new job instance. |
void |
setPolicyName(java.lang.String policyName)
Set an additional previously deployed policy of constraints to use for the new job instance. |
void |
setPriority(int priority)
Set a priority for this job using supplied integer constant. |
void |
setPriority(java.lang.String priority)
Set a priority for this job using supplied string. |
void |
setStandAlone(boolean standAlone)
Indicates that the new job will not be a child job but a new stand alone job. |
void |
setStartTime(long time)
Set the start time for this job based on number of milliseconds since epoch. |
void |
setStartTime(java.lang.String time)
Set the start time for this job using a supplied date/time string. |
void |
setWaitForCompletion(boolean waitForCompletion)
Indicates that the runjob() invocation waits until the
child job has completed running. |
void |
setWaitForRunning(boolean waitForRunning)
Indicates that the runjob() invocation waits until the
child job has transitioned to the Running state. |
void |
setWaitForStarting(boolean waitForStarting)
Indicates that the runjob() invocation waits until the
child job has transitioned to the Starting state. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RunJobSpec()
Method Detail |
---|
public void setJobArgs(org.python.core.PyDictionary arguments)
jobargs
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.
arguments
- Dictionary of job argument name and value pairspublic void setJobTracing(boolean tracing)
tracing
- true to enable tracing, false to use job defaultpublic void setJobName(java.lang.String jobName)
jobName
- Deployed job name of child job to runpublic void setInstanceName(java.lang.String instanceName)
instanceName
- Job instance namepublic void setPriority(java.lang.String priority)
priority
- Priority to set in the user's bandpublic void setPriority(int priority)
priority
- Priority to set in the user's bandpublic void setStartTime(long time)
time
- Milliseconds since epochpublic void setStartTime(java.lang.String time)
Examples:
"2/15/07" "2/15/07 5 PM" "8 AM"Optional.
time
- date/time string to start the jobpublic void setPolicy(java.lang.String policy)
policy
- Policy textpublic void setPolicyName(java.lang.String policyName)
policyName
- Name of an already deployed policypublic void setConstraint(Constraint constraint)
constraint
- Constraint instancepublic void setStandAlone(boolean standAlone)
standAlone
- true to create a new stand alone job, false (default) to create a child jobpublic void setWaitForStarting(boolean waitForStarting)
runjob()
invocation waits until the
child job has transitioned to the Starting
state.
A Job instance will not transition to Starting
if it
is Queued
.
waitForStarting
- true to wait, false (the default) to not waitpublic void setWaitForRunning(boolean waitForRunning)
runjob()
invocation waits until the
child job has transitioned to the Running
state.
While a job instance is still in the Starting
state, it will
queue any events. The Starting
state is best viewed as the
job instance is still in construction.
waitForRunning
- true to wait, false (the default) to not waitpublic void setWaitForCompletion(boolean waitForCompletion)
runjob()
invocation waits until the
child job has completed running. This includes failures and cancellation.
Example of starting a job and waiting for the job to end.
spec = RunJobSpec() spec.setJobName("quickie") spec.setInstanceName("quickie child") spec.setJobArgs( { "numJoblets" : 5 } ) spec.setWaitForCompletion(True) childJob = self.runJob(spec) if childJob.getFact("jobinstance.state") == Job.COMPLETED_STATE: print "Child job ran successfully" else: print "Child job did not run succesfully"
waitForCompletion
- true to wait, false (the default) to not wait
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |