Skip to main content
Atoti Market Risk defines source topic descriptions that control how data is loaded into each store. The example below demonstrates how to add a custom source using Spring Beans and properties.

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 file DynamicTenors.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 a DatastoreConfiguratorConsumer bean, which appends the required fields to the DynamicTenors store:
See Customizing the Datastore with the Datastore Helper for more information.

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 the DynamicTenors 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:
For the tuple publisher, a second bean is created, defining the publishing 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 new CsvTopicConfiguration 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.
The bean is annotated with @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.
Then, include this configuration class in the @Import annotation of the MarketRiskConfig class:
Importing this customization class and modifying the input file will result in the following data being loaded into the store: The configuration for this behavior is:
Within the 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.

Suggested Further Reading