Datastore Helper implementation within MR

This page provides implementation details about the usage of the Datastore Helper 2.0 library within Atoti Market Risk, focusing on the wiring between different datastore definitions and customizations. For documentation of the library itself, see the Datastore Helper Documentation.

Implementations of the AConfigurableSchema class

All the MR libraries datastores are provided as extensions of the AConfigurableSchema and AScalarDataAwareSchema classes. These classes are annotated as @Configuration, then collected and applied to the IDatastoreConfigurator object in the DatastoreConfiguratorSetup class.

The full list is as follows:

Class Datastore types
DatastoreDescriptionConfig FX, rounding, and quantiles stores for all cubes.
StandardDatastoreDescriptionConfig Trade and organizational stores for all cubes.
VaRDatastoreDescriptionConfig Standard VaR datastores.
PnLDatastoreDescriptionConfig Standard PnL datastores.
SensiDatastoreDescriptionConfig Vectorized and scalar Sensitivity datastores.
VaRFlatDatastoreDescriptionConfig Denormalized datastores for VaR store-level imports.
PnLFlatDatastoreDescriptionConfig Denormalized datastores for PnL store-level imports.
SensiFlatDatastoreDescriptionConfig Denormalized datastores for vectorized and scalar Sensitivity store-level imports.
VaRAggregatedDatastoreDescriptionConfig Denormalized datastores for VaR aggregated imports.
PnLAggregatedDatastoreDescriptionConfig Denormalized datastores for PnL aggregated imports.
SensiAggregatedDatastoreDescriptionConfig Denormalized datastores for vectorized and scalar Sensitivity aggregated imports.
ParameterDatastoreDescriptionConfig ActiveMonitor parameter store.
WhatIfDatastoreDescriptionConfig What-If tool datastore.

The DatastoreConfiguratorSetup class

All Spring beans are collected in the DatastoreConfiguratorSetup class. The@Configuration classes are expected to be made conditional on application properties and thus result in the correct set of datastores for each run mode.

Customizations should be created as DatastoreConfiguratorConsumer beans, which are then collected by the class constructor:

        public DatastoreConfiguratorSetup(
            List<IConfigurableSchema> schemas,
            @Autowired(required = false) List<DatastoreConfiguratorConsumer> customisations) {
        this.schemas = schemas;
        this.customisations = customisations;
    }

Customizations classes

Atoti Market Risk contains two customization classes that instantiate DatastoreConfiguratorConsumer beans.

Class Usage
DatastoreCustomisations Empty class intended to provide a place to define simple customizations.
ProductControlDatastoreCustomisations Operates on the PnL base store. Makes the Type field a key field and adds Monthly, Yearly and Lifetime value fields.