Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-3267

Replace ContainerCache in BlockUtils by LoadingCache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      As discussed in here current version of ContainerCache is just used by BlockUtils and has several architectural issues. for example:

      • It uses a ReentrantLock which could be replaced by synchronized methods
      • It should maintain a referenceCount for each DBHandler
      • It extends LRUMap while it would be better to hide it by the composition and not expose LRUMap related methods.

      As pifta suggests, we could replace all ContainerCache functionality by using Guava LoadingCache.

      This new LoadingCache could be configured to evict by size, by this configuration the functionality would be slightly different as it may evict DBHandlers while they are in use (referenceCount>0) but we can configure it to use reference base eviction based on CacheBuilder.weakValues()

      I want to open this discussion here instead of Github so I created this ticket.

      Attachments

        Issue Links

          Activity

            People

              esa.hekmat Isa Hekmatizadeh
              esa.hekmat Isa Hekmatizadeh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m