Customizing the Lookup Manager application

To customize the Lookup Manager application, adapt the LookupMgrCustomizing.xml file and, if your enrichment data is read from a database, the connections.xml file.

About this task

The Lookup Manager application takes care that the enrichment data is distributed to all hosts on which ITE applications want to access it. The enrichment data is stored in a database, in files or in a database and files. While creating the Lookup Manager application you already enabled one or both source systems.

If your ITE applications do not enrich the input tuples, the Lookup Manager application is not required at all.

The customization of the Lookup Manager application does not require any code changes but requires that you customize the mapping between the source data columns and the tuple attributes you use in your application or applications. If your enrichment data is stored in a database and your application retrieves it directly from the database, you must also customize the connections.xml document.

The customization of the connections.xml document that is in the project directory, is described in the database toolkit documentation (Reference > Toolkits > Specialized toolkits > com.ibm.streams.db). For more information about the procedure to connect the connections.xml file to the LookupMgrCustomizing.xml file, see Connecting the connections.xml and the LookupMgrCustomizing.xml files.

This procedure describes the steps to customize the LookupMgrCustomizing.xml file. In the LookupMgrCustomizing.xml file you define shared memory segments, stores, and streams schemas as well as the mapping from the source to the SPL streams schemas. When you compile the Lookup Manager application, the content of the LookupMgrCustomizing.xml file is used to generate parts of the SPL source code.

For more information about the allowed elements and values in the customization file, see the etc/LookupMgrCustomizing.xsd XSD file in your project directory.

Procedure

  1. Open the LookupMgrCustomizing.xml file, in the root directory of the Lookup Manager project, with an XML or text editor.
  2. Add a DataSources element for all data sources.

  3. Add the DataSource elements to the DataSources element and define the schemas of data source streams. Each Name attribute is unique. Each schema must map to the layout of the enrichment data in the database table or CSV source files. By default like named ValueDefinition elements and column elements are automatically mapped to each other. If you need to map elements with different name to each other then use the ValueDefinition’s DbColumnName attribute. The same source data can feed several stores in a shared memory segment.

  4. Add a Segments element for all segments and stores.

  5. Add the Segment elements to the Segments and define the stores that hold the enrichment data. The Name attribute defines the physical unique memory segment. Define the reference to data source as well as the maximum segment size. Specify for each store the key and the values, their types as well as SPL expressions which assign the data source attributes as keys and values of the key-value stores.


    Lookup Manager application – segment customization
  6. Add an Applications element to each Segment.

  7. Add the Application elements that access this segment and set the Namespace attribute to the name space of the ITE application. The application can use job-name alias defined at submission time as value of the ite.jobName parameter. The Lookup Manager must know this alias in configuration and you have to define this alias at this place. The following figure shows an example of three applications and one job-name alias :
    Lookup Manager customization - application namespace
  8. Save your LookupMgrCustomizing.xml file.

  9. Build your Lookup Manager application.

Connecting the connections.xml and the LookupMgrCustomizing.xml files