Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OPIK-595] Automation rule evaluator cache #1042

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

thiagohora
Copy link
Contributor

@thiagohora thiagohora commented Jan 14, 2025

Details

Add Redis cache to automation rules evaluator

Issues

OPIK-595

@thiagohora thiagohora requested a review from a team as a code owner January 14, 2025 13:16
@thiagohora thiagohora self-assigned this Jan 14, 2025
Copy link
Contributor

@ldaugusto ldaugusto left a comment

Choose a reason for hiding this comment

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

Very neat solution! Just wondering about the @cACHEpUT thing as I couldnt see its usage

@@ -50,50 +50,54 @@ public Object invoke(MethodInvocation invocation) throws Throwable {
var cacheable = method.getAnnotation(Cacheable.class);
if (cacheable != null) {
return runCacheAwareAction(invocation, isReactive, cacheable.name(), cacheable.key(),
(key, name) -> processCacheableMethod(invocation, isReactive, key, name, cacheable));
(key, group) -> processCacheableMethod(invocation, isReactive, key, group, cacheable));
}

var cachePut = method.getAnnotation(CachePut.class);
if (cachePut != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is @cACHEpUT used anywhere? I could find @Cacheable and @CacheEvict, but not this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not yet, but the idea was to create a simple mechanism covering the most general cases. I guess the Cache Put makes more sense for get-by-id cases to update the cache.

@thiagohora thiagohora merged commit 270a8f2 into main Jan 15, 2025
8 checks passed
@thiagohora thiagohora deleted the thiagohora/OPIK-595_automation_rule_evaluator_cache branch January 15, 2025 13:58
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.

2 participants