If I use groupby followed by a CombinerAggregator, is it guaranteed that
the output of the CombinerAggregator for a given groupby() field will
always go to the same partition?

For example, if I wanted to aggregate errors for a subscriber at a device,
then send them to a stateful filter function "RisingFallingAlarmFilter"
that set an alarm if errors exceeded a threshold and cleared it if they
dropped below the threshold, should this work?

        mySpout

            .groupBy(new Fields("Device", "Subscriber"))
            .aggregate(new Fields("Errors"), new Sum(), new
Fields("Errors_sum"))
            .parallelismHint(4)
            .each(new Fields("Device", "Subscriber", "Errors_sum"), new
RisingFallingAlarmFilter());

Or is it required to do something like:
        myStream
            .groupBy(new Fields("Device", "Subscriber"))
            .aggregate(new Fields("Errors"), new Sum(), new
Fields("Errors_sum"))
            .parallelismHint(4)
            .partitionBy(new Fields("Device", "Subscriber"))
            .each(new Fields("Device", "Subscriber", "Errors_sum"), new
RisingFallingAlarmFilter());

Reply via email to