Closed GoogleCodeExporter closed 9 years ago
Is Guava'a CacheBuilder or MapMaker suitable instead? It provides an amortized,
semi-lazy expiration that can be performed eagerly by using an axillary thread
calling #cleanup(). The ExpirableMap is optionally eager if an executor is
specified, but can suffer from a dog pile effect due to stale events on the
priority queue. Its a simple but naive approach.
The ExpirableMap tutorial predates this project. The implementation in Guava is
based on CLHM's algorithmic ideas and I'm much more comfortable supporting that
approach long-term. If Gauva isn't satisfactory, please describe why and
optionally open an issue on their side.
If you work in Scala then the Blueeyes project ported the tutorial. You are
more than welcome to remove custom utilities and have your own version in Java.
https://github.com/jdegoes/blueeyes/blob/master/src/main/scala/blueeyes/persiste
nce/cache/ExpirableMap.scala
Original comment by Ben.Manes@gmail.com
on 18 Oct 2011 at 5:10
I apologize but I did not know about Guava MapMaker time based feature. You can
close this issue. Thanks :-)
Original comment by m.zd...@gmail.com
on 18 Oct 2011 at 5:18
But do prefer CacheBuilder over MapMaker (whose caching functionality is being
deprecated).
Original comment by fry@google.com
on 18 Oct 2011 at 5:20
Original comment by Ben.Manes@gmail.com
on 18 Oct 2011 at 5:35
Original issue reported on code.google.com by
m.zd...@gmail.com
on 18 Oct 2011 at 4:45