Configuring schema selections using Spring Beans
This page describes the extension points introduced in MR 4.0.0 that allow you to customize the schema selections through Spring Beans.
Concept
Within Atoti Server, a cube is built on a set of fields defined by a schema selection from a datastore.
Most schema selections are configured by default to select all fields in the base store. Therefore, fields added to those stores don’t require a customization to the schema selection.
The extension points are intended to support use cases where the default behavior is inappropriate:
- a field is added to the store for direct queries only, and shouldn’t be included in the cube
- a key field is added to multiple stores and the references between them, and shouldn’t be selected multiple times
- the selection of the common stores (e.g. Trade Attributes, BookHierarchy) needs to be changed
- the selection for an entire datastore needs to be modified
For a custom configuration, all schema selections are configurable through the following beans:
Bean type | Details | Datastores |
---|---|---|
SelectionDescriptionCreator |
Main schema selection bean, which takes a datastore schema description and applies a series of selection API calls, resulting in a selection description. | All datastores expose this bean. |
BaseSelectionCreator<T> |
The base selection for a given datastore and base store name. Used as a parameter for the main bean, will be applied to the created selection description. | All datastores expose and apply this bean. |
ExtraSelectionApplier<T> |
Extra selections for a given datastore. Used as a parameter for the main bean, will be applied to the created selection description. | All datastores apply this bean. |
FieldsCollisionHandler |
Defines the behavior when two fields in the schema selection have the same name. Available options are the Common Library ClosestExtFieldsCollisionHandler and either static members or custom implementations of the core FieldsCollisionHandler interface. |
All datastores expose this bean. |
note
The T
class used in the table above is an extension of the Atoti Server core CanUseOtherReference
and CanBuild
interfaces.
Customizations
The customization Beans
are annotated with a @Qualifier
, explicitly defining the datastore to which the customization applies.
All @Qualifier
constants are defined in the SpringConstants
class.
The following qualifiers are available for the cubes in Atoti Market Risk:
Constant | Qualifier | Type | Description |
---|---|---|---|
SP_QUALIFIER__PNL_FIELD_COLLISION_HANDLER | pnl-field-collision-handler | FieldsCollisionHandler |
The field collision handler for the PLCube. |
SP_QUALIFIER__PNL_SUMMARY_FIELD_COLLISION_HANDLER | pnl-summary-field-collision-handler | FieldsCollisionHandler |
The field collision handler for the PL Summary Cube. |
SP_QUALIFIER__SENSITIVITY_FIELD_COLLISION_HANDLER | sensitivity-field-collision-handler | FieldsCollisionHandler |
The field collision handler for the Sensitivity Cube. |
SP_QUALIFIER__SENSITIVITY_SUMMARY_FIELD_COLLISION_HANDLER | sensitivity-summary-field-collision-handler | FieldsCollisionHandler |
The field collision handler for the Sensitivity Summary Cube. |
SP_QUALIFIER__VAR_FIELD_COLLISION_HANDLER | var-field-collision-handler | FieldsCollisionHandler |
The field collision handler for the VaR-ES Cube. |
SP_QUALIFIER__VAR_SUMMARY_FIELD_COLLISION_HANDLER | var-summary-field-collision-handler | FieldsCollisionHandler |
The field collision handler for the VaR-ES Summary Cube. |
SP_QUALIFIER__MARKET_DATA_FIELD_COLLISION_HANDLER | market-data-field-collision-handler | FieldsCollisionHandler |
The field collision handler for the Market Data Cube. |
SP_QUALIFIER__PNL_BASE_SELECTION | pnl-base-selection | BaseSelectionCreator |
The base selection for the PLCube. |
SP_QUALIFIER__PNL_SUMMARY_BASE_SELECTION | pnl-summary-base-selection | BaseSelectionCreator |
The base selection for the PL Summary Cube. |
SP_QUALIFIER__SENSITIVITY_BASE_SELECTION | sensitivity-base-selection | BaseSelectionCreator |
The base selection for the Sensitivity Cube. |
SP_QUALIFIER__SENSITIVITY_SUMMARY_BASE_SELECTION | sensitivity-summary-base-selection | BaseSelectionCreator |
The base selection for the Sensitivity Summary Cube. |
SP_QUALIFIER__VAR_BASE_SELECTION | var-base-selection | BaseSelectionCreator |
The base selection for the VaR-ES Cube. |
SP_QUALIFIER__VAR_SUMMARY_BASE_SELECTION | var-summary-base-selection | BaseSelectionCreator |
The base selection for the VaR-ES Summary Cube. |
SP_QUALIFIER__MARKET_DATA_BASE_SELECTION | market-data-base-selection | BaseSelectionCreator |
The base selection for the Market Data Cube. |
SP_QUALIFIER__PNL_EXTRA_SELECTION | pnl-extra-selection | ExtraSelectionApplier |
Any extra selections applied to the PLCube. |
SP_QUALIFIER__PNL_SUMMARY_EXTRA_SELECTION | pnl-summary-extra-selection | ExtraSelectionApplier |
Any extra selections applied to the PL Summary Cube. |
SP_QUALIFIER__SENSITIVITY_EXTRA_SELECTION | sensitivity-extra-selection | ExtraSelectionApplier |
Any extra selections applied to the Sensitivity Cube. |
SP_QUALIFIER__SENSITIVITY_SUMMARY_EXTRA_SELECTION | sensitivity-summary-extra-selection | ExtraSelectionApplier |
Any extra selections applied to the Sensitivity Summary Cube. |
SP_QUALIFIER__VAR_EXTRA_SELECTION | var-extra-selection | ExtraSelectionApplier |
Any extra selections applied to the VaR-ES Cube. |
SP_QUALIFIER__VAR_SUMMARY_EXTRA_SELECTION | var-summary-extra-selection | ExtraSelectionApplier |
Any extra selections applied to the VaR-ES Summary Cube. |
SP_QUALIFIER__MARKET_DATA_EXTRA_SELECTION | market-data-extra-selection | ExtraSelectionApplier |
Any extra selections applied to the Market Data Cube. |
SP_QUALIFIER__PNL_SCHEMA_SELECTION | pnl-schema-selection | SelectionDescriptionCreator |
The complete schema selection for the PLCube. |
SP_QUALIFIER__PNL_SUMMARY_SCHEMA_SELECTION | pnl-summary-schema-selection | SelectionDescriptionCreator |
The complete schema selection for the PL Summary Cube. |
SP_QUALIFIER__SENSITIVITY_SCHEMA_SELECTION | sensitivity-schema-selection | SelectionDescriptionCreator |
The complete schema selection for the Sensitivity Cube. |
SP_QUALIFIER__SENSITIVITY_SUMMARY_SCHEMA_SELECTION | sensitivity-summary-schema-selection | SelectionDescriptionCreator |
The complete schema selection for the Sensitivity Summary Cube. |
SP_QUALIFIER__VAR_SCHEMA_SELECTION | var-schema-selection | SelectionDescriptionCreator |
The complete schema selection for the VaR-ES Cube. |
SP_QUALIFIER__VAR_SUMMARY_SCHEMA_SELECTION | var-summary-schema-selection | SelectionDescriptionCreator |
The complete schema selection for the VaR-ES Summary Cube. |
SP_QUALIFIER__MARKET_DATA_SCHEMA_SELECTION | market-data-schema-selection | SelectionDescriptionCreator |
The complete schema selection for the Market Data Cube. |
For example, to easily add an extra schema selection for the VaR-ES Cube, define a bean as follows:
@Qualifier(SP_QUALIFIER__VAR_EXTRA_SELECTION)
@Bean
ExtraSelectionApplier<CanUseOtherReference> extraVarSelection() {
return builder -> builder
.usingReference(storesToPath(TRADE_BASE_STORE_NAME, "TESTSTORE"))
.withAllFields()
.except(AS_OF_DATE, RISK_CLASS);
}
Suggested Further Reading
- Adding cube hierarchies
- Configuring measures using Spring Beans
- Configuring sources using Spring Beans
- Adding a new KPI
- Adding data loading or unloading topics