accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjwall <...@git.apache.org>
Subject [GitHub] accumulo pull request #256: ACCUMULO-4463: Make block cache implementation c...
Date Thu, 11 May 2017 17:57:33 GMT
Github user mjwall commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/256#discussion_r116045467
  
    --- Diff: core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/lru/LruBlockCache.java
---
    @@ -99,116 +91,57 @@
       private final ScheduledExecutorService scheduleThreadPool = Executors.newScheduledThreadPool(1,
new NamingThreadFactory("LRUBlockCacheStats"));
     
       /** Current size of cache */
    -  private final AtomicLong size;
    +  private AtomicLong size;
     
       /** Current number of cached elements */
    -  private final AtomicLong elements;
    +  private AtomicLong elements;
     
       /** Cache access count (sequential ID) */
    -  private final AtomicLong count;
    +  private AtomicLong count;
     
       /** Cache statistics */
    -  private final CacheStats stats;
    -
    -  /** Maximum allowable size of cache (block put if size > max, evict) */
    -  private long maxSize;
    -
    -  /** Approximate block size */
    -  private long blockSize;
    -
    -  /** Acceptable size of cache (no evictions if size < acceptable) */
    -  private float acceptableFactor;
    -
    -  /** Minimum threshold of cache (when evicting, evict until size < min) */
    -  private float minFactor;
    -
    -  /** Single access bucket size */
    -  private float singleFactor;
    -
    -  /** Multiple access bucket size */
    -  private float multiFactor;
    -
    -  /** In-memory bucket size */
    -  private float memoryFactor;
    +  private CacheStats stats;
     
       /** Overhead of the structure itself */
    -  private long overhead;
    +  private final long overhead;
    +
    +  private final LruBlockCacheConfiguration conf;
     
       /**
        * Default constructor. Specify maximum size and expected average block size (approximation
is fine).
        *
        * <p>
        * All other factors will be calculated based on defaults specified in this class.
        *
    +   * @param conf
    +   *          block cache configuration
        * @param maxSize
        *          maximum size of cache, in bytes
        * @param blockSize
        *          approximate size of each block, in bytes
        */
    -  public LruBlockCache(long maxSize, long blockSize) {
    -    this(maxSize, blockSize, true);
    -  }
    +  public LruBlockCache(final LruBlockCacheConfiguration conf) {
    --- End diff --
    
    Nice cleanup with the conf


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