Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4463 Make caching implementation configurable
  3. ACCUMULO-4641

Modify BlockCache interface to avoid race conditions

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None

    Description

      Currently the BlockCache interface has functions to get and put. Accumulo will try to get a block, if it does not exist load it, and then put it in the cache. This can lead to race conditions where multiple threads unnecessarily load the same block.

      I think it would be better to modify the block cache interface to only have a function like the following.

        CacheEntry get(String blockName, BlockLoader loader)
      

      BlockLoader represents a function that the cache can call if a block is not present. The cache implementation can attempt to handle load race conditions however it likes..

      Attachments

        Issue Links

          Activity

            People

              kturner Keith Turner
              kturner Keith Turner
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 2h 40m
                  2h 40m