As a continuation, here are some details that I omitted from the previous discussions that you contacted about my parallel implementation with several modes.
This implementation followed your first suggestion: leaving empty collections on the support map. The following real-time behavior complicates your other suggestions.
Multimap<String, Integer> multimap = HashMultimap.create(); Set<Integer> set = multimap.get("foo"); multimap.put("foo", 1); int count = set.size();
For a real application, unlike a collection library class, it is likely to be quite smaller than a fully parallel multicast. You can define your own class that implements a subset of the Multimap interface or a limited selection of concurrency guarantees. Or, your application logic can minimize the inconsistency of a synchronized multimap to avoid performance issues.
Jared levy
source share