|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.zos.jdl.JobletParameterSpace
public class JobletParameterSpace
JobletParameterSpace is a slice of the ParameterSpace allocated to a Joblet.
As the scheduler defines slices of the parameter space for a given
schedule()
, JobletParameterSpace instances are created for each Joblet.
This slice of the parameter space is delivered to the resource on Joblet execution.
The JobletParameterSpace can also be retrieved from the Joblet object.
Example of constructing a two row two column ParameterSpace in which schedule()
will create a JobletParameterSpace
instance:
class MyJob(Job): job_started_event(self): ps = ParameterSpace() ps.appendRow( { "column1" : "row1 col1", "column2" :"row1 col2" } ) ps.appendRow( { "column1" : "row2 col1", "column2" :"row2 col2" } ) self.schedule(MyJoblet,ps,{})
Example of retrieving the JobletParameterSpace
instances
in the Joblet. Here the Joblet iterates over the two rows and prints the
row contents:
class MyJoblet(Joblet): joblet_started_event(self): rowno = 0 parameterSpace = self.getParameterSpace() while parameterSpace.hasNext(): row = parameterSpace.next() col1 = row["column1"] col2 = row["column2"] print "row %d col1=%s col2=%s" % (rowno,col1,col2) rowno += 1
Method Summary | |
---|---|
org.python.core.PyDictionary |
getFirst()
Returns a dictionary representing the first row in the parameter space iteration. |
org.python.core.PyDictionary |
getLast()
Returns a dictionary representing the last row in the parameter space iteration. |
boolean |
hasNext()
Returns True if the iteration has more elements. |
org.python.core.PyDictionary |
next()
Returns a dictionary representing a row in the parameter space iteration. |
void |
reset()
Reset iteration to beginning. |
int |
size()
Return number of rows in this ParameterSpace |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public int size()
public boolean hasNext()
public org.python.core.PyDictionary next()
NoSuchElementException
- iteration has no more elements.public org.python.core.PyDictionary getFirst()
Each element of the returned dictionary represents a column in the parameter space row.
public org.python.core.PyDictionary getLast()
Each element of the returned dictionary represents a column in the
parameter space row. If parameter space iteration only contains one
row then this returns the same row as getFirst()
public void reset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |