Hi Brian , thank you for your reply. To be precise I studied the possibility to open a window on an attribute value and close it after an user-defined time and if there are no more events with the same key. In flink side lot operator send Event with SUCCESS OR FAIL . operator is running in paralleles. I wanted to be able to do a aggregation to determine if there was an error or not during a life cycle iteration. each life cycle is unique and associated with a UUID
Le ven. 23 août 2019 à 21:00, Bryan Bende <[email protected]> a écrit : > I think AttributeRollingWindow was made to aggregate a numeric > attribute. So for example, if all flows files had an attribute called > "amount" that was an integer, then you could say Value to Track = > ${amount} and it would aggregate those values over window. > > In your case the attribute you have is not the value to aggregate, its > a key. The value in your case is a constant of 1 where you want to > increment the aggregated value by 1 whenever you see the key. > > I guess it depends what you want to do with the aggregated value, but > your situation seems closer to a counter which could be tracked with > UpdateCounter setting the Counter Name to ${eventUuid} and the Delta > to 1, but then I don't know exactly how you would use this counter > later. > > On Fri, Aug 23, 2019 at 1:59 PM Steve Robert > <[email protected]> wrote: > > > > Hi Guys , > > > > I apologize in advance if my question seems trivial but I am new on Nifi. > > I'm studying Nifi for an integration with Flink that I'm used to. > > > > Since flink I send events using Site-to-Site to Nifi. > > the Flowfile have attribute > "eventUuid":"97f82c90-0782-4aab-8850-56ee60b0b73d" > > > > I would like to do an aggregation on events based on the value of this > attribute, > > > > so I look at the documentation of AttributeRollingWindow. > > > > I understood by looking at the errors that this operator does not accept > strings and therefore can not track a value on String > > Value to Track : ${eventUuid} will throw NumberFormatExceptions. > > > > Value to Track : ${eventUuid:toNumber()} will not work because UUID > 128 bit can't be convert to an 32 bytes number; > > > > Is this a limitation or a bad approach on my part? I can not use an > event on the timestamp here because this UUID is generated at the beginning > of the workflow > > Thank a lot for your help > > Steve > > > > >
