com.novell.zos.jdl
Class ScheduleSpec

java.lang.Object
  extended by com.novell.zos.jdl.ScheduleSpec

public class ScheduleSpec
extends java.lang.Object

The ScheduleSpec class defines one or more Joblets to be scheduled and run on resources.
A ScheduleSpec instance is passed to the Job's schedule() or scheduleSweep(). schedule() creates the Joblets and schedules Joblets to run on resources.

Example of using a ScheduleSpec to schedule a single Joblet:

      s = ScheduleSpec()
      s.setJobletClass(MyJoblet)
      self.schedule(s)
 
This class can only allowed be used in the Job class for passing to schedule() or for getting the list of matching resources from getMatchingResources().


Field Summary
static int ACTIVE_NODE_SET
          Used to specify that the Joblet set will be constructed after applying resource constraints to the set of active/online resources.
static int PROVISIONABLE_NODE_SET
          Used to specify that the Joblet set will be constructed after applying resource constraints to the set of provisionable resources.
 
Constructor Summary
ScheduleSpec()
          Construct a ScheduleSpec with defaults.
 
Method Summary
 int getCount()
          Retrieve number of Joblets created for this set.
 void setConstraint(Constraint constraint)
          Assign a Constraint for resource selection.
 void setConstraint(java.lang.String constraint)
          Assign a Constraint in XML for resource selection.
 void setCount(int count)
          Assign the maximum number of Joblets to create for this set.
 void setJobletArgs(org.python.core.PyDictionary facts)
          Define facts for this jobletargs namespace for a Joblet.
 void setJobletClass(org.python.core.PyType jobletClass)
          Assign the Joblet Class to use for Joblet execution on the resource.
 void setJobletFacts(org.python.core.PyDictionary facts)
          Define additional joblet facts for this ScheduleSpec.
 void setUseNodeSet(int nodeSet)
          If set to PROVISIONABLE_NODE_SET, the Joblet set will be constructed after applying resource constraints to the set of provisionable resources.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVE_NODE_SET

public static int ACTIVE_NODE_SET
Used to specify that the Joblet set will be constructed after applying resource constraints to the set of active/online resources.


PROVISIONABLE_NODE_SET

public static int PROVISIONABLE_NODE_SET
Used to specify that the Joblet set will be constructed after applying resource constraints to the set of provisionable resources.

Constructor Detail

ScheduleSpec

public ScheduleSpec()
Construct a ScheduleSpec with defaults.

Method Detail

setCount

public void setCount(int count)
Assign the maximum number of Joblets to create for this set. This value overrides the setMaxJobleSize in ParameterSpace.

Parameters:
count - Number of Joblets to create

getCount

public int getCount()
Retrieve number of Joblets created for this set. Only valid after scheduleSweep().

Returns:
Number of Joblets created

setJobletClass

public void setJobletClass(org.python.core.PyType jobletClass)
Assign the Joblet Class to use for Joblet execution on the resource.

Parameters:
jobletClass - Reference to Joblet class to execute on node

setConstraint

public void setConstraint(Constraint constraint)
Assign a Constraint for resource selection.
This additional Constraint is AND'd to any existing constraints including the aggregated Policies.
  constraint = EqConstraint()
  constraint.setFact("resource.os.name")
  constraint.setValue("Windows XP")

  spec = ScheduleSpec()
  spec.setJobletClass(MyJoblet)
  spec.setConstraint(constraint)
 
Note: This can only be used with scheduleSweep(). Constraints are not currently supported with schedule().

Parameters:
constraint - Constraint for resource selection

setConstraint

public void setConstraint(java.lang.String constraint)
Assign a Constraint in XML for resource selection.
This additional Constraint is AND'd to any existing constraints including the aggregated Policies.
      spec = ScheduleSpec()
      spec.setJobletClass(MyJoblet)
      spec.setConstraint("")
 
Note: This can only be used with scheduleSweep(). Constraints are not currently supported with schedule().

Parameters:
constraint - Constraint as XML for resource selection

setUseNodeSet

public void setUseNodeSet(int nodeSet)
If set to PROVISIONABLE_NODE_SET, the Joblet set will be constructed after applying resource constraints to the set of provisionable resources. If ACTIVE_NODE_SET (the default) the active or online set of resources will be used instead.
      spec = ScheduleSpec()
      spec.setUseNodeSet(ScheduleSpec.PROVISIONABLE_NODE_SET)
  

Parameters:
nodeSet - true to reference provisionable set of nodes rather than active set.

setJobletArgs

public void setJobletArgs(org.python.core.PyDictionary facts)
Define facts for this jobletargs namespace for a Joblet. Each Joblet created for this schedulet gets a copy of this set of Joblet arguments facts.

Parameters:
facts - Dictionary of facts to add to each Joblet's factset

setJobletFacts

public void setJobletFacts(org.python.core.PyDictionary facts)
Define additional joblet facts for this ScheduleSpec. Each Joblet created for this set inherits the base set of Joblet facts and any facts supplied to this function.

Parameters:
facts - Dictionary of facts to add to each Joblet factset


Copyright (c) 2011 Novell, Inc. All rights reserved.