-
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
Refactor chunk cache #443
base: main
Are you sure you want to change the base?
Refactor chunk cache #443
Conversation
0487867
to
301502b
Compare
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.
These tests were moved to AbstractChunkCacheTest
and the prefetching tests, to DefaultChunkManagerTest
.
301502b
to
7c01742
Compare
.compute(chunkKey, (key, val) -> { | ||
if (val == null) { | ||
statsCounter.recordMiss(); | ||
// TODO do not put a failed future into the cache |
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.
This is a pre-existing problem, decided not to handle it in this PR
// TODO do some logging if error | ||
// TODO do not put a failed future into the cache |
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.
These are pre-existing problems, decided not to handle them in this PR
7c01742
to
eb55757
Compare
|
||
assertThat(chunkManager.getChunk(OBJECT_KEY, manifest, 0)).hasBinaryContent(TEST_CHUNK_CONTENT); | ||
verify(storage).fetch(OBJECT_KEY, chunkIndex.chunks().get(0).range()); | ||
} | ||
|
||
@Nested | ||
class PrefetchTests { |
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.
From ChunkCacheTest.java
eb55757
to
1b83e36
Compare
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.
From ChunkCacheTest.java
Before, the chunk cache(s) was a wrapper over `DefaultChunkManager`. In some situations, this is not very convenient and also the cache has more responsibilities than it should (like prefetching). This commit refactors the cache to be a pluggable mechanism in the chunk manager.
1b83e36
to
b1ae9a4
Compare
Before, the chunk cache(s) was a wrapper over
DefaultChunkManager
. In some situations, this is not very convenient and also the cache has more responsibilities than it should (like prefetching). This commit refactors the cache to be a pluggable mechanism in the chunk manager.