use of org.apache.apex.malhar.lib.logs.DimensionObject in project apex-malhar by apache.
the class DimensionOperatorUnifier method endWindow.
@Override
public void endWindow() {
Map<String, DimensionObject<String>> outputAggregationsObject;
for (Entry<String, Map<String, Map<AggregateOperation, Number>>> keys : unifiedCache.entrySet()) {
String key = keys.getKey();
Map<String, Map<AggregateOperation, Number>> dimValues = keys.getValue();
for (Entry<String, Map<AggregateOperation, Number>> dimValue : dimValues.entrySet()) {
String dimValueName = dimValue.getKey();
Map<AggregateOperation, Number> operations = dimValue.getValue();
outputAggregationsObject = new HashMap<String, DimensionObject<String>>();
for (Entry<AggregateOperation, Number> operation : operations.entrySet()) {
AggregateOperation aggrOperationType = operation.getKey();
Number aggr = operation.getValue();
String outKey = key + "." + aggrOperationType.name();
DimensionObject<String> outDimObj = new DimensionObject<String>(new MutableDouble(aggr), dimValueName);
outputAggregationsObject.put(outKey, outDimObj);
}
aggregationsOutput.emit(outputAggregationsObject);
}
}
}
Aggregations