-
Notifications
You must be signed in to change notification settings - Fork 6
refactor(inkless:consume): only remote fetches to run on data executor #466
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
base: jeqo/refactor-fetch-completer-schedule
Are you sure you want to change the base?
refactor(inkless:consume): only remote fetches to run on data executor #466
Conversation
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.
Pull request overview
This PR refactors the fetch planning architecture to optimize thread pool usage by executing only remote fetches on the data executor, while cache lookups run on the calling thread. The key changes eliminate the CacheFetchJob component and extend the ObjectCache interface to accept an executor parameter for async operations.
Key Changes:
- Deleted
CacheFetchJoband moved its logic intoFetchPlanner, which now directly interacts with the cache and schedules remote fetches - Modified
ObjectCacheAPI to returnCompletableFutureand accept an executor parameter for controlling where load operations run - Migrated tests from
CacheFetchJobTesttoFetchPlannerTestwith expanded coverage for cache hit/miss scenarios
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
FetchPlannerTest.java |
Migrated and expanded tests from CacheFetchJobTest, adding comprehensive tests for concurrent requests, cache hits/misses, and failure scenarios |
CacheFetchJobTest.java |
Deleted - tests migrated to FetchPlannerTest |
NullCache.java |
Updated to implement new async computeIfAbsent API that returns CompletableFuture and accepts executor parameter |
Reader.java |
Added clarifying comments about execution stages and which thread pools handle different operations |
FetchPlanner.java |
Major refactor: removed CacheFetchJob dependency, integrated cache operations directly, added ObjectFetchRequest and MergedBatchRequest records for internal planning |
CacheFetchJob.java |
Deleted - functionality merged into FetchPlanner |
ObjectCache.java |
Changed computeIfAbsent signature to return CompletableFuture and accept an Executor parameter for controlling async load execution |
MemoryCache.java |
Deleted - test-only implementation no longer needed |
CaffeineCache.java |
Updated to implement new async computeIfAbsent API using Caffeine's async cache with custom executor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
storage/inkless/src/main/java/io/aiven/inkless/consume/FetchPlanner.java
Outdated
Show resolved
Hide resolved
storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java
Outdated
Show resolved
Hide resolved
storage/inkless/src/main/java/io/aiven/inkless/consume/FetchPlanner.java
Outdated
Show resolved
Hide resolved
storage/inkless/src/main/java/io/aiven/inkless/cache/ObjectCache.java
Outdated
Show resolved
Hide resolved
storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java
Outdated
Show resolved
Hide resolved
6f06aff to
d4c4bc4
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.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java
Outdated
Show resolved
Hide resolved
storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java
Outdated
Show resolved
Hide resolved
c64c4aa to
31b9aa9
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.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Refactor fetch planning by changing how fetch operations are scheduled on the data executor. It only assigns the data executor for remote fetch operations and let the calling thread to run the cache.get(), avoiding the scenario where calls to cache are blocked by all data executor threads being used. By doing this, the CacheFetchJob component becomes irrelevant as most of the logic is already on the planning, even the scheduling decision. Changes: - Delete CacheFetchJob - Extend ObjectCache to allow passing the executor to run the load function - Refactor the FetchPlanner to use the new approach - Update documentation on FetchPlanner and Reader to clarify how stages are ran - Move CacheFetchJobTest to FetchPlannerTest to keep and improve coverage
31b9aa9 to
f6be2a5
Compare
Refactor fetch planning by changing how fetch operations are scheduled on the data executor. It only assigns the data executor for remote fetch operations and let the calling thread to run the cache.get(), avoiding the scenario where calls to cache are blocked by all data executor threads being used.
By doing this, the CacheFetchJob component got irrelevant as most of the logic is already on the planning, even the scheduling.
Changes: