[INFRAUTILS-9] Caches infrastructure Created: 25/Apr/17  Updated: 19/Oct/17  Resolved: 25/Sep/17

Status: Resolved
Project: infrautils
Component/s: General
Affects Version/s: (unspecified)
Fix Version/s: None

Type: Improvement
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

https://lists.opendaylight.org/pipermail/genius-dev/2017-March/001152.html

Projects such as genius and netvirt, and probably others too, today have A LOT of caches in code already, all over the place, some using an old deprecated DataStoreCache API which has a number of known problems, some just using ad hoc in-line solutions, typically a (static) ConcurrentMap.

Issues with this as-is situation include technical debt issues include: (a) problematic testability due to frequent use of static, (b) possible unbounded cache growth due to lack of invalidation with proper API abstraction, thus potential memory usage issues at scale, (c) total lack of any sort of monitoring capability of cache usage e.g. by CLI commands, and any sort of administration of cache sizing and policy etc. For debuggability purpose we need to add utilities to dump these caches and reset them.

https://git.opendaylight.org/gerrit/#/c/48920/ proposes a (first version of) a consistent shared common caching infrastructure addressing these points for use OpenDaylight projects (primary intended to initially be consumed in genius and netvirt, replacing the existing as-is caches).

https://www.youtube.com/watch?v=h4HOSRN2aFc has a screen cast demo of this.

Main API interfaces are the CacheProvider and the Cache and CacheFunction.

SampleServiceWithCachingImpl code illustrates the use.



 Comments   
Comment by Ryan Goulding [ 25/Jul/17 ]

Is this targeted at Nitrogen?

Comment by Michael Vorburger [ 26/Jul/17 ]

> Is this targeted at Nitrogen?

Yeah, I'm planning to wrap this up ASAP (but am travelling and on PTO next 2 wks)

Comment by Michael Vorburger [ 04/Aug/17 ]

Rebased c/48920 and finished up JavaDoc today, hoping to merge next week.

Also new https://git.opendaylight.org/gerrit/#/c/61192/ extension.

Comment by Michael Vorburger [ 21/Aug/17 ]

>> Is this targeted at Nitrogen?
> Yeah, I'm planning to wrap this up ASAP (but am travelling and on PTO next 2 wks)

FINALLY merged this today, into master not stable/nitrogen anymore.

If anyone is actually starting to use this anywhere in master and wants to cherry-pick code from stable/nitrogen to master but cannot because of this, then I would be happy to cherry-pick c/48920 (patch set 36, before the pom.xml adjustments for master done in the final patch set) and c/61192 - just email infrautils-dev, should this be useful; otherwise no need.

Closing this as Fixed. Further requirements, refinements, fixed should go into new issues.

Generated at Wed Feb 07 20:02:01 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.