-
Notifications
You must be signed in to change notification settings - Fork 15.1k
KAFKA-7080 and KAFKA-7222: Cleanup overlapping KIP changes #5804
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,6 @@ | |
| */ | ||
| package org.apache.kafka.streams.state; | ||
|
|
||
| import java.time.Duration; | ||
| import org.apache.kafka.common.annotation.InterfaceStability; | ||
| import org.apache.kafka.common.serialization.Serde; | ||
| import org.apache.kafka.common.serialization.Serdes; | ||
|
|
@@ -32,6 +31,7 @@ | |
| import org.apache.kafka.streams.state.internals.SessionStoreBuilder; | ||
| import org.apache.kafka.streams.state.internals.WindowStoreBuilder; | ||
|
|
||
| import java.time.Duration; | ||
| import java.util.Objects; | ||
|
|
||
| /** | ||
|
|
@@ -155,7 +155,7 @@ public String metricsScope() { | |
| * careful to set it the same as the windowed keys you're actually storing. | ||
| * @param retainDuplicates whether or not to retain duplicates. | ||
| * @return an instance of {@link WindowBytesStoreSupplier} | ||
| * @deprecated since 2.1 Use {@link Stores#persistentWindowStore(String, long, long, boolean, long)} instead | ||
| * @deprecated since 2.1 Use {@link Stores#persistentWindowStore(String, Duration, Duration, boolean)} instead | ||
| */ | ||
| @Deprecated | ||
| public static WindowBytesStoreSupplier persistentWindowStore(final String name, | ||
|
|
@@ -178,28 +178,6 @@ public static WindowBytesStoreSupplier persistentWindowStore(final String name, | |
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Create a persistent {@link WindowBytesStoreSupplier}. | ||
| * @param name name of the store (cannot be {@code null}) | ||
| * @param retentionPeriod length of time to retain data in the store (cannot be negative) | ||
| * Note that the retention period must be at least long enough to contain the | ||
| * windowed data's entire life cycle, from window-start through window-end, | ||
| * and for the entire grace period. | ||
| * @param windowSize size of the windows (cannot be negative) | ||
| * @param retainDuplicates whether or not to retain duplicates. | ||
| * @return an instance of {@link WindowBytesStoreSupplier} | ||
| * @deprecated Use {@link #persistentWindowStore(String, Duration, Duration, boolean)} instead | ||
| */ | ||
| @Deprecated | ||
| public static WindowBytesStoreSupplier persistentWindowStore(final String name, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added in KIP-319, deprecated in KIP-358 |
||
| final long retentionPeriod, | ||
| final long windowSize, | ||
| final boolean retainDuplicates) { | ||
| // we're arbitrarily defaulting to segments no smaller than one minute. | ||
| final long defaultSegmentInterval = Math.max(retentionPeriod / 2, 60_000L); | ||
| return persistentWindowStore(name, retentionPeriod, windowSize, retainDuplicates, defaultSegmentInterval); | ||
| } | ||
|
|
||
| /** | ||
| * Create a persistent {@link WindowBytesStoreSupplier}. | ||
| * @param name name of the store (cannot be {@code null}) | ||
|
|
@@ -220,28 +198,16 @@ public static WindowBytesStoreSupplier persistentWindowStore(final String name, | |
| ApiUtils.validateMillisecondDuration(retentionPeriod, "retentionPeriod"); | ||
| ApiUtils.validateMillisecondDuration(windowSize, "windowSize"); | ||
|
|
||
| return persistentWindowStore(name, retentionPeriod.toMillis(), windowSize.toMillis(), retainDuplicates); | ||
| final long defaultSegmentInterval = Math.max(retentionPeriod.toMillis() / 2, 60_000L); | ||
|
|
||
| return persistentWindowStore(name, retentionPeriod.toMillis(), windowSize.toMillis(), retainDuplicates, defaultSegmentInterval); | ||
| } | ||
|
|
||
| /** | ||
| * Create a persistent {@link WindowBytesStoreSupplier}. | ||
| * @param name name of the store (cannot be {@code null}) | ||
| * @param retentionPeriod length of time to retain data in the store (cannot be negative) | ||
| * Note that the retention period must be at least long enough to contain the | ||
| * windowed data's entire life cycle, from window-start through window-end, | ||
| * and for the entire grace period. | ||
| * @param segmentInterval size of segments in ms (cannot be negative) | ||
| * @param windowSize size of the windows (cannot be negative) | ||
| * @param retainDuplicates whether or not to retain duplicates. | ||
| * @return an instance of {@link WindowBytesStoreSupplier} | ||
| * @deprecated Use {@link #persistentWindowStore(String, Duration, Duration, boolean)} instead | ||
| */ | ||
| @Deprecated | ||
| public static WindowBytesStoreSupplier persistentWindowStore(final String name, | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added in KIP-319 -- should have bee deprecated with KIP-328. |
||
| final long retentionPeriod, | ||
| final long windowSize, | ||
| final boolean retainDuplicates, | ||
| final long segmentInterval) { | ||
| private static WindowBytesStoreSupplier persistentWindowStore(final String name, | ||
| final long retentionPeriod, | ||
| final long windowSize, | ||
| final boolean retainDuplicates, | ||
| final long segmentInterval) { | ||
| Objects.requireNonNull(name, "name cannot be null"); | ||
| if (retentionPeriod < 0L) { | ||
| throw new IllegalArgumentException("retentionPeriod cannot be negative"); | ||
|
|
@@ -269,7 +235,9 @@ public static WindowBytesStoreSupplier persistentWindowStore(final String name, | |
| * windowed data's entire life cycle, from window-start through window-end, | ||
| * and for the entire grace period. | ||
| * @return an instance of a {@link SessionBytesStoreSupplier} | ||
| * @deprecated since 2.1 Use {@link Stores#persistentSessionStore(String, Duration)} instead | ||
| */ | ||
| @Deprecated | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is part of KIP-358 but slipped in the PR |
||
| public static SessionBytesStoreSupplier persistentSessionStore(final String name, | ||
| final long retentionPeriod) { | ||
| Objects.requireNonNull(name, "name cannot be null"); | ||
|
|
@@ -288,6 +256,7 @@ public static SessionBytesStoreSupplier persistentSessionStore(final String name | |
| * and for the entire grace period. | ||
| * @return an instance of a {@link SessionBytesStoreSupplier} | ||
| */ | ||
| @SuppressWarnings("deprecation") | ||
| public static SessionBytesStoreSupplier persistentSessionStore(final String name, | ||
| final Duration retentionPeriod) { | ||
| ApiUtils.validateMillisecondDuration(retentionPeriod, "retentionPeriod"); | ||
|
|
||
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.
added in KIP-319, deprecated in KIP-328