KAFKA-20399: Implement VersionedKeyValueStoreWithHeaders#21995
Open
Shekharrajak wants to merge 1 commit intoapache:trunkfrom
Open
KAFKA-20399: Implement VersionedKeyValueStoreWithHeaders#21995Shekharrajak wants to merge 1 commit intoapache:trunkfrom
Shekharrajak wants to merge 1 commit intoapache:trunkfrom
Conversation
| * in {@link VersionedKeyValueStore#put(Object, Object, long)}. | ||
| * @throws NullPointerException if {@code headers} is {@code null} | ||
| */ | ||
| long put(K key, V value, long timestamp, Headers headers); |
Contributor
There was a problem hiding this comment.
why do add this method? for other store types we support existing api and value brings headers under the hood
Comment on lines
+74
to
+84
| private static long defaultSegmentInterval(final long historyRetentionMs) { | ||
| if (historyRetentionMs <= 60_000L) { | ||
| return Math.max(historyRetentionMs / 3, 2_000L); | ||
| } else if (historyRetentionMs <= 300_000L) { | ||
| return Math.max(historyRetentionMs / 5, 20_000L); | ||
| } else if (historyRetentionMs <= 3600_000L) { | ||
| return Math.max(historyRetentionMs / 12, 60_000L); | ||
| } else { | ||
| return Math.max(historyRetentionMs / 24, 300_000L); | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
why do we need this?
Comment on lines
+37
to
+39
| default long put(final Bytes key, final byte[] value, final long timestamp, final Headers headers) { | ||
| return put(key, value, timestamp); | ||
| } |
| private final V value; | ||
| private final long timestamp; | ||
| private final Optional<Long> validTo; | ||
| private final Headers headers; |
Contributor
There was a problem hiding this comment.
Why we changed original record instead of creating new one. see AggregationWithHeaders / ValueTimestampHeaders
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ref https://issues.apache.org/jira/browse/KAFKA-20399
This PR implements VersionedKeyValueStoreWithHeaders as part of KIP-1271. It adds header support to versioned key-value stores, completing the last missing store type in the KIP.
VersionedKeyValueStoreWithHeaders<K, V> -- new interface extending VersionedKeyValueStore<K, V> with put(K key, V value, long timestamp, Headers headers)