[jgroups-users] CollectionViews are not replicated in ReplicatedHashmap
Questions/problems related to using JGroups <[email protected]> Thu, 23 May 2019 17:00:24 +0200
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <mailman.30336.1558623636.1476.javagroups-users@lists.sourceforge.net> |
Hello,
Javas Map interface allows you to do things like:
map.keySet().retainAll(<whatINeed>);
After skimming through ReplicatedHashMaps source code it seems like this
syntax isn't really supported by this class and writes to the
keySet,entrySet or values will not be replicated accross the cluster.
This might be easily fixable by changing the three view methods.
@Override
public Collection<V> values() {
return map.values();
}
to
@Override
public Collection<V> values() {
return super.values();
}
or just remove these 3 methods alltogether, effictivly being the same thing.
Best regards,
Thorsten