Skip to content

Conversation

ivanyu
Copy link
Contributor

@ivanyu ivanyu commented Nov 10, 2023

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.

@ivanyu ivanyu force-pushed the ivanyu/refactor-cache branch from 0487867 to 301502b Compare November 10, 2023 14:16
Copy link
Contributor Author

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.

@ivanyu ivanyu force-pushed the ivanyu/refactor-cache branch from 301502b to 7c01742 Compare November 10, 2023 14:46
.compute(chunkKey, (key, val) -> {
if (val == null) {
statsCounter.recordMiss();
// TODO do not put a failed future into the cache
Copy link
Contributor Author

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

Comment on lines +99 to +100
// TODO do some logging if error
// TODO do not put a failed future into the cache
Copy link
Contributor Author

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

@ivanyu ivanyu force-pushed the ivanyu/refactor-cache branch from 7c01742 to eb55757 Compare November 10, 2023 14:50
}

@Nested
class PrefetchTests {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From ChunkCacheTest.java

@ivanyu ivanyu changed the title Refactor chunk segment Refactor chunk cache Nov 10, 2023
@ivanyu ivanyu force-pushed the ivanyu/refactor-cache branch from eb55757 to 1b83e36 Compare November 10, 2023 14:54
Copy link
Contributor Author

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.
@ivanyu ivanyu force-pushed the ivanyu/refactor-cache branch from 1b83e36 to b1ae9a4 Compare November 10, 2023 15:16
@ivanyu ivanyu closed this Nov 11, 2023
@ivanyu ivanyu deleted the ivanyu/refactor-cache branch November 11, 2023 15:42
@ivanyu ivanyu restored the ivanyu/refactor-cache branch November 11, 2023 15:45
@ivanyu ivanyu reopened this Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant