Conversation
00eb6a3 to
7861e9c
Compare
There was a problem hiding this comment.
Pull request overview
Adds an optional byte-based sizing limit for the in-memory consume cache, leveraging Caffeine’s weighted eviction, and wires the new configuration through Inkless config, docs, and tests.
Changes:
- Introduce
consume.cache.max.bytes/inkless.consume.cache.max.bytesconfig and expose it viaInklessConfig.cacheMaxBytes(). - Pass the optional max-bytes limit into cache initialization (
SharedState→CaffeineCache) and update tests to match the new constructor. - Document the new configuration option in
docs/inkless/configs.rst.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java | Adds OptionalLong max-bytes support via maximumWeight + weigher. |
| storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java | Adds new config key + getter returning OptionalLong. |
| storage/inkless/src/main/java/io/aiven/inkless/common/SharedState.java | Wires cacheMaxBytes() into cache construction. |
| storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java | Updates CaffeineCache constructor calls to include OptionalLong.empty(). |
| storage/inkless/src/test/java/io/aiven/inkless/config/InklessConfigTest.java | Adds coverage for parsing/presence of cache.max.bytes. |
| docs/inkless/configs.rst | Documents consume.cache.max.bytes and updates max-count description. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java
Outdated
Show resolved
Hide resolved
storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java
Outdated
Show resolved
Hide resolved
storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java
Outdated
Show resolved
Hide resolved
6c7b2a9 to
6d3b403
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for sizing the Inkless consume cache by total bytes (in addition to entry count) by introducing a new configuration and wiring it into the Caffeine cache implementation.
Changes:
- Add
consume.cache.max.bytesconfig (default-1) with validation and documentation. - Update
CaffeineCacheto usemaximumWeight+weigherwhen a bytes limit is configured. - Update shared initialization and tests to pass the new constructor argument.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java | Adds bytes-based eviction via Caffeine weight/weigher and updates constructor signature. |
| storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java | Introduces consume.cache.max.bytes config definition, validation, and accessor. |
| storage/inkless/src/main/java/io/aiven/inkless/common/SharedState.java | Wires the new config value into CaffeineCache construction. |
| storage/inkless/src/test/java/io/aiven/inkless/config/InklessConfigTest.java | Adds config parsing/validation tests for consume.cache.max.bytes. |
| storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java | Updates CaffeineCache instantiations for the new constructor signature. |
| docs/inkless/configs.rst | Documents the new consume.cache.max.bytes setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java
Show resolved
Hide resolved
88fcbb9 to
0318965
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new cache sizing configuration to Inkless so the in-memory consume cache can be limited by bytes (using Caffeine weight-based eviction) in addition to the existing entry-count limit.
Changes:
- Introduce
consume.cache.max.bytesconfig (default0= disabled) and wire it into cache initialization. - Update
CaffeineCacheto usemaximumWeight(...).weigher(...)when the bytes limit is enabled. - Add/adjust tests and update documentation for the new config.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java | Adds byte-based eviction via Caffeine weight+weigher (but currently has a generic typing issue). |
| storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java | Defines consume.cache.max.bytes config + accessor. |
| storage/inkless/src/main/java/io/aiven/inkless/common/SharedState.java | Passes the new cacheMaxBytes() value into CaffeineCache. |
| storage/inkless/src/test/java/io/aiven/inkless/cache/CaffeineCacheTest.java | New tests covering count-based vs byte-based eviction behavior. |
| storage/inkless/src/test/java/io/aiven/inkless/config/InklessConfigTest.java | Extends config parsing/validation tests for the new setting. |
| storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java | Updates cache construction calls to include the new constructor parameter. |
| docs/inkless/configs.rst | Documents consume.cache.max.bytes and updates consume.cache.max.count wording. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java
Outdated
Show resolved
Hide resolved
0318965 to
4330cf1
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new cache sizing configuration to Inkless so the in-memory consume cache can be limited by total cached bytes (using Caffeine weight-based eviction) in addition to the existing entry-count limit.
Changes:
- Introduce
consume.cache.max.bytesconfig (default0= disabled) and wire it intoSharedStatecache creation. - Update
CaffeineCacheto usemaximumWeight(...).weigher(...)when the bytes limit is enabled; otherwise keepmaximumSize(...). - Add/adjust unit tests and documentation for the new configuration.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java | Add byte-based eviction support via Caffeine weigher/maximumWeight and a test-only cleanup hook. |
| storage/inkless/src/main/java/io/aiven/inkless/common/SharedState.java | Pass cacheMaxBytes() into the CaffeineCache constructor. |
| storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java | Define consume.cache.max.bytes config and expose cacheMaxBytes() accessor. |
| storage/inkless/src/test/java/io/aiven/inkless/cache/CaffeineCacheTest.java | New tests covering count-based vs byte-based eviction behavior. |
| storage/inkless/src/test/java/io/aiven/inkless/config/InklessConfigTest.java | Extend config parsing/validation tests to include consume.cache.max.bytes. |
| storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java | Update test cache instantiations for the new constructor signature. |
| docs/inkless/configs.rst | Document the new consume.cache.max.bytes config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java
Outdated
Show resolved
Hide resolved
4330cf1 to
7d80d80
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new Inkless consume-cache sizing option that limits cache capacity by total cached payload bytes (via Caffeine maximumWeight + weigher), in addition to the existing entry-count limit.
Changes:
- Introduce
consume.cache.max.bytesconfig (default0= disabled) and wire it into cache initialization. - Update
CaffeineCacheto choose between count-based eviction (maximumSize) and bytes-based eviction (maximumWeight+weigher). - Extend tests and generated config docs to cover the new configuration and behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| storage/inkless/src/main/java/io/aiven/inkless/cache/CaffeineCache.java | Adds bytes-based eviction path using a Weigher and exposes cleanUp() for tests. |
| storage/inkless/src/main/java/io/aiven/inkless/config/InklessConfig.java | Defines the new consume.cache.max.bytes configuration and accessor. |
| storage/inkless/src/main/java/io/aiven/inkless/common/SharedState.java | Wires cacheMaxBytes() into CaffeineCache construction. |
| storage/inkless/src/test/java/io/aiven/inkless/cache/CaffeineCacheTest.java | New unit tests validating count- vs bytes-based eviction selection. |
| storage/inkless/src/test/java/io/aiven/inkless/config/InklessConfigTest.java | Adds coverage for parsing/defaults/range validation of consume.cache.max.bytes. |
| storage/inkless/src/test/java/io/aiven/inkless/consume/FetchPlannerTest.java | Updates CaffeineCache constructor calls to include the new bytes parameter. |
| docs/inkless/configs.rst | Documents the new config key in the generated config docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a new limiting configuration for cache sizing based on bytes instead of entries. Historically, previous caching library only supported sizing based on entries. With Caffeine, sizing can now be defined by both entries and max bytes using weigher. When bytes limit is configured, weight-based eviction takes precedence over count-based eviction. Caffeine does not support both simultaneously.
7d80d80 to
3dbe698
Compare
Add a new limiting configuration for cache sizing based on bytes instead of entries. Historically, previous caching library only supported sizing based on entries. With Caffeine, sizing can now be defined by both entries and max bytes using weigher. When bytes limit is configured, weight-based eviction takes precedence over count-based eviction. Caffeine does not support both simultaneously. (cherry picked from commit cbfdff5)
Add a new limiting configuration for cache sizing based on bytes instead of entries. Historically, previous caching library only supported sizing based on entries. With Caffeine, sizing can now be defined by both entries and max bytes using weigher. When bytes limit is configured, weight-based eviction takes precedence over count-based eviction. Caffeine does not support both simultaneously.
Add a new limiting configuration for cache sizing based on bytes instead of entries. Historically, previous caching library only supported sizing based on entries. With Caffeine, sizing can now be defined by both entries and max bytes using weigher. When bytes limit is configured, weight-based eviction takes precedence over count-based eviction. Caffeine does not support both simultaneously. (cherry picked from commit cbfdff5)
Add a new limiting configuration for cache sizing based on bytes instead of entries.
Historically, previous caching library only supported sizing based on entries. With Caffeine, sizing can now be defined by both entries and max bytes using weigher.