use of org.apache.apex.malhar.lib.logs.MultiWindowDimensionAggregation in project apex-malhar by apache.
the class Application method getApacheAggregationSumOper.
private MultiWindowDimensionAggregation getApacheAggregationSumOper(String name, DAG dag) {
MultiWindowDimensionAggregation oper = dag.addOperator(name, MultiWindowDimensionAggregation.class);
oper.setWindowSize(3);
List<int[]> dimensionArrayList = new ArrayList<int[]>();
int[] dimensionArray1 = { 1 };
dimensionArrayList.add(dimensionArray1);
oper.setDimensionArray(dimensionArrayList);
oper.setTimeBucket(TIME_BUCKETS.m.name());
// aggregate on sum
oper.setDimensionKeyVal("1");
// 1 sec window
oper.setWindowSize(2);
return oper;
}
use of org.apache.apex.malhar.lib.logs.MultiWindowDimensionAggregation in project apex-malhar by apache.
the class Application method getSystemAggregationOper.
private MultiWindowDimensionAggregation getSystemAggregationOper(String name, DAG dag) {
MultiWindowDimensionAggregation oper = dag.addOperator(name, MultiWindowDimensionAggregation.class);
oper.setWindowSize(3);
List<int[]> dimensionArrayList = new ArrayList<int[]>();
int[] dimensionArray = { 0 };
dimensionArrayList.add(dimensionArray);
oper.setDimensionArray(dimensionArrayList);
oper.setTimeBucket(TIME_BUCKETS.m.name());
oper.setDimensionKeyVal("1");
oper.setOperationType(AggregateOperation.AVERAGE);
// 1 min window
oper.setWindowSize(120);
return oper;
}
Aggregations