Datastore Helper implementation within MRA

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

Implementations of the AConfigurableSchema class

All the reference implementation datastores are provided as implementations of the AConfigurableSchema class. With the migration to DaSH 2.0, these classes are no longer @Configuration classes, instead being instantiated directly, in the DatastoreConfiguratorSetup class. To provide the option to load a schema for vectorised and scalar data, these classes also extend the AScalarDataAwareSchema class.

The full list is as follows:

Class Datastore types
VaRDatastoreDescriptionConfig Standard VaR datastores.
PnLDatastoreDescriptionConfig Standard PnL datastores.
SensiDatastoreDescriptionConfig Vectorised and scalar Sensitivity datastores.
VaRFlatDatastoreDescriptionConfig Denormalised datastore for VaR store-level imports.
PnLFlatDatastoreDescriptionConfig Denormalised datastore for PnL store-level imports.
SensiFlatDatastoreDescriptionConfig Denormalised datastores for vectorised and scalar Sensitivity store-level imports.
VaRAggregatedDatastoreDescriptionConfig Denormalised datastore for VaR aggregated imports.
PnLAggregatedDatastoreDescriptionConfig Denormalised datastore for PnL aggregated imports.
SensiAggregatedDatastoreDescriptionConfig Denormalised datastores for vectorised and scalar Sensitivity aggregated imports.
ParameterDatastoreDescriptionConfig ActiveMonitor parameter store.
WhatIfDatastoreDescriptionConfig What-If tool datastore.

The DatastoreConfiguratorSetup class

All Spring beans are wired together in the DatastoreConfiguratorSetup class. This class groups collections of datastores into schemas, provides a mechanism to enable a subset of the schemas available within the configurator, and applies any customizations defined within the application.

The configurator consumers

Due to the usage of Spring profiles within the application, all configured schemas and customisations are enabled via autowired Spring beans, instantiated for particular profiles.

The class autowires two Consumer<IConfigurator> objects:

    Consumer<IDatastoreConfigurator> schemaEnabler;

    @Autowired(required = false)
    List<Consumer<IDatastoreConfigurator>> customisations;

The SP_QUALIFIER__SCHEMAS consumer controls which of the configured schemas (see AConfigurableSchema implementations) are enabled for a given set of enabled application profiles.

The SP_QUALIFIER__CUSTOMISATIONS consumer applies customizations defined elsewhere in the application configuration. See Customizations classes

The schema enabler

The schema enabler consumer is instantiated within the DatastoreConfiguratorSetup class, with different configurations depending on the active profile.

Schema list suppliers

The schema enabler beans use Supplier<List<AScalarDataAwareSchema>> objects to define groups of schemas that are lazily instantiated.

Three such suppliers are available, for standard application operation (with scalar or vectorised data), store-level imports and aggregated imports.

Supplier Instantiated classes
STORE_IMPORT_SCHEMAS ParameterDatastoreDescriptionConfig, PnLFlatDatastoreDescriptionConfig, VaRFlatDatastoreDescriptionConfig, SensiFlatDatastoreDescriptionConfig
AGGREGATED_IMPORT_SCHEMAS ParameterDatastoreDescriptionConfig, PnLAggregatedDatastoreDescriptionConfig, VaRAggregatedDatastoreDescriptionConfig, SensiAggregatedDatastoreDescriptionConfig
STANDARD_SCHEMAS WhatIfDatastoreDescriptionConfig, ParameterDatastoreDescriptionConfig, PnLAggregatedDatastoreDescriptionConfig, VaRAggregatedDatastoreDescriptionConfig, SensiAggregatedDatastoreDescriptionConfig


The supplier and the parameters used for the schema instantiation are defined for each active profile.

Profile Supplier Schema type

Customizations classes

The Market Risk Accelerator contains three customization classes that instantiate beans autowired into the SP_QUALIFIER__CUSTOMISATIONS consumer list.

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.
SignOffDatastoreCustomisations Intended to support Sign-off adjustment source tagging. Adds Source and Input type fields to the Sensitivity and PnL base stores, for standard (vectorised and scalar) as well as source-level import and aggregated import profiles.