Class EntryCacheDefaultEvictionPolicy

java.lang.Object
org.apache.bookkeeper.mledger.impl.cache.EntryCacheDefaultEvictionPolicy
All Implemented Interfaces:
EntryCacheEvictionPolicy

public class EntryCacheDefaultEvictionPolicy extends Object implements EntryCacheEvictionPolicy
Default eviction policy.

This policy consider only the bigger caches for doing eviction.

The PercentOfSizeToConsiderForEviction parameter should always be bigger than the cacheEvictionWatermak, otherwisethe eviction cycle will free less memory than what was required.

  • Constructor Details

    • EntryCacheDefaultEvictionPolicy

      public EntryCacheDefaultEvictionPolicy()
  • Method Details

    • doEviction

      public void doEviction(List<EntryCache> caches, long sizeToFree)
      Description copied from interface: EntryCacheEvictionPolicy
      Perform the cache eviction of at least sizeToFree bytes on the supplied list of caches.
      Specified by:
      doEviction in interface EntryCacheEvictionPolicy
      Parameters:
      caches - the list of caches to consider
      sizeToFree - the minimum size in bytes to be freed