Search in sources :

Example 1 with Aggregate

use of org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate in project apex-malhar by apache.

the class AggregatorFirst method getGroup.

@Override
public Aggregate getGroup(InputEvent src, int aggregatorIndex) {
    Aggregate aggregate = super.getGroup(src, aggregatorIndex);
    GPOUtils.indirectCopy(aggregate.getAggregates(), src.getAggregates(), context.indexSubsetAggregates);
    return aggregate;
}
Also used : Aggregate(org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate)

Example 2 with Aggregate

use of org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate in project apex-malhar by apache.

the class AggregatorLast method getGroup.

@Override
public Aggregate getGroup(InputEvent src, int aggregatorIndex) {
    Aggregate aggregate = super.getGroup(src, aggregatorIndex);
    GPOUtils.indirectCopy(aggregate.getAggregates(), src.getAggregates(), context.indexSubsetAggregates);
    return aggregate;
}
Also used : Aggregate(org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate)

Example 3 with Aggregate

use of org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate in project apex-malhar by apache.

the class AggregatorMin method getGroup.

@Override
public Aggregate getGroup(InputEvent src, int aggregatorIndex) {
    Aggregate aggregate = super.getGroup(src, aggregatorIndex);
    GPOUtils.indirectCopy(aggregate.getAggregates(), src.getAggregates(), context.indexSubsetAggregates);
    return aggregate;
}
Also used : Aggregate(org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate)

Example 4 with Aggregate

use of org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate in project apex-malhar by apache.

the class AggregatorSum method getGroup.

@Override
public Aggregate getGroup(InputEvent src, int aggregatorIndex) {
    src.used = true;
    Aggregate aggregate = createAggregate(src, context, aggregatorIndex);
    GPOMutable value = aggregate.getAggregates();
    GPOUtils.zeroFillNumeric(value);
    return aggregate;
}
Also used : GPOMutable(org.apache.apex.malhar.lib.appdata.gpo.GPOMutable) Aggregate(org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate)

Example 5 with Aggregate

use of org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate in project apex-malhar by apache.

the class AbstractIncrementalAggregator method createAggregate.

/**
 * Creates an {@link Aggregate} from the given {@link InputEvent}.
 *
 * @param inputEvent      The {@link InputEvent} to unpack into an {@link Aggregate}.
 * @param context         The conversion context required to transform the {@link InputEvent} into
 *                        the correct {@link Aggregate}.
 * @param aggregatorIndex The aggregatorIndex assigned to this {@link Aggregate}.
 * @return The converted {@link Aggregate}.
 */
public static Aggregate createAggregate(InputEvent inputEvent, DimensionsConversionContext context, int aggregatorIndex) {
    GPOMutable aggregates = new GPOMutable(context.aggregateDescriptor);
    EventKey eventKey = createEventKey(inputEvent, context, aggregatorIndex);
    Aggregate aggregate = new Aggregate(eventKey, aggregates);
    aggregate.setAggregatorIndex(aggregatorIndex);
    return aggregate;
}
Also used : GPOMutable(org.apache.apex.malhar.lib.appdata.gpo.GPOMutable) EventKey(org.apache.apex.malhar.lib.dimensions.DimensionsEvent.EventKey) Aggregate(org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate)

Aggregations

Aggregate (org.apache.apex.malhar.lib.dimensions.DimensionsEvent.Aggregate)10 GPOMutable (org.apache.apex.malhar.lib.appdata.gpo.GPOMutable)4 EventKey (org.apache.apex.malhar.lib.dimensions.DimensionsEvent.EventKey)3 Map (java.util.Map)1 SerdeListGPOMutable (org.apache.apex.malhar.lib.appdata.gpo.SerdeListGPOMutable)1