-
Notifications
You must be signed in to change notification settings - Fork 4
Rework caching with parameterized keys #48
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
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cb89983
Rework caching. Now it shall be ensured that Cacheparameters are used…
dfuchss fb1de00
Update ArchitectureTest.java
dfuchss 0120ec9
Merge remote-tracking branch 'origin/main' into feature/simplify-caching
dfuchss 93a3a24
CacheKeys are generated in caches.
dfuchss 0dfaf4d
Sonarlint
dfuchss f92546c
Cleanup code.
dfuchss cfd056e
Core reviews
dfuchss 02a4b1f
Add missing synchronized
dfuchss 5a4b277
Specify generic parameter
dfuchss 73ded0e
Update src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/CacheManage…
dfuchss 17ee13f
Fix docs.
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
10 changes: 10 additions & 0 deletions
10
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/CacheParameter.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,10 @@ | ||
| /* Licensed under MIT 2025. */ | ||
| package edu.kit.kastel.sdq.lissa.ratlr.cache; | ||
|
|
||
| public interface CacheParameter { | ||
| /** | ||
| * Provide a unique string based on the actual cache parameters (for the file name of LocalCache) | ||
| * @return a unique string based on the cache parameters | ||
| */ | ||
| String parameters(); | ||
| } |
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
15 changes: 15 additions & 0 deletions
15
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/classifier/ClassifierCacheParameter.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,15 @@ | ||
| /* Licensed under MIT 2025. */ | ||
| package edu.kit.kastel.sdq.lissa.ratlr.cache.classifier; | ||
|
|
||
| import edu.kit.kastel.sdq.lissa.ratlr.cache.CacheParameter; | ||
|
|
||
dfuchss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public record ClassifierCacheParameter(String modelName, int seed, double temperature) implements CacheParameter { | ||
| @Override | ||
| public String parameters() { | ||
| if (temperature == 0.0) { | ||
| return String.join("_", modelName, String.valueOf(seed)); | ||
| } else { | ||
| return String.join("_", modelName, String.valueOf(seed), String.valueOf(temperature)); | ||
| } | ||
dfuchss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
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
11 changes: 11 additions & 0 deletions
11
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/embedding/EmbeddingCacheParameter.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,11 @@ | ||
| /* Licensed under MIT 2025. */ | ||
| package edu.kit.kastel.sdq.lissa.ratlr.cache.embedding; | ||
|
|
||
| import edu.kit.kastel.sdq.lissa.ratlr.cache.CacheParameter; | ||
|
|
||
dfuchss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public record EmbeddingCacheParameter(String modelName) implements CacheParameter { | ||
| @Override | ||
| public String parameters() { | ||
| return modelName; | ||
| } | ||
| } | ||
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
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.
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.