Skip to main content

Aggregation

In a real world scenario, such as an array of sensors, there are usually two main cases. A sensor might have one or more independent values which are sampled individually and sent whenever they become available independently. Or a sensor might sample at the same time a number of values, which might as well have some form of correlation.

In Data Orchestrator, this concept is mapped to interface aggregation. In case aggregation is individual, each mapping is treated as an independent value and is managed individually. In case aggregation is object, Data Orchestrator expects the owner to send all of the interface's mappings at the same time, packed in a single message. In this case, all of the mappings share some core properties such as the timestamp.

Aggregation is a powerful mechanism that can be used to map interfaces to real world "objects". Moreover, aggregated interfaces can also be parametrized, although with some limitations.

Endpoints and Aggregation​

Since Data Orchestrator 0.11, Aggregations cannot have endpoints with depth 1. This was an erroneously allowed behavior in Data Orchestrator 0.10 which is kept for retrocompatibility - however, new interfaces should ensure each endpoint in an aggregate has at least depth 2, as support for depth 1 will be removed in a future release. This change has been done to be consistent with AppEngine API design, and to ensure that path / is not ambiguous.

This is the correct way to set up a valid endpoint structure for an aggregate:

    [...]
"mappings": [
{
"endpoint": "/objects/value",
"type": "integer"
},
{
"endpoint": "/objects/otherValue",
"type": "string"
},
[...]

The following structure, instead, is deprecated:

    [...]
"mappings": [
{
"endpoint": "/value",
"type": "integer"
},
{
"endpoint": "/otherValue",
"type": "string"
},
[...]