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..

Methods:

Detail:

getFirst()

Returns a dictionary representing the first row in the parameter space iteration. Each element of the returned dictionary represents a column in the parameter space row.

Returns: Dictionary representing the first row in the iteration.

getLast

Returns a dictionary representing the last row in the parameter space iteration. 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()

Returns: Dictionary representing the last row in the iteration.

hasNext()

Returns true if the iteration has more elements.

Returns: true if the iterator has more elements.

next()

Returns a dictionary representing a row in the parameter space iteration. Each element of the returned dictionary represents a column in the parameter space row.

Returns: Dictionary representing the next element in the iteration.

Raises: NoSuchElementException - iteration has no more elements.

reset()

Resets the iteration to beginning.

size()

Return number of rows in this ParameterSpace.

Returns: Number of rows.

Files

/etc/opt/novell/zenworks/zmd/zmd.conf

Configuration file. Options such as proxy and cache settings can be adjusted through this file directly or with the rug set command.

/etc/init.d/novell-zmd

Initialization script. It is recommended that you use this script to start and stop zmd, rather than running it directly.

/var/opt/novell/log/zenworks/zmd-messages.log

Log file.

/var/opt/novell/zenworks/cache/zmd

Cached information from servers.

/etc/opt/novell/zenworks/zmd/initial-service

Url for the ZENworks service that zmd will use at initial startup. You can optionally specify a registration key on the next line.

Examples

Example of constructing a two-row and two-column ParameterSpace in which schedule() creates 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

See Also

Javadoc: JobletParameterSpace