Search in sources :

Example 6 with MultiWindowDimensionAggregation

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;
}
Also used : MultiWindowDimensionAggregation(org.apache.apex.malhar.lib.logs.MultiWindowDimensionAggregation) ArrayList(java.util.ArrayList)

Example 7 with MultiWindowDimensionAggregation

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;
}
Also used : MultiWindowDimensionAggregation(org.apache.apex.malhar.lib.logs.MultiWindowDimensionAggregation) ArrayList(java.util.ArrayList)

Aggregations

MultiWindowDimensionAggregation (org.apache.apex.malhar.lib.logs.MultiWindowDimensionAggregation)7 ArrayList (java.util.ArrayList)6 SelectOperator (org.apache.apex.malhar.contrib.misc.streamquery.SelectOperator)1 ConsoleOutputOperator (org.apache.apex.malhar.lib.io.ConsoleOutputOperator)1 DimensionObject (org.apache.apex.malhar.lib.logs.DimensionObject)1 Counter (org.apache.apex.malhar.lib.stream.Counter)1 JsonByteArrayOperator (org.apache.apex.malhar.lib.stream.JsonByteArrayOperator)1 DimensionTimeBucketSumOperator (org.apache.apex.malhar.lib.util.DimensionTimeBucketSumOperator)1