removalConditionFactory, while implicit unload topics are created automatically from the request scope.
Configuration
YAML configuration
The unload topics can be defined via YAML configuration. The topics name must match a datastore table’s name. The list of field names per topic name must all be present in the scope when performing the unload operation for that topic. The unload operation will remove all facts from the store where the field equals the value provided in the scope. The DLC also has a feature to create implicit unload topics. This feature can be enabled or disabled.Java configuration
The unload topics can be configured by definingUnloadTopicDescription beans in the application.
UnloadTopicDescription
The UnloadTopicDescription is used to define the configuration of an unload topic. The following properties are available:
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| name | Y | String | Name of the topic. | |
| stores | Y | Set<String> | Empty Set | Set of stores this topics will unload from. |
| removalConditionFactory | Y | BiFunction<IStoreDescription, DlcScope, ICondition> | Factory that creates a False condition. | Factory that creates the condition to filter the facts to be removed. |
Removal condition factory
TheremovalConditionFactory is a BiFunction that takes an IStoreDescription and a DlcScope and returns
an ICondition. This condition is used to filter the facts to be removed from the store.
The UnloadTopicDescription.of(String name, Map<String, Set<String>> fieldNamesPerStore) will create a removalConditionFactory
that will, for each store (fieldNamesPerStore keys), create a condition where each field matches the provided field value
in the scope. This factory will only work if all field names are provided in the scope.
Example
All facts that have anAsOfDate of 2021-01-01 can be removed from the store by specifying a scope of:
AsOfDate of 2021-01-01 and that have a Currency of usd can be removed from the store by specifying a scope of:
Data type considerations
It is important to note the following:- The
removalConditionFactoryshould be able to ensure theDlcScopekeys are properly typed. SinceIConditions are strict filters, if the datatype of the scope value does not align with the datatype of the store column, then no data will be unloaded. - When unloading a
DlcScopethat was provided via a REST request, the scope values may be of typeString.
Custom unload topics
Custom unload topics can be created by definingUnloadTopicDescription beans in the application. The removal condition factory can be customized, or the DlcUnloadOperationHelperUtil can be used to create removal conditions.
The following example creates an unload topic that removes facts from the “StoreName” store where “FiledName_1” and “FieldName_2” field values come from the scope.
("tradeId", "Trade_123*") to remove all trades that have a trade id containing the substring "Trade_123".
Implicit unload topics
Implicit unload topics allow data to be unloaded from a datastore table without explicitly defining an unload topic in the configuration. The usage of implicit unload topics can be enabled via theimplicit-topics-enabled property
- The topic name must match the name of an existing datastore table.
- The removal condition will be resolved from the scope of the incoming request.
Example
UnloadTopicDescription at request time when a topic is requested that both matches the
name of a datastore table and no UnloadTopicDescription exists in the DLC configuration.
Implicit UnloadTopicDescriptions
| Parameter | Value |
|---|---|
name | Name of the store. Example: "TradeBaseStore". |
stores | As above, the name of the store in question. Note: The value is just the one store. Example: List ["TradeBaseStore"] |
removalConditionFactory | Default IUnloadTopicDescription.SCOPE_TO_REMOVAL_CONDITION |