-
Notifications
You must be signed in to change notification settings - Fork 3
Feature/add rest redis cache #88
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
Merged
dfuchss
merged 48 commits into
ardoco:main
from
DanielDango:feature/add-rest-redis-cache
Jul 15, 2026
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
6245518
feat: encapsulate cache replacement strategies into enum
DanielDango 95ecd2d
feat: add cache initialization logic to EvaluationConfiguration and u…
DanielDango c34b4e5
feat: make LocalCache implement Cache and revamp CacheReplacementStra…
DanielDango cc8c041
feat: retrieve cache replacement strategy from ModuleConfiguration
DanielDango 5186194
feat: implement HierarchicalCache for multi-layer caching and update …
DanielDango b239c14
docs: update caching documentation to include HierarchicalCache
DanielDango 9c804e1
Merge remote-tracking branch 'refs/remotes/upstream/main' into featur…
DanielDango b4aebe6
feat: support environment-based cache configuration
DanielDango a515e5f
Merge remote-tracking branch 'upstream/main' into fork/DanielDango/fe…
DanielDango 2135004
revert: remove module config for caches, instead get cache configurat…
DanielDango 11aa1bb
test: enhance CacheTest with new entry writing, retrieval, serializat…
DanielDango 68b5c9e
fix: resolve sonar cube issues
DanielDango 4cadcf7
refactor: streamline cache manager configuration
DanielDango 53ebb05
refactor: update cache conflict resolution to replacement strategy te…
DanielDango 8ca6260
revert: remove unused argumentAsEnum method from ModuleConfiguration
DanielDango c1ff184
refactor: enhance cache hierarchy parsing to support quoted strings a…
DanielDango 0940083
refactor: make default cache configuration identical to previous beha…
DanielDango 1f4b55e
refactor: improve cache inconsistency handling and resolution methods
DanielDango c1db4b5
refactor: mark resolveViaInternalKey method as deprecated with clarif…
DanielDango 0e00965
feat: add test-specific environment configuration and enforce env ove…
DanielDango ae89375
refactor: update documentation for CacheManagers reset usage and remo…
DanielDango f5aea19
refactor: add deprecated javadoc annotation and standardize dotenv va…
DanielDango 574d9fa
refactor: simplify cache creation logic and enforce non-null parameters
DanielDango b8cb713
test: added Mockito tests for hierarchical cache behaviour
DanielDango 63380ff
refactor: introduce helper methods for cache value insertion using ap…
DanielDango 148c2f7
refactor: replace string-based cache type with enum for improved type…
DanielDango 1cfe0c7
refactor: update cache hierarchy configuration to use enum and enforc…
DanielDango 62b0b0c
refactor: unify json serialization
DanielDango 5d1b624
docs: remove resolved comment
DanielDango b08093a
feat: implement RestRedisCache and RedisClient for REST-based Redis s…
DanielDango 87b3d62
test: add hierarchical cache tests for local and REST Redis integration
DanielDango a868903
refactor: apply feedback
DanielDango 1bf95e2
docs: add javadoc
DanielDango 65a4181
test: migrate RestRedisTest to testcontainer instead of remote runnin…
DanielDango d95c0ba
docs: update redis behaviour when unavailable
DanielDango 88b4544
docs: add reference to REST redis cache in documentation
DanielDango e621170
fix: remove unfitting defaults for rest-redis connection
DanielDango e0d17be
Potential fix for pull request finding
dfuchss 9c85916
Update dependencies
dfuchss c2b321d
Fix comments
dfuchss d9e9c82
docs: fix old references to fallback behaviour if redis is unavailable
DanielDango ba0ac7a
fix: address minor copilot feedback
DanielDango 62281fd
Potential fix for pull request finding
dfuchss 5ed61d9
refactor: change access modifiers to package-private for Redis-relate…
DanielDango a5b2278
Potential fix for pull request finding
dfuchss 8bb72e5
Fix copilot fix
dfuchss 165cfc9
Merge remote-tracking branch 'DanielDango/feature/add-cache-configura…
dfuchss 0cb600d
Merge branch 'main' into feature/add-rest-redis-cache
dfuchss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/CacheType.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,20 @@ | ||
| /* Licensed under MIT 2026. */ | ||
| package edu.kit.kastel.sdq.lissa.ratlr.cache; | ||
|
|
||
| /** | ||
| * Enum representing the types of caches supported by the system. | ||
| */ | ||
| public enum CacheType { | ||
| /** | ||
| * File based local cache | ||
| */ | ||
| LOCAL, | ||
| /** | ||
| * Redis based local docker container for caching | ||
| */ | ||
| REDIS, | ||
| /** | ||
| * Remote Redis instance accessible via a REST API | ||
| */ | ||
| REST_REDIS | ||
| } |
77 changes: 77 additions & 0 deletions
77
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/RedisAdapter.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| /* Licensed under MIT 2026. */ | ||
| package edu.kit.kastel.sdq.lissa.ratlr.cache; | ||
|
|
||
| import java.util.Objects; | ||
|
|
||
| import redis.clients.jedis.UnifiedJedis; | ||
|
|
||
| /** | ||
| * Adapter class that wraps a Jedis client to conform to the UnifiedRedisClient interface. | ||
| */ | ||
| /*package-private*/ class RedisAdapter implements UnifiedRedisClient { | ||
|
|
||
| private final UnifiedJedis jedis; | ||
|
|
||
| /** | ||
| * Creates a new RedisAdapter instance with the given Jedis client. | ||
| * | ||
| * @param jedis The Jedis client to wrap | ||
| */ | ||
| /*package-private*/ RedisAdapter(UnifiedJedis jedis) { | ||
| this.jedis = Objects.requireNonNull(jedis); | ||
| } | ||
|
|
||
| /** | ||
| * Pings the Redis server to check if it is available. | ||
| * | ||
| * @return true if the server responds, false otherwise. | ||
| */ | ||
| @Override | ||
| public boolean ping() { | ||
| return jedis.ping().equals("PONG"); | ||
| } | ||
|
Comment on lines
+29
to
+32
|
||
|
|
||
| /** | ||
| * Checks if a key exists in the Redis cache. | ||
| * | ||
| * @param key the key to check for existence | ||
| * @return true if the key exists, false otherwise. | ||
| */ | ||
| @Override | ||
| public boolean exists(String key) { | ||
| return jedis.exists(key); | ||
| } | ||
|
|
||
| /** | ||
| * Retrieves the value of a field in a hash stored at key. | ||
| * | ||
| * @param key The key of the hash | ||
| * @param field The field whose value is to be retrieved | ||
| * @return Value for the field. If the key or field does not exist, null is returned. | ||
| */ | ||
| @Override | ||
| public String hget(String key, String field) { | ||
| return jedis.hget(key, field); | ||
| } | ||
|
|
||
| /** | ||
| * Sets the value of a field in a hash stored at a key | ||
| * | ||
| * @param key The key of the hash | ||
| * @param field The field whose value is to be set | ||
| * @param value The value to be set | ||
| * @return The number of added fields | ||
| */ | ||
| @Override | ||
| public long hset(String key, String field, String value) { | ||
| return jedis.hset(key, field, value); | ||
| } | ||
|
|
||
| /** | ||
| * Shuts down the connection to the jedis instance. | ||
| */ | ||
| @Override | ||
| public void close() { | ||
| jedis.close(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.