Table of Contents |
---|
Scope
- Components for dependency handling
- Download & Deployment information
Download & Deployment
- JobScheduler
Display feature availability EndingWithRelease 1.8 StartingFromRelease 1.7 - This feature requires Java 1.7 to be available. It will not work with Java 1.8 and therefore not with JobScheduler releases starting from 1.9.
This patch is available from the attached file com.sos.csi.patch.jar
To deploy this patch
- copy the jar file to the directory
$SCHEDULER_HOME/patch
(create this folder if is does not existi) - open the file
$SCHEDULER_DATA/config/factory.ini
- navigate to the section java
- change the
class_path
configuration toclass_path = ${SCHEDULER_HOME}/patch/com.sos.csi.patch.jar:${SCHEDULER_HOME}/lib:....
restart JobScheduler
- Attached archive contains the below mentioned files for the
dependency
folder: dependency.zip - The archive should be extracted to a subfolder of the JobScheduler
live/sos
directory, i.e. g.$SCHEDULER_DATA/config/live/csisos/dependency
.
...
Global Setting:
...
scheduler.ignore_sync_jobs_in_stopped_jobchains
- Dependency handling requires This patch contains the new option
scheduler.ignore_sync_jobs_in_stopped_jobchains
Enabling this option by setting the scheduler variable in the configuration file
$SCHEDULER_DATA/scheduler.xml
totrue
will ignore synchronization nodes that are part of stopped job chains for all instances of synchronization jobs.Code Block language xml title Configuration in file scheduler.xml <spooler> <config> <param name="scheduler.ignore_sync_jobs_in_stopped_jobchains" value="true"/> ...
It is also possible to enable this option per job by adding a job parameter like this:
Code Block language xml title Configuration by job parameter <job order="yes"> <params > <param name="scheduler.ignore_sync_jobs_in_stopped_jobchains" value="true"/> </params> ...
Folder: dependency
- This folder provides the components required to implement dependency handling.
- This folder should be located below the JobScheduler
live
directory.
Function Set: dependency.js
- This function set provides basic capabilities for dependency checking
- This function set is used by the following job Monitor Scripts:
jobnet_check_predecessor.js
jobnet_check_successor.js
Job: jobnet_check_predecessor.job.xml
Usage
- Sample job for a job step that provides dependency checking.
- This job is added to the beginning of a job chain.
- This job step is added the job node state
jobnet_start.
Sample
Job Implementation
- The job implements an arbitrary job body.
- Dependency handling is implemented by the Monitor Script.
- The Monitor Script includes two files:
jobnet_check_predecessor.js
dependency.js
- When creating individual job implementations then no invidual implementation of the Monitor Script should be effected but the below-mentioned script files should be included as they are subject to future improvement.
- The Monitor Script includes two files:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="ISO-8859-1"?> <job order="yes" stop_on_error="no" title="check jobnet predecessors"> <script language="javax.scriptjava:rhinojavascript"> <![CDATA[ spooler_log.info("checking jobnet predecessors"); ]]> </script> <monitor ordering="0" name="monitor"> <script language="javax.scriptjava:rhinojavascript"> <include file="config/live/csisos/dependency/jobnet_check_predecessor.js"/> <include file="config/live/csisos/dependency/dependency.js"/> </script> </monitor> <run_time /> </job> |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function spooler_process_after( spooler_process_result ) { spooler_log.info( "spooler_process_after(): checking jobnet predecessor" ); if ( spooler_process_result ) { // check if predecessor job chains exists and will start in period if ( isPredecessorJobChainInPeriod() ) { spooler_log.info( "spooler_process_after(): predecessor job chain will start later in period, order execution postponed, moving order to final state: " + getStateSkip() ); var order = spooler_task.order(); order.set_state( getStateSkip() ); } else { spooler_log.info( "spooler_process_after(): no predecessor job chain found for consideration that will start later in period, order is continued" ); } } else { spooler_log.info( "spooler_process_after(): no predecessor checking due to failed job processing" ); } return spooler_process_result; } |
Job: jobnet_check_successor.job.xml
Usage
- Sample job for a job step that provides dependency checking.
- This job is added to the end of a job chain.
- This job step is added the job node state
jobnet_end
.
Sample
- see job
jobnet_check_successor
from the above screenshot
Job Implementation
- This job implements an arbitrary job body.
- Dependency handling is implemented by the Monitor Script.
- The Monitor Script includes two files:
jobnet_check_successor.js
dependency.js
- When creating individual job implementations then no invidual implementation of the Monitor Script should be effected but the below-mentioned script files should be included as they are subject to future improvement.
- The Monitor Script includes two files:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="ISO-8859-1"?> <job order="yes" stop_on_error="no" title="check jobnet successors"> <script language="javax.scriptjava:rhinojavascript"> <![CDATA[ spooler_log.info("checking jobnet successors"); ]]> </script> <monitor ordering="0" name="monitor"> <script language="javax.script:rhino"> <include file="config/live/csisos/dependency/jobnet_check_successor.js"/> <include file="config/live/csisos/dependency/dependency.js"/> </script> </monitor> <run_time /> </job> |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function spooler_process_after( spooler_process_result ) { spooler_log.info( "spooler_process_after(): checking jobnet successor" ); if ( spooler_process_result ) { // start orders for successor job chains var numOfOrders = startSuccessorJobChains(); if ( numOfOrders > 0 ) { spooler_log.info( "spooler_process_after(): " + numOfOrders + " orders for successor job chains started" ); } else { spooler_log.info( "spooler_process_after(): no successor job chain found for consideration, no orders started" ); } } else { spooler_log.info( "spooler_process_after(): no successor checking due to failed job processing" ); } return spooler_process_result; } |
Anchor | ||||
---|---|---|---|---|
|
- The following components are included with the folder
dependency
Job Chain: jobnet_reset_job_chains.job_chain.xml
- The job chain makes use of only one job
jobnet_reset_job_chains.job.xml
, see below.
Job: jobnet_reset_job_chains.job.xml
Usage
- Standard job that is used to toggle the state of job chains for dependency checking. Job chains present one of these states:
running
: the job chain is active and dependency checking is performedstopped
: the job chain is inactive, no dependency checking is performed.
Job Implementation
- This job implements the operations to toggle the state of one or multiple job chains.
- The effective processing is implemented by JavaScript.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="ISO-8859-1"?> <job order="yes" stop_on_error="no" title="reset job chaines to unstopped or stopped state"> <script language="javax.scriptjava:rhinojavascript"> <include file="config/live/csi/dependency/jobnet_reset_job_chains.js"/> <include file="config/live/csi/dependency/dependency.js"/> </script> <run_time /> </job> |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
function spooler_process( ) { spooler_log.info( "spooler_process(): reset job chains in jobnet" ); var numOfModifiedJobChains = toggleJobChainState(); spooler_log.info( "spooler_process(): " + numOfModifiedJobChains + " job chains modified" ); return true; } |
Order: jobnet_reset_job_chains.order.xml
- This is a sample order that shows how job chains could be selected for activation and deactivation.
- Parameters
operation
: the toggling operation- Values
activate
: modify the state of stopped job chains torunning
deactivate
: modify the state of running job chains tostopped
- Default Value
activate
- Values
input_list
:- Values
- A comma separated list of job chain paths
- Default Value
- none
- Values
input_file
:- Values
- the location of a file that contains one job chain path per line
- Default Value
- none
- Values
- Behaviour
- Without parameters being specified all job chains will be activated.
- Without the parameters
input_list
andinput_file
being specified the operation is applied to all job chains. - Should in addition to the parameter
input_list
the parameter aninput_file
be specified then both specifications of job chains are merged.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="ISO-8859-1"?> <order title="reset job chaines to unstopped or stopped state"> <params > <param name="operation" value="deactivate"/> <param name="input_list" value="csijobnet/examples/JobChain_B/job_chain_B,csi/examples/JobChain_D/job_chain_D"/> <param name="input_file" value="csijobnet/jobnet_reset_job_chains.txt"/> </params> <run_time let_run="no"> <period single_start="24:00"/> </run_time> </order> |
...
Notes
- Dependency Hnandling Scripts and Monitor Scripts are
- implemented for the Rhino scripting engine up to Java 1.7
- with JobScheduler release 1.7 and 1.8.
- not available with the Nashorn engine that is introduced with Java 1.8
- and is required for JobScheduler release 1.9.