DummyHierarchy

The DummyHierarchy is used to create an empty hierarchy. It is useful in horizontal distribution to merge different cubes under the same application as it requires having the exact same hierarchy structure; that also contains the same comparators and the same slicing locations. The slicing level members are important to define the default location needed to aggregate the cubes.

The DummyHierarchy is able to create such a multi-level hierarchy.

import com.activeviam.accelerator.common.hierarchy.DummyHierarchy;

// ....

hierarchyBuilder.toDimension(DYNAMIC_BUCKETING_DIMENSION,
        DummyHierarchy.hierarchy(DYNAMIC_BUCKETING_TENORS_HIERARCHY)
                .withSlicingLevel(TENOR_SET_LEVEL, "DEFAULT", "REDUCED", "DECADE")
                    .withComparator(new CustomComparator<>(List.of("DEFAULT", "REDUCED", "DECADE"), List.of()))
                .withLevel(TENOR_LEVEL)
                    .withComparator(BucketComparator.PLUGIN_KEY));

Here are the methods exposed to set up the hierarchy:

Method Parameters Mandatory Usage
withVisible Boolean Sets the visible flag to the hierarchy.
hidden Hides the hierarchy, equivalent to withVisible(false)
withSlicingLevel String, String… Creates a slicing level containing the provided default values. It must be the first defined level.
withSlicingLevel String, List Creates a slicing level containing the provided default values. It must be the first defined level.
withLevel String Creates a level.
withLevels String… Creates multiple levels.
withType int The Copper type of the level (mandatory for Copper usage), for instance withType(Types.TYPE_STRING).
withComparator IComparator Sets the level comparator directly from a comparator object instance (the running hierarchy will create its own instance).
withComparator IComparatorDescription Sets the level comparator from a comparator description.
withComparator String Sets the level comparator from a comparator Plug-In Key.