Integrating the Limits Module with Atoti+

This section walks you through integrating the Limits Module with Atoti+. In order to connect an Atoti+ instance to Limits, you need to register the LookUpPostProcessor to the Atoti+ Session.

Prerequisites

Tool Minimum Version
Atoti+ 0.6.4
Limits LookUpPostProcessor.jar

Session Creation

Start the Atoti+ Session with the extra_jars property pointing to the location of the LookUpPostProcessor.jar file. This way, the Atoti+ instance has access to the LookUpPostProcessor, which is needed for evaluating Limit KPI’s in the Atoti+ instance. We will start our Atoti+ server on port 6060 - this is so we know where the Atoti+ instance is running so we can configure the Limits module to connect to it properly.

# Imports
from pathlib import Path
import atoti as tt
from atoti import Session


# Path object of the Limits Jar file
limits_lookup_pp_extra_jar = Path("base/path/to/jar/limits-lookup-postprocessor-0.3.0-AP5.9.jar")

session = tt.create_session(
    config={
        "port": 6060,
        "extra_jars": [
            limits_jar_to_use
        ],
    },
)

Cube Creation

Next, configure your Cube, Hierarchies, and Tables.

The only required structure needed for Limits is a Slicing Date Hierarchy. To configure a hierarchy as Slicing, follow the example below:


# Create our Base Store
session.create_table(
    name="Trades",
    types={
        "TradeId": tt.type.STRING,
        "Price": tt.type.FLOAT,
        "Date": tt.type.LOCAL_DATE,
    },
    keys=["TradeId", "Date"],
)

# Create our cube
cube = session.create_cube(
    base_table=session.tables["Trades"],
    name="TradesCube",
)

# Ensure that our Date hierarchy is Slicing
cube.hierarchies["Date"].slicing = True

Register the LookUpPostProcessor

Now that you’ve added the LookUpPostProcessor Jar to the Atoti+ instance, you now need to register the LookUpPostProcessor. This can be done by simply calling the static registering method of the LookUpPostProcessor as seen below:

# Register the LookUpPostProcessor with the Atoti instance.
session._java_api.gateway.jvm.com.activeviam.limits.core.shared.LookUpPostProcessor.addMeasureToRegistry()

Limits is registered!

Now your Atoti+ instance is ready to wire into the Limits module.

You can now create Limit definitions in the Limits Module and configure the Limits Module to use your Atoti+ instance as an AP instance.

The Limits module must be started after the Atoti+ instance as the Limits module will create the Limit KPIs on the Atoti+ cube. Once the Limits module has started, you can query the Limits KPIs on the Atoti+ server.

Configurations in the Limits Module

In limits.properties, configure the following properties:

Accelerator URL

Mapping of the Accelerators to the full REST paths of the /cube REST endpoint.

acc.url.map={'ATOTI': 'http://localhost:6060/pivot/rest/v6/cube', ...Other Accelerators...}
search.js