tLibraryLoad - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Function

tLibraryLoad allows you to import a library.

Purpose

tLibraryLoad allows you to load useable Java libraries in a Job.

If you have subscribed to one of the Talend solutions with Big Data, this component is available in the following types of Jobs:

tLibraryLoad properties

Component Family

Custom Code

 

Basic settings

Library

Select the library you want to import from the list, or click on the [...] button to browse to the library in your directory.

Advanced settings

Dynamic Libs

Lib Paths: Enter the access path to your library, between double quotation marks.

 

Import

Enter the Java code required to import, if required, the external library used in the code editing field of the Basic settings tab of the components such as tJava,or tJavaFlex.

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage

This component may be used alone, although it is more logical to use it as part of a Job.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

The library is loaded locally.

Scenario: Checking the format of an e-mail address

This scenario uses two components, a tLibraryLoad and a tJava. The goal of this scenario is to check the format of an e-mail address and verify whether the format is valid or not.

Setting up the Job

  1. In the Palette, open the Custom_Code folder, and slide a tLibraryLoad and tJava component onto the workspace.

  2. Connect tLibraryLoad to tJava using a Trigger > OnSubjobOk link.

Configuring the tLibraryLoad component

  1. Double-click on tLibraryLoad to display its Basic settings. From the Library list, select jakarta-oro-2.0.8.jar.

  2. In the Import field of the Advanced settings tab, type import org.apache.oro.text.regex.*;

Configuring the tJava component

  1. Double-click on tJava to display its Component view.

  2. In the Basic settings tab, enter your code, as in the screenshot below. The code allows you to check whether the character string pertains to an e-mail address, based on the regular expression: "^[\\w_.-]+@[\\w_.-]+\\.[\\w]+$".

Job execution

Press F6 to save and run the Job.

The Console displays the boolean false. Hence, the e-mail address is not valid as the format is incorrect.

tLibraryLoad in Talend Map/Reduce Jobs

Warning

The information in this section is only for users that have subscribed to one of the Talend solutions with Big Data and is not applicable to Talend Open Studio for Big Data users.

In a Talend Map/Reduce Job, tLibraryLoad, as well as the whole Map/Reduce Job using it, generates native Map/Reduce code. This section presents the specific properties of tLibraryLoad when it is used in that situation. For further information about a Talend Map/Reduce Job, see the Talend Big Data Getting Started Guide.

Component Family

Custom Code

 

Basic settings

Library

Select the library you want to import from the list, or click on the [...] button to browse to the library in your directory.

Advanced settings

Dynamic Libs

Lib Paths: Enter the access path to your library, between double quotation marks.

 

Import

Enter the Java code required to import, if required, the external library used in the code editing field of the Basic settings tab of the components such as tJavaMR in a Map/Reduce Job.

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Usage in Map/Reduce Jobs

In a Talend Map/Reduce Job, this component is used standalone. It generates native Map/Reduce code that can be executed directly in Hadoop.

You need to use the Hadoop Configuration tab in the Run view to define the connection to a given Hadoop distribution for the whole Job.

This connection is effective on a per-Job basis.

For further information about a Talend Map/Reduce Job, see the sections describing how to create, convert and configure a Talend Map/Reduce Job of the Talend Big Data Getting Started Guide.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents only Standard Jobs, that is to say traditional Talend data integration Jobs, and non Map/Reduce Jobs.

Limitation

The library is loaded locally.

Related scenarios

No scenario is available for the Map/Reduce version of this component yet.

tLibraryLoad in Spark Batch Jobs

Component Family

Custom Code

 

Basic settings

Library

Select the library you want to import from the list, or click on the [...] button to browse to the library in your directory.

 Advanced settings

Import

Enter the Java code required to import, if required, the external library used in the code editing field of the Basic settings tab of the components such as tJavaMR in a Map/Reduce Job.

Usage in Spark Batch Jobs

In a Talend Spark Batch Job, this component is used standalone. It generates native Spark code that can be executed directly in a Spark cluster.

This component, along with the Spark Batch component Palette it belongs to, appears only when you are creating a Spark Batch Job.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents only Standard Jobs, that is to say traditional Talend data integration Jobs.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Spark Connection

You need to use the Spark Configuration tab in the Run view to define the connection to a given Spark cluster for the whole Job. In addition, since the Job expects its dependent jar files for execution, one and only one file system related component from the Storage family is required in the same Job so that Spark can use this component to connect to the file system to which the jar files dependent on the Job are transferred:

This connection is effective on a per-Job basis.

Limitation

The library is loaded locally.

Related scenarios

No scenario is available for the Spark Batch version of this component yet.

tLibraryLoad in Spark Streaming Jobs

Warning

The streaming version of this component is available in the Palette of the studio on the condition that you have subscribed to Talend Real-time Big Data Platform or Talend Data Fabric.

Component Family

Custom Code

 

Basic settings

Library

Select the library you want to import from the list, or click on the [...] button to browse to the library in your directory.

 Advanced settings

Import

Enter the Java code required to import, if required, the external library used in the code editing field of the Basic settings tab of the components such as tJavaMR in a Map/Reduce Job.

Usage in Spark Streaming Jobs

In a Talend Spark Streaming Job, this component is used standalone. It generates native Spark code that can be executed directly in a Spark cluster.

This component, along with the Spark Streaming component Palette it belongs to, appears only when you are creating a Spark Streaming Job.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents only Standard Jobs, that is to say traditional Talend data integration Jobs.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Spark Connection

You need to use the Spark Configuration tab in the Run view to define the connection to a given Spark cluster for the whole Job. In addition, since the Job expects its dependent jar files for execution, one and only one file system related component from the Storage family is required in the same Job so that Spark can use this component to connect to the file system to which the jar files dependent on the Job are transferred:

This connection is effective on a per-Job basis.

Limitation

The library is loaded locally.

Related scenarios

No scenario is available for the Spark Streaming version of this component yet.