[
https://issues.jboss.org/browse/JGRP-2126?page=com.atlassian.jira.plugin....
]
Bela Ban commented on JGRP-2126:
--------------------------------
Added Table.removeMany():
{code:java}
<R> R removeMany(final AtomicBoolean processing, boolean nullify, int max_results,
Predicate<T> filter, Supplier<R> result_creator, BiConsumer<R,T>
accumulator, Predicate<R> result_validator)
{code}, which accepts a result creator, accumulator and validator (similar to
Stream.collect()).
Both NAKACK2 and UNICAST3 create a MessageBatch and use it to move messages from the table
to the batch, avoiding a temporary list creation.
Table.removeMany() creates unneeded temporary list
--------------------------------------------------
Key: JGRP-2126
URL:
https://issues.jboss.org/browse/JGRP-2126
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Labels: CR3
Fix For: 4.0
When a thread acquires the CAS in NAKACK2 or UNICAST3 to deliver messages, it calls
Table.removeMany() which removes messages that satisfy a condition and return them as a
list. Next, a MessageBatch is created off of that list and passed up.
The creation of the temp list is unnecessary; instead create a properly sized
MessageBatch and make Table.removeMany() add the messages directly into the batch.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)