Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

Scope

Process Classes for use with JobScheduler Agents

...

  • Create the following job, e.g. setAgent, and add it to the job chain as the forerunner of the JobScheduler Agent job.

    This job modifies the process_class setting of the successor job in the job chain according to the order parameters agent_host_ and _agent_port:

    Code Block
    languagehtml/xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <job  order="yes" stop_on_error="no">
        <params />
    
        <script  language="java:javascript"><![CDATA[
    		function spooler_process() {
    
    			var curOrder = spooler_task.order;
    			var agentHost = curOrder.params.value('agent_host');
    			var agentPort = curOrder.params.value('agent_port');
    			var nextJob = curOrder.job_chain_node.next_node.job;
    
    			spooler_log.info("Params agentHost:agentPort = "+agentHost+":"+agentPort);
    			spooler_log.info("before: "+nextJob.process_class.remote_scheduler);
    
    	        nextJob.process_class.remote_scheduler = agentHost+":"+agentPort;
    			spooler_log.info("after: "+nextJob.process_class.remote_scheduler);
    			return true;
    		}
        ]]></script>
    
        <run_time />
    </job>

...

  • Add an order to the job chain jobChainWithAgentJob for each JobScheduler Agent.

    For example, one JobScheduler Agent runs on HostA with port 4444 and another JobScheduler Agent runs on HostB with port 4444. The order has to be assigned the parameters agent_host_ and _agent_port.


    This should result in the order configuration files ./config/live/jobChainWithAgentJob,hostA-4444.order.xml and ./config/live/jobChainWithAgentJob,hostB-4444.order.xml:

    Code Block
    languagehtml/xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <order>
        <params >
            <!-- for use with JobScheduler releases before 1.10
            <param  name="agent_host" value="HostA"/>
            -->
            <!-- for use with JobScheduler releases starting with 1.10 -->
            <param  name="agent_host" value="http://HostA"/>
    
            <param  name="agent_port" value="4444"/>
        </params>
        <run_time/>
    </order>
    
    Code Block
    languagehtml/xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <order>
        <params >
            <!-- for use with JobScheduler releases before 1.10
            <param  name="agent_host" value="HostB"/>
            -->
            <!-- for use with JobScheduler releases starting with 1.10 -->
            <param  name="agent_host" value="http://HostB"/>
            <param  name="agent_port" value="4444"/>
        </params>
        <run_time/>
    </order>