Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-11514

CacheMgmtInterceptor getNumberOfEntries should include expired entries

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • Major
    • None
    • 11.0.0.Dev03
    • API, Core
    • None

    Description

      CacheMgmtInterceptor.getNumberOfEntries and CacheMgmtInterceptor.getNumberOfEntriesInMemory both require an iteration over the data container and/or stores in order to exclude expired entries.

      Since these are statistics, they don't have to be exact, so we can include expired entries until a read or the expiration reaper removes them from the cache. In fact, I would argue that it's more correct for CacheMgmtInterceptor.getNumberOfEntriesInMemory to include expired entries, because expired entries still use memory until they are removed.

      The most likely reason that the strategy for counting entries was changed with ISPN-7686 is that the AdvancedCache doesn't have a sizeIncludingExpired method. Since it's not possible to obtain the exact size of the cache with passivation enabled without iterating over the store to eliminate duplicates, I suggest instead to estimate CacheMgmtInterceptor.getNumberOfEntries as the number of entries in the data container + the number of entries in the store.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: