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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations