Skip to content

NMS-19537: Reworked Interpolator to create Scope on demand#8316

Open
christianpape wants to merge 2 commits intofoundation-2024from
jira/NMS-19537
Open

NMS-19537: Reworked Interpolator to create Scope on demand#8316
christianpape wants to merge 2 commits intofoundation-2024from
jira/NMS-19537

Conversation

@christianpape
Copy link
Contributor

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a ConfigAdmin-tunable cache wrapper around the MATE EntityScopeProvider and wires it into thresholding so metadata lookups can be reused rather than repeatedly fetched.

Changes:

  • Introduces CachedEntityScopeProvider backed by Guava LoadingCache with configurable expiry/refresh/size.
  • Updates threshd blueprint wiring to wrap EntityScopeProviderImpl with the cached provider and add ConfigAdmin defaults.
  • Adds an integration test subclass intended to run existing scope-provider ITs against the cached wrapper.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
features/collection/thresholding/impl/src/main/resources/OSGI-INF/blueprint/blueprint.xml Adds ConfigAdmin properties + wires DefaultThresholdingSetPersister to use a cached scope provider.
core/mate/model/src/test/java/org/opennms/core/mate/model/EntityScopeProviderIT.java Makes injected fields protected to allow reuse in a subclass IT.
core/mate/model/src/test/java/org/opennms/core/mate/model/CachedEntityScopeProviderIT.java New IT subclass that wraps the provider with the cache.
core/mate/model/src/main/java/org/opennms/core/mate/model/CachedEntityScopeProvider.java New cached EntityScopeProvider implementation using Guava caches.
core/mate/model/pom.xml Adds an explicit Guava dependency for the new caching implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@christianpape christianpape force-pushed the jira/NMS-19537 branch 2 times, most recently from 7c98e8c to 16d4c8b Compare February 25, 2026 07:28
@indigo423
Copy link
Member

indigo423 commented Feb 25, 2026

Just thinking out loud. The Metadata interpolation happens also in the service monitoring framework in Pollderd and has a similar characteristic. Would we have to re-implement a similar cache there as well?

The generic question that comes out of this. Do we have to implement such a cache in any hot path for daemons where we poll large data endpoint or additional latency reduces our monitoring throughput (e.g. SNMP Interface Poller, Enlinkd, Pollerd, Collectd and Provisiond)?

There might be others where want to use Metadata in the future.

@christianpape
Copy link
Contributor Author

christianpape commented Feb 25, 2026

Just thinking out loud. The Metadata interpolation happens also in the service monitoring framework in Pollderd and has a similar characteristic. Would we have to re-implement a similar cache there as well?

The generic question that comes out of this. Do we have to implement such a cache in any hot path for daemons where we poll large data endpoint or additional latency reduces our monitoring throughput (e.g. SNMP Interface Poller, Enlinkd, Pollerd, Collectd and Provisiond)?

There might be others where want to use Metadata in the future.

It's just wiring in another implementation. This will be easy as long as we know that this cache really solves the problem.

@christianpape christianpape force-pushed the jira/NMS-19537 branch 7 times, most recently from 3007d81 to 774e78c Compare February 27, 2026 08:23
Copy link
Contributor

@cgorantla cgorantla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to separate ScopeProvider changes from the cache changes.

Also we should avoid reordering imports for easier diff

@christianpape christianpape changed the title NMS-19537: Using metadata cache for thresholding NMS-19537: Reworked Interpolator to create Scope on demand Mar 3, 2026
@christianpape
Copy link
Contributor Author

It would be good to separate ScopeProvider changes from the cache changes.

Also we should avoid reordering imports for easier diff

Cache is moved to issue NMS-19573 and PR #8331.

@christianpape christianpape changed the base branch from foundation-2024 to foundation-2025 March 6, 2026 09:19
@christianpape christianpape changed the base branch from foundation-2025 to release-35.x March 6, 2026 09:21
@christianpape christianpape changed the base branch from release-35.x to foundation-2024 March 7, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants