accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From keith-turner <...@git.apache.org>
Subject [GitHub] accumulo pull request #256: ACCUMULO-4463: Make block cache implentation con...
Date Mon, 08 May 2017 16:38:02 GMT
Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/256#discussion_r115293480
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
---
    @@ -84,7 +85,7 @@
       static final int statThreadPeriod = 60;
     
       /** Concurrent map (the cache) */
    -  private final ConcurrentHashMap<String,CachedBlock> map;
    --- End diff --
    
    One more thought.. may want to have an enum cache type.
    
    ```java
    enum CacheType {
      INDEX,
      DATA,
      SUMMARY
    }
    ```
    
    Then the factory could key use this.
    
    ```java
    public interface BlockCacheFactory {
      /**
       * TODO document how this can utilize the new arbitrary instance config
       */
      public BlockCache getBlockCache(CacheType ct, AccumuloConfiguration conf);
    } 
    ```
    
    Then the implementation could use this for differentiated config.
    
    ```java
    public class SuperDuperBlockCacheFactory implement BlockCacheFactory {
       public BlockCache getBlockCache(CacheType ct, AccumuloConfiguration conf) {
           long knob42 = conf.getMemory("general.custom."+ct.name()+".knob42");
            //read whatever is needed from config in local vars
            return new SuperDuperBlockCacheFactory(knob42);
       }
    }
    ```



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