Upgrading the LookupCache operator with new parameter
The LookupCache operator has a new applControlDir parameter. Typically, the application uses this operator in the <namespace>.chainprocessor.transformer.custom::DataProcessor composite. The application framework composite that calls the DataProcessor composite extends the composite interface by the new parameter to forward the parameter value to the LookupCache operator. You must include the new applControlDir parameter to the parameter clause of your customized DataProcessor composite and forward it to the LookupCache operator.
If you use the LookupCache operator in other composite, then you must ensure that the composite structure of your application provides the required applControlDir parameter value to your custom composite.
Procedure
- Open the DataProcessor.spl file that uses the LookupCache operator.
For example:
gedit <YourProjectFolder>/<namespace>.chainprocessor.transformer.custom/DataProcessor.spl
-
Include SPLDOC description for the applControlDir parameter to the DataProcessor composite.
For example
* @param applControlDir * The LookupCache operator requires this parameter that provides the path to the control directory. * This directory provides the information about the name of the Lookup Manager job that * the LookupCache operator needs to specify the shared memory segment name
-
Add new parameter to the parameter clause of the DataProcessor specification.
For example:
public composite DataProcessor ( input ... output ... ) { param ... expression<rstring> $applControlDir; ... }
- Append the applControlDir to the call of the LookupCache operator.
For example:
stream<I> EnrichedRecords = LookupCache(TransformedRecords as I) { param ... applControlDir: $applControlDir; // always pass through this parameter }
You find the whole sample in <YourProjectFolder>/<namespace>/chainsink/sample/PostContextDataProcessor.splmm file:
... public composite DataProcessor ( ... ) { param expression<rstring> $groupId; expression<rstring> $chainId; expression<rstring> $reprocessDir; expression<boolean> $disableLookup; expression<rstring> $applControlDir; graph <%if ($useLookupTypeExtension) {%> @spl_category(name="sample") stream<I> EnrichedRecords = LookupCache(InRec as I) { param segmentName: "segMaster2"; // The name of the physical memory segment containerName: "MapName2"; // The name of the store useMutex: false; // Don't protect data with mutex mutexName: ""; key: I.attr10; keyType: rstring; // SPL type of key found: I.lookupFound; // attribute that takes lookup success valueType: TypesCustom.DSVCvalue_t; //type of lookup table value as also defined in LookupManager disableLookup: $disableLookup; // always pass through this parameter applControlDir: $applControlDir; // always pass through this parameter } ... }
-
Save and close the <YourProjectFolder>/<namespace>.chainprocessor.transformer.custom/DataProcessor.spl file.