[infinispan-issues] [JBoss JIRA] (ISPN-11514) CacheMgmtInterceptor getNumberOfEntries should include expired entries

Dan Berindei (Jira) issues at jboss.org
Tue Mar 24 21:57:26 EDT 2020


     [ https://issues.redhat.com/browse/ISPN-11514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Berindei updated ISPN-11514:
--------------------------------
    Status: Open  (was: New)


> CacheMgmtInterceptor getNumberOfEntries should include expired entries
> ----------------------------------------------------------------------
>
>                 Key: ISPN-11514
>                 URL: https://issues.redhat.com/browse/ISPN-11514
>             Project: Infinispan
>          Issue Type: Feature Request
>          Components: API, Core
>    Affects Versions: 11.0.0.Dev03
>            Reporter: Dan Berindei
>            Assignee: Dan Berindei
>            Priority: Major
>             Fix For: 11.0.0.Final
>
>
> {{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.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the infinispan-issues mailing list