Skip to main content Skip to complementary content

Using the Multi-thread Execution feature to run Jobs in parallel

Based on the previous use case Using the output stream feature, this use case give an example of how to use the Multi-thread Execution feature to run two Jobs in parallel to display the employees information in both the testing and production environments at the same time. When handling large data volumes, this feature can significantly optimize the Job execution performance of the Talend Studio.

For more information, see Using parallelization to optimize Job performance.

Preparing Jobs to read employees data in different contexts

Procedure

  1. In the Repository tree view, right-click the Job created in the use case Using the output stream feature and select Duplicate from the context menu. Then, in the Duplicate dialog box enter a new name for the Job, employees_testing in this example, and click OK.
    Screenshot of the Duplicate dialog box.
  2. Open the new Job, and label the components to better reflect their roles.
    Screenshot of the Job in the Designer.
  3. Create another Job named employees_production by repeating the steps above.
    Screenshot of the Job in the Designer.
  4. In the Context view of both Jobs, remove the db_connection variable.
  5. On Extra tab of the Job view of the Job employees_testing, fill the Table Name field of database settings with db_testing; on the Extra tab of the Job view of the Job employees_production, fill the Table Name field with db_production.
    Screenshot of the Job extra parameters.

Set up a parent Job to run the Jobs in parallel

Procedure

  1. Create a new Job and add two tRunJob components on the design workspace, and label the components to better reflect their roles.
    Screenshot of the Job in the Designer.
  2. In the Component view of the first tRunJob component, click the [...] button next to the Job field and specify the Job it will run, employees_testing in this example.
  3. Configure the other tRunJob component to run the other Job, employees_production.
    Screenshot of the component basic settings.
  4. On the Extra tab of the Job view, select the Multi thread execution check box to activate the Multi-thread Execution feature.

Executing the Jobs

Procedure

  1. Save each Job by pressing Ctrl+S.
  2. In the parent Job, press F6 of click Run on the Run view to start execution of the child Jobs.

    The child Jobs are executed in parallel, reading employees data from both databases and displaying the data on the console.

    Screenshot of the console after successfully running the Job.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!