July 30, 2023

tRiakInput – Docs for ESB 7.x

tRiakInput

Extracts the desired data from a bucket in a Riak node so as to store or apply
changes to the data.

tRiakInput reads data from a Riak
bucket and send data in the Talend flow.

tRiakInput Standard properties

These properties are used to configure tRiakInput running in the Standard Job framework.

The Standard
tRiakInput component belongs to the Big Data and the Databases NoSQL families.

The component in this framework is available in all Talend products with Big Data
and in Talend Data Fabric.

Basic settings

Schema and Edit Schema

A schema is a row description. It defines the number of fields
(columns) to be processed and passed on to the next component. When you create a Spark
Job, avoid the reserved word line when naming the
fields.

Click Edit
schema
to make changes to the schema. If the current schema is of the Repository type, three options are available:

  • View schema: choose this
    option to view the schema only.

  • Change to built-in property:
    choose this option to change the schema to Built-in for local changes.

  • Update repository connection:
    choose this option to change the schema stored in the repository and decide whether
    to propagate the changes to all the Jobs upon completion. If you just want to
    propagate the changes to the current Job, you can select No upon completion and choose this schema metadata
    again in the Repository Content
    window.

Use existing connection

Select this check box and in the Component List click the relevant connection component to
reuse the connection details you already defined.

If you select the Use an existing
connection
check box, the Nodes table will not be available.

Nodes

Fill in the information required for a connection to a Riak
cluster.

  • Host: enter the IP
    address or hostname of a Riak node in the Riak cluster that
    you want to connect to.

  • Port: enter the listening
    port number of a Riak node. You can leave this field empty
    to use its default value 8098.

  • Riak path: enter the Riak
    path for accessing a Riak node. You can leave this field
    empty to use its defalt value riak.

One example of the URL for accessing a Riak node is http://127.0.0.1:8098/riak.

For more information about the concepts related to Riak, see https://docs.basho.com/riak/kv/2.2.0/learn/concepts/.

Bucket

Type in the name of the bucket from which you want to read
data.

Key

Type in the key which is associated with the data that you want to
read.

Output key to column

Select this check box and from the list select the desired column
to which the keys will be output.

Values column

Customize the columns to which the values will be output.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the
Job level as well as at each component level.

Global Variables

Global Variables

NB_LINE: the number of rows read by an input component or
transferred to an output component. This is an After variable and it returns an
integer.

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

Usage rule

This component always needs an output link.

Exporting data from a Riak bucket to a local file

This scenario applies only to Talend products with Big Data.

The following scenario describes a Job which reads data from a Riak bucket and
writes it into a local txt file.

tRiakInput_1.png
Prerequisites: The Riak bucket from which you want to
export data already exists. In this example, the data from the bucket computer will be exported and the bucket has already imported the following
data:

Dropping and linking components

  1. Drop the following components from the Palette to the design workspace: tRiakConnection, tRiakInput, tFileOutputDelimited, and tRiakClose.
  2. Connect tRiakConnection to tRiakInput using a Trigger
    > On Subjob Ok
    link.
  3. Connect tRiakInput to tFileOutputDelimited using a Row > Main link.
  4. Connect tFileOutputDelimited to tRiakClose using a Trigger
    > On Component Ok
    link.

Configuring the components

Opening a connection to Riak

  1. Double-click tRiakConnection to open its
    Basic settings view in the Component tab.

    tRiakInput_2.png

  2. In the Nodes table, enter the information
    of a Riak cluster you want to connect to.

Exporting data from a Riak bucket to a local file

  1. Double-click tRiakInput to open its
    Basic settings view in the Component tab.

    tRiakInput_3.png

  2. Click Edit schema to define the structure
    of exported data. In this example, three columns are defined: id, company,
    and price.

    tRiakInput_4.png

  3. Select the Use an existing connection
    check box and then select the connection you have configured earlier. In
    this example, it is tRiakConnection_1.
  4. In the Bucket field, enter the name of
    the bucket from which the data will be exported, computer in this example.
  5. Select the Output key to column check box
    , and select the desired column from the list. id is selected in this example.
  6. In the Value columns table, click twice
    the

    tRiakInput_5.png

    button and select company and price from
    the list respectively.

Writing data into a local file

  1. Double-click tFileOutputDelimited to open
    its Basic settings view in the Component tab.

    tRiakInput_6.png

  2. In the File Name field, enter the full
    path to the local file in which you want to store the exported data,
    D:/Output/computer.txt in this
    example.
  3. Select the Include Header check
    box.
  4. Leave other settings as they are.

Closing the connection to Riak

  1. Double-click tRiakClose to open its
    Basic settings view in the Component tab.

    tRiakInput_7.png

  2. Select the connection you want to close from the Component List, tRiakConnection_1 in this example.

Saving and executing the Job

  1. Press Ctrl+S to save your Job.
  2. Execute the Job by pressing F6 or
    clicking Run on the Run tab.
  3. Go to the local directory where the file is stored and check the exported
    data from the Riak bucket.

    tRiakInput_8.png


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x