Date: Fri, 29 Mar 2024 11:34:04 +0000 (UTC) Message-ID: <22476403.12823.1711712044422@change.sos-berlin.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_12822_158929752.1711712044422" ------=_Part_12822_158929752.1711712044422 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
./config/live/
of you=
r JobScheduler installation.parallel_job_instances=
.
query
job..prepare
job is used to dynamically calculate=
the number of parallel instances of the query
job. This job c=
reates an order parameter parallel_executions=3D5
for use with=
the subsequent generate
job.generate
job implements the solution by creating the n=
umber of orders specified by the parallel_executions
parameter=
.
number_of_orders
: a copy of the parallel_executions<=
/code> parameter.
order_sequence
: the sequence number of the order created. =
The sequence starts from 1 up to the value of the parallel_executions=
parameter.join_required_orders
: the number of orders that the join j=
ob waits for. This includes the value of the parallel_execu=
tions
parameter incremented by 1 for the main order. The prefix=
join of the parameter name reflects the state that the join=
em> job node is assigned in the job chain.query
job, i.e. the orders will be executed sta=
rting with that state.query
job is configured for a maximum number of 3 para=
llel tasks via the attribute <job tasks=3D"3">
. It could=
be configured for any number of parallel tasks. For the sake of this sampl=
e the limitation shows the behavior of the job to wait for processes to bec=
ome free that could be assigned to subsequent orders for the same job.com.sos.jitl.join.JobSchedul=
erJoinOrdersJSAdapterClass
.
generate
job you can
<include>
element for individual=
job scripts.
<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?> <job order=3D"yes" stop_on_error=3D"no" title=3D"Generate orders for pa= rallel processing" name=3D"generate"> <params > <param name=3D"join_state_name" value=3D"join"/> </params> <script language=3D"java:javascript"> <![CDATA[ function spooler_process(){ =20 var currentJobChain =3D spooler_task.order.job_chain; var currentJobChainName =3D spooler_task.order.job_chain.name; params =3D spooler.create_variable_set(); params.merge( spooler_task.params ); params.merge( spooler_task.order.params ); var numOfOrders =3D params.value("parallel_executions"); spooler_log.info(" creating " + numOfOrders + " orders"); =20 var joinParameterName =3D currentJobChainName + "_required_orders"; var numOfRequiredOrders =3D parseInt( numOfOrders )+1; params.set_var( joinParameterName, numOfRequiredOrders ); =20 for (var i =3D 1; i <=3D numOfOrders; i++) {=20 var subOrder =3D spooler.create_order() var subParams =3D spooler.create_variable_set(); subParams.set_var( "number_of_orders", numOfOrders ); subParams.set_var( "order_sequence", i ); subParams.set_var( syncParameterName, numOfRequiredOrders ); subOrder.params =3D subParams; subOrder.state =3D spooler_task.order.job_chain_node.next_state; subOrder.end_state =3D params.value( "join_state_name" ); currentJobChain.add_order( subOrder ); spooler_log.info( "order has been added: " + i ); } spooler_task.order.params.set_var( joinParameterName, numOfRequiredOrders= ); spooler_task.order.state =3D params.value( "join_state_name" ); return true; } ]]> </script> <run_time /> </job>
parallel_execution
job chain using the JOC Cockpit.synchronize
job node.query
job will arrive a=
t the join job node and will wait for all the parallel orders to b=
e completed. When all the orders have been completed the processing will co=
ntinue with the do_something
job.