accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From keith-turner <>
Subject [GitHub] accumulo pull request #256: ACCUMULO-4463: Make block cache implentation con...
Date Mon, 08 May 2017 16:22:19 GMT
Github user keith-turner commented on a diff in the pull request:
    --- Diff: core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/
    @@ -84,7 +85,7 @@
       static final int statThreadPeriod = 60;
       /** Concurrent map (the cache) */
    -  private final ConcurrentHashMap<String,CachedBlock> map;
    --- End diff --
    It may be nice to keep the ability to have these final for performance reasons.  I think
we could do this if we made the BlockCacheFactory configurable instead of the BlockCache.
 For example if we had an interface like
    public interface BlockCacheFactory {
       * TODO document how this can utilize the new arbitrary instance config
      public BlockCache getBlockCache(AccumuloConfiguration conf);
    If we had that then we could configure an LruBlockCacheFactory that actually calls the
constructor, enabling us to keep using final.
    public class LruBlockCacheFactory implement BlockCacheFactory {
       public BlockCache getBlockCache(AccumuloConfiguration conf) {
            //read whatever is needed from config in local vars
            return new LruBlockCache(localVar1, localVar2);
    With this, the `start()` method would not be needed also.  The `start()` method makes
assumptions about the required config.  Using the configurable factory makes no assumptions
about the config needed.

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 or file a JIRA ticket
with INFRA.

View raw message