Use a ConcurrentSkipListMap to track file hashes instead of ConcurrentHashMap. Since the map is a SortedMap, we can easily remove entire subtrees when they are deleted without having to traverse the entire map. Other map operations are now logarithmic time rather than effectively constant time, but I think that's a reasonable tradeoff.
Use a
ConcurrentSkipListMap
to track file hashes instead ofConcurrentHashMap
. Since the map is aSortedMap
, we can easily remove entire subtrees when they are deleted without having to traverse the entire map. Other map operations are now logarithmic time rather than effectively constant time, but I think that's a reasonable tradeoff.