-
Notifications
You must be signed in to change notification settings - Fork 408
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
OAK-10494 - Add cache to reduce number of remote blobstore calls. #1155
Open
ahanikel
wants to merge
20
commits into
apache:trunk
Choose a base branch
from
ahanikel:issues/OAK-10494
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 15 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
cbc02f5
OAK-10494 - Add cache to reduce number of remote blobstore calls.
3c902f0
Make record cache size configurable.
1251443
Cache size is a long
956bbe5
Add a test to check performance improvement.
ce6a622
Use the same DataIdentifier instance for both runs.
186208d
Add record cache expiration defaulting to 15 mins
71a7703
Add record cache expiration defaulting to 15 mins
1ce56c8
Make recordCache protected
782f13d
Try to use Mockito (does not work in this case)
e9079e4
Remove AbstractSharedCachingDataStoreTest
0458cf9
Add test performanceGetRecordIfStored
ce42248
RecordCache needs to be invalidated upon deletion.
6a34a61
Make recordCache optional and configuration non-static with setters.
82e8dac
Add optional backendResponseDelay to TestMemoryBackend.
b2f1cd4
Use existing test datastore implementation
7dd439a
Revert "Add optional backendResponseDelay to TestMemoryBackend."
3811fc3
Don't measure timings (fragile) but ensure cache is working properly.
7f409ff
Make sure the record is not loaded from the existing cache either.
6608cc7
Make sure the record is no longer cached after deletion.
534e4ba
Switch the record cache off by default.
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
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Now I understood why you are adding a delay. The assertion with time can be quite fragile. Can't we just assert on the cache object not being empty and presence of the record with identifier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I wanted to "prove" the effectiveness of the cache but although I've only checked for a 5x improvement where the difference should be at least 100x for that test case, I agree it is still fragile and should be avoided.
I've changed the test to only check that the record is in the cache after the first access, and to ensure that it is loaded from the cache when accessed a second time. Is that what you meant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. If you need to add test performance numbers maybe you can also add to oak-benchmarks.