accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ben-manes <...@git.apache.org>
Subject [GitHub] accumulo pull request #251: ACCUMULO-4626 added weak reference value map for...
Date Wed, 26 Apr 2017 05:36:43 GMT
Github user ben-manes commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/251#discussion_r113368843
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/TinyLfuBlockCache.java
---
    @@ -48,12 +52,13 @@
       private final Cache<String,Block> cache;
       private final Policy.Eviction<String,Block> policy;
       private final ScheduledExecutorService statsExecutor;
    +  private final Map<String,CacheEntry> weakEvictionMap = new MapMaker().weakValues().makeMap();
    --- End diff --
    
    FYI, Caffeine also supports weak values so you could use two instances. It has better
concurrency and creates less garbage, whereas Guava's has slightly better memory efficiency
due to forking the hash table.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message