Hi,
I am upgrading from Google Collections 0.9 to 1.0. It seems Sets.newConcurrentHashSet()
is no longer available. I was using it in the following construct:
public static <K, V> Multimap<K, V> newConcurrentMultimap() { return Multimaps.newMultimap( new ConcurrentHashMap<K, Collection<V>>(), new Supplier>() { @Override public Collection<V> get() { return Sets.<V>newConcurrentHashSet(); } } ); }
What would be the best replacement for Sets.newConcurrentHashSet() ?
Edit: The reason for this construct is to have a multimap that is safe to read and write from multiple threads. It is used in a mostly-read scenario (and will be read a lot).
regards,
Wim