-
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
Prefetching by the number of bytes #429
Conversation
@@ -33,9 +33,9 @@ public class ChunkCacheConfig extends AbstractConfig { | |||
+ "where \"-1\" represents infinite retention"; | |||
private static final long DEFAULT_CACHE_RETENTION_MS = 600_000; | |||
|
|||
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetching.size"; | |||
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetching.bytes"; |
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.
We are using .size
for most bytes configurations. Also, final size is not specifically this value but whatever chunks can make up to this size, right? Finally, ing
suffix doesn't add much so we may as well drop it:
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetching.bytes"; | |
private static final String CACHE_PREFETCH_MAX_SIZE_CONFIG = "prefetch.max.size"; |
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.
It's not max size but rather min, since we are prefetching the whole chunk if requested range ends or starts in the middle of the chunk.
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.
Oh actually you are right, it's max size
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.
Fixed
core/src/main/java/io/aiven/kafka/tieredstorage/manifest/index/AbstractChunkIndex.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/aiven/kafka/tieredstorage/chunkmanager/cache/ChunkCacheTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/aiven/kafka/tieredstorage/chunkmanager/cache/ChunkCacheTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/aiven/kafka/tieredstorage/manifest/index/AbstractChunkIndex.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/aiven/kafka/tieredstorage/manifest/index/AbstractChunkIndex.java
Outdated
Show resolved
Hide resolved
public List<Chunk> chunksForRange(final BytesRange bytesRange) { | ||
Chunk current; | ||
final var result = new ArrayList<Chunk>(); | ||
for (int i = bytesRange.from; i < bytesRange.to && i < originalFileSize; i += current.originalSize) { |
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.
Let's make it explicit: do we calculate the prefetch range on the original or transformed size?
LGTM. If it's 👍 for @jeqo , let's squash and merge |
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.
LGTM, just a minor comment on the constant name
@@ -33,9 +33,9 @@ public class ChunkCacheConfig extends AbstractConfig { | |||
+ "where \"-1\" represents infinite retention"; | |||
private static final long DEFAULT_CACHE_RETENTION_MS = 600_000; | |||
|
|||
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetching.size"; | |||
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetch.max.size"; |
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.
nit: could we align the constant name?
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetch.max.size"; | |
private static final String CACHE_PREFETCH_MAX_SIZE_CONFIG = "prefetch.max.size"; |
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.
Fixed
@@ -33,9 +33,9 @@ public class ChunkCacheConfig extends AbstractConfig { | |||
+ "where \"-1\" represents infinite retention"; | |||
private static final long DEFAULT_CACHE_RETENTION_MS = 600_000; | |||
|
|||
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetching.size"; | |||
private static final String CACHE_PREFETCHING_SIZE_CONFIG = "prefetch.max.size"; | |||
private static final String CACHE_PREFETCHING_SIZE_DOC = |
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.
Same here
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.
Fixed
4555585
to
3d12972
Compare
No description provided.