Source Topic Descriptions
The Data Load Controller is used to define the source topics. The following descriptions are defined:
*If no fields are present in the configuration, the datastore’s target store fields are taken into account.
Example
For the purposes of this example, we will add a column to the fileDynamicTenors.csv and load the data from this column into the
DynamicTenors store. In this case, our new column’s header is “TestField”,
and all data in this column is “Testdata”. Here’s how the input file looks like:
We will also attach a column calculator that multiplies the NumberOfDays by 2 into a new column, as well as a tuple publisher that will add a value into the SensitivityName field.
Step 1 - Defining customizations to datastore
Before we can load these new columns into our cube, we need to make sure that our datastore has fields that can accept them. To add new fields to an existing store, we need to create aDatastoreConfiguratorConsumer bean, which appends the required fields to the DynamicTenors store:
Step 2 - Implementing the column calculator and the tuple publisher
Now that we have modified our store, we need to make sure the ETL is correctly set up, so that the field will be properly populated. In most cases, the topic configuration uses the store fields as the expected file columns, which would require no further configuration. For theDynamicTenors store used in this example, file columns are defined explicitly, so any new columns are not auto-configured.
The DynamicTenors store also has a previously defined column calculator creating indices for each of the tenors.
To define the column calculator, we create the following bean, containing the required logic:
Step 3 - Update the topic description
We now need to modify the DynamicTenors topic to include the column calculator and tuple publisher. This can either be done with properties, or in Java.Properties
We add the following properties to our existing properties,to define:- the list of columns read from the input file,
- the calculated column,
- the tuple publisher.
Java
We create a newCsvTopicConfiguration Spring bean that will override the existing topic bean provided in Atoti Market Risk. We inject into the bean method:
- Our previously defined target and custom field. These will be used to create the channel,
- The existing
tenorIndicesCalculator, defined in Atoti Market Risk. This will be used to create the channel, - The existing topic bean. This enables the default parser and file pattern to be reused.
@Order(1). This ensures it takes precedence over existing topics in Atoti Market Risk.
Step 4 - Configuration classes
You can include the Beans detailed above in a single class within Atoti Market Risk.@Import annotation of the MarketRiskConfig class:
The configuration for this behavior is:
createTupleForTable method, the publisher iterates over the table fields, attempting to retrieve a value in the input tuple by the mapped field (or directly if no mapping is available).
If no value is available in the input tuple, or no matching field is found, the value will be empty. If a tuple field’s value isn’t requested by the publisher, it is ignored.