-
Notifications
You must be signed in to change notification settings - Fork 21
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
AEWeb cache (files and transactions) #744
Merged
samuelmanzanera
merged 22 commits into
archethic-foundation:develop
from
bchamagne:644-aeweb-cache
Jan 10, 2023
Merged
AEWeb cache (files and transactions) #744
samuelmanzanera
merged 22 commits into
archethic-foundation:develop
from
bchamagne:644-aeweb-cache
Jan 10, 2023
Conversation
This file contains 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
netboz
reviewed
Dec 6, 2022
@Neylix reviewed this with me today. He proposed a refactoring to make the LRUDisk module simpler. In a few words, storing the size as well as the value in the ETS map will make everything easier. |
Neylix
requested changes
Dec 20, 2022
Neylix
reviewed
Dec 20, 2022
This PR is blocked by #747 and we will resume development only when it's merged. |
caller do not need to wait for the I/O to end to continue
19ae297
to
ff8a6a2
Compare
This is now ready and tested! |
Neylix
approved these changes
Jan 9, 2023
samuelmanzanera
approved these changes
Jan 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Description
Adds
LRU
andLRUDisk
modules to cache data on memory and on disk respectively. The algorithm used for eviction is the Least Recent Used, meaning that the oldest files read are evicted when space is required. The max size is in bytes and in config so users can control how much cache they want to support.Theses caches are used in the AEWeb controller to cache the reference transaction (queried on every request) and to cache the files' content.
There is a few things to discuss:
do a cast instead of a call for the put fn to not wait for I/O (will not be able to return succes boolean)There will be a conflict when #742 is merged.
Fixes #644
Type of change
How Has This Been Tested?
Tests added to the suite.
Checklist: