如何使用 Guava 构建 ConcurrentLinkedHashmap?
How to build a ConcurrentLinkedHashmap using Guava?
几个链接显示https://code.google.com/p/concurrentlinkedhashmap/已经移植到Guava,但是我在Guava中找不到对应的API。
任何人都可以向我展示使用 Guava 构建 ConcurrentLinkedHashmap 的示例吗?
谢谢!
ConcurrentLinkedHashmap API 没有移植到 Guava 1:1,但在 MapMaker
and Cache
(with CacheBuilder
中使用了 CLHM 的一些解决方案。
ConcurrentLinkedHashmap 的作者 Ben Manes 回答了一个问题,可以澄清你的疑惑:What does it mean that ConcurrentLinkedHashMap has been integrated into Guava?:
Guava is the long term replacement and most of the time you should use it. The history is that ConcurrentLinkedHashMap figured out the algorithms, Guava subsumed it, and then focused on adding features.
我认为同样重要的是要注意他目前正在编写另一个可能适合您需要的库:
Caffeine is a Java 8 rewrite of Guava's cache. It tries to provide the best of ConcurrentLinkedHashMap and Guava, modernized with Java 8, and adopting the techniques that I've learned since those previous projects.
几个链接显示https://code.google.com/p/concurrentlinkedhashmap/已经移植到Guava,但是我在Guava中找不到对应的API。
任何人都可以向我展示使用 Guava 构建 ConcurrentLinkedHashmap 的示例吗?
谢谢!
ConcurrentLinkedHashmap API 没有移植到 Guava 1:1,但在 MapMaker
and Cache
(with CacheBuilder
中使用了 CLHM 的一些解决方案。
ConcurrentLinkedHashmap 的作者 Ben Manes 回答了一个问题,可以澄清你的疑惑:What does it mean that ConcurrentLinkedHashMap has been integrated into Guava?:
Guava is the long term replacement and most of the time you should use it. The history is that ConcurrentLinkedHashMap figured out the algorithms, Guava subsumed it, and then focused on adding features.
我认为同样重要的是要注意他目前正在编写另一个可能适合您需要的库:
Caffeine is a Java 8 rewrite of Guava's cache. It tries to provide the best of ConcurrentLinkedHashMap and Guava, modernized with Java 8, and adopting the techniques that I've learned since those previous projects.