Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor changes to text

...

The Join Orders Job (JobSchedulerJoinOrders) is a JITL Job and is used to join up two parallel executing child segments in a Job Chain. It then continues processing in a single thread once processing of the parallel threads has been completed. It is used in two Job Chain Patterns - Split and Join and "Y".

This article describes how the Join Orders Job can be used in a "Y" pattern - the How to Execute Jobs in a Job Chain in Parallel article describes it its use in a Split and Join pattern.

...

The Job Chain

The Job Chain ..is shown in the diagram near the top of this article and is listed in the code block below.

Code Block
languagexml
titleThe y_join Job Chain
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>
<job_chain  title="Y Join">
    <job_chain_node  state="100" job="generate_orders" next_state="wait" error_state="error"/>
    <job_chain_node  state="150" job="job_a" next_state="join" error_state="error" delay="10"/>
    <job_chain_node  state="wait" job="wait" next_state="join" error_state="error"/>
    <job_chain_node  state="join" job="join" next_state="200" error_state="error"/>
    <job_chain_node  state="200" job="job_b" next_state="success" error_state="error"/>
    <job_chain_node  state="success"/>
    <job_chain_node  state="error"/>
</job_chain>

...

The configuration of the Join Orders Job is set using the JITL Job Wizard and shown in following code block. Relevant for Users users in the following listing is the show_join order list parameter which may be optionally set (default is false). Setting this Parameter to true causes a list of all the orders counted by the Join Orders Job to be written to the Log log file for the Parent Order.

Code Block
languagexml
titleThe y_join Job Chain
linenumberstrue
collapsetrue
<?xml version="1.0" encoding="ISO-8859-1"?>

<job  order="yes" stop_on_error="no" idle_timeout="60" title="Join Job">
    <settings >
        <log_level ><![CDATA[debug9]]></log_level>
        <history_on_process ><![CDATA[0]]></history_on_process>
        <history_with_log ><![CDATA[gzip]]></history_with_log>
    </settings>
    <params >
        <param  name="show_join_order_list" value="true"/>
    </params>
    <script  language="java" java_class_path="" java_class="com.sos.jitl.join.JobSchedulerJoinOrdersJSAdapterClass"/>
    <run_time />
</job>

 

The generate_orders Job

The configuration of the generate_orders Job is shown in the next code block along with the script responsible for the generation of the Child Orders.

...

  • This Job contains a script that generates the Child Orders (see lines 20 - 31 of the listing).
    • The Orders are alternated between the two branches of the Job Chain (even numbered Orders start at the Job corresponding with the Order state 150 and odd numbered Orders at the Job corresponding with the Order state 160). All Child Orders terminate at the Join Orders Job.
    • The total number of orders generated is determined by the generate_orders parameter.
The wait Job

The Wait Job is configured to read the wait_time parameter and execute a simple script (i.e. ping local host). This script causes the Job to wait for the number of seconds specified in the parameter.

...