Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IMap.removeAll() doesn't support PartitionPredicate #12238

awakestu opened this Issue Feb 1, 2018 · 3 comments


Copy link

awakestu commented Feb 1, 2018

When trying to call removeAll with PartitionPredicate it results in UnsupportedOperationException


This comment has been minimized.

Copy link

dimas commented Feb 4, 2018

JFYI, Hazelcast is 3.9 and operation is invoked via client (so not directly on a member).


This comment has been minimized.

Copy link

blazember commented Feb 12, 2018

@awakestu and @dimas IMap.removeAll() does not support PartitionPredicate.
PartitionPredicate was added for some specific use cases and is not yet supported by each method accepting Predicates.

As an alternative, IMap.executeOnEntries() accepts PartitionPrecicate. With that, entries can be removed from the map by setting the value to null in the EntryProcessor. Does this fit in your use-case?


This comment has been minimized.

Copy link

dimas commented Mar 11, 2018

@blazember, thanks for the suggestion but we were not looking for other ways of doing the same thing - we can just call keySet() with the predicate and then iterate over keys calling delete (and this is what we actually do).
Still, the fact that removeAll does not handle PartitionPredicate properly seems like an oversight not a feature than need defending :)
The removeAll javadoc does not mention anywhere that certain types of predicates are not supported and I do not see any reason not to support it properly. keySet handles it so why removeAll should not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.