WIP: Make Cache Configurable#75
Conversation
- add new redis cache replacement strategy
…pdate CacheManager to support initialization from ModuleConfiguration
…tegy to be more generic
…RedisCache to simplify as a regular cache
…e/add-cache-configurations # Conflicts: # src/main/java/edu/kit/kastel/sdq/lissa/ratlr/configuration/EvaluationConfiguration.java
…ature/add-cache-configurations # Conflicts: # src/test/java/edu/kit/kastel/sdq/lissa/ratlr/ArchitectureTest.java
…ions - aside from the local cache dir for replication - from individual environment variables.
…ion, and backward compatibility checks
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…rwriting restrictions
…ve obsolete cache type description
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * @throws IllegalArgumentException If the type is not recognized or the cache cannot be created | ||
| */ | ||
| static <K extends CacheKey> Cache<K> createByType( | ||
| String type, CacheParameter<K> parameters, @Nullable String cacheDir, @Nullable ObjectMapper mapper) { |
There was a problem hiding this comment.
Why do I need a string to create a cache. Either this should be an enum or not dynamic at all :)
There was a problem hiding this comment.
Using a string here instead of an enum is consistent with other component implementations that can be configured with Configuration entries
| } | ||
| yield new RedisCache<>(parameters, mapper); | ||
| } | ||
| default -> |
There was a problem hiding this comment.
with enum, no default will be needed
…propriate methods to avoid serialization conflicts
|



This PR aims to make caches in LiSSA configurable.
Caching with REST-Redis as in #59 can be added afterwards.
The current Redis and Local Cache implementations are split into independent implementations of the Cache interface. Instead, a new Cache, the hierarchical Cache, is added to define how two caches can be coupled. Hierarchical caches can also be coupled with another hierarchical cache. If values are missing in any level of the cache hierarchy, they will be propagated.
The CacheReplacementStrategy Enum describes different conflict resolution strategies (None / Error / Overwrite).
The strategy and general cache hierarchy are defined in environment variables with the defaults of redis with local cache, and no consequences on cache conflicts.
The internal local cache implementation has not been altered to keep support for existing local cache files. Their location continues to be specified by the configuration file to enable effortless replication.