Reputation: 1591
I need to create a concurrent map with <String, AtomicLong>
parameters. The map should be sorted based on it's value, when I increment the AtomicLong
, it should also balance itself.
The problem with ConcurrentSkipListMap
is that it cannot sort the map based on its value. TreeMap is not a concurrent data structure.
I'm looking for a data structure so that complexity of insertion should be O(log(n))
like TreeMap
and ConcurrentSkipListMap
. Also, the values are not unique so that there may be multiple map entries that have same numeric value in AtomicLong
.
Upvotes: 0
Views: 609