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:31:46 GMT
Github user ben-manes commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/251#discussion_r113368473
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/TinyLfuBlockCache.java
---
    @@ -68,7 +73,10 @@ public long getMaxSize() {
     
       @Override
       public CacheEntry getBlock(String blockName) {
    -    return cache.getIfPresent(blockName);
    +    CacheEntry ce = cache.getIfPresent(blockName);
    +    if (ce != null)
    +      return ce;
    +    return weakEvictionMap.get(blockName);
    --- End diff --
    
    You might prefer to promote the entry using a CacheLoader. Otherwise your recovery of
a premature eviction would still allow the entry to be collected eventually.


---
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