Epoch cache

The Epoch cache is linked to the epoch of the cube. It stores objects that don’t change until the cube epoch changes. It is mainly used in distribution by the query node when retrieving data from a data node.

Implementation

Interface

The cache implements the IEpochCache that extends ConcurrentMap<Object, Object>. It doesn’t implement the IQueryCache because the Query cube doesn’t have any reference to the Database that is handled by the IQueryCache interface.

Spring factory

To use the epoch cache, the EpochCacheManager bean has to be instantiated.

Then the cache can be retrieved by calling the function:

var cache = epochCacheManager.getCache(pivot);
// And then the cache tools can be used as usual
var data = PostProcessorUtils.getInCacheOrComputeNeverNull(
        cache,
        () -> getDistributedParametersData((IActivePivotVersion) pivot, store, selectedFields.stream().map(AliasedField::fromFieldName).toList()),
        QueryKey.REMOTE_PARAMETER, store, selectedFields
);