Initializing Lookup Manager data from CSV files

When you use at least one ITE application together with the Lookup Manager, which provides enrichment data, you must first initialize the Lookup Manager. In the case described here you are using CSV files as the data source.

Before you begin

Compile the Lookup Manager by using a LookupMgrCustomizing.xml file that contains all data source definitions and all segments with appropriate ITE applications.

In your command file you use the init command.

Start the ITE and Lookup Manager applications by submitting them to an IBM Streams instance.

About this task

Initialize the Lookup Manager’s enrichment data from CSV files.

Procedure

  1. Create your CSV enrichment data files and move them to the directory configured with lm.file.directory
  2. Create the command file that contains the init command and affected segments. Move the file into the directory that is configured with lm.commandsDirectory. Remember to use the ‘.cmd’ extension.

  3. Monitor the states of your jobs with the Streams Console

  4. When the applications are in RUN state, initialization finished successfully and you can use your applications

The following figure shows an example command file:


Lookup Manager application – initializing from CSV files

If you run a command and the DataSource-Name.csv or DataSource-Name.del.csv input CSV files are not provided, the command fails and the process moves the command file to the failed folder. In this case, provide the required CSV files in the file directory and move the command file into the commands directory again. The value of the Name attribute in the DataSource element is unique. Column indexes are defined in the LookupMgrCustomizing.xml file. With these definitions, you map the data in the column of the CSV file to SPL tuple attributes in the data source stream. Indexing begins with zero and the CSV file must have a constant number of comma-separated columns. The CSV parser handles attribute-type mapping automatically.