[ 
https://issues.apache.org/jira/browse/NIFI-1442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15214425#comment-15214425
 ] 

Toivo Adams commented on NIFI-1442:
-----------------------------------

Mark,

Funny, I also considered CircularLifoQueue but finally decided not to use it.
My main concern was  CircularLifoQueue doesn't have Set semantics (no 
duplicates).
I was cautious, although it was weird. Better safe than sorry.
I still don't know NiFi internals very well. Not yet :)

Today I looked deeper and it seems Set like behavior is not needed and don't 
work for Bulletins anyway. Reason is simple – Bulletin and its subclasses don't 
implement equals and hashCode so Set container has no info how to avoid 
duplicates.  

What you mean by “continually generating bulletins, creating the LinkedHashMap 
continually is fairly expensive”?
LinkedHashMap is created once when NodeBulletinProcessingStrategy is created.
Same way as  CircularLifoQueue is created.
But I agree CircularLifoQueue might have better performance.

Your code looks good.
In conclusion, I don't have nothing against  CircularLifoQueue.

Do you have some unresolved issues for me also?
:)

Thanks
Toivo

> When clustered, nodes hold onto and send back too many bulletins
> ----------------------------------------------------------------
>
>                 Key: NIFI-1442
>                 URL: https://issues.apache.org/jira/browse/NIFI-1442
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Toivo Adams
>             Fix For: 0.7.0
>
>         Attachments: 
> 0001-NIFI-1442-Use-CircularFifoQueue-instead-of-Set-to-st.patch, 
> 0001-NIFI-1442-Use-CircularFifoQueue-instead-of-Set-to-st.patch
>
>
> The NodeBulletinProcessingStrategy will cache all bulletins for all 
> components for some amount of time. However, since only the 5 most recent 
> bulletins for each component will be displayed to the user, the strategy 
> should not hold more than 5 of them in memory.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to