Skip to content

MINOR: simplify window-byte-store-supplier#21829

Open
mjsax wants to merge 3 commits intoapache:trunkfrom
mjsax:minor-simplify-window-store-supplier
Open

MINOR: simplify window-byte-store-supplier#21829
mjsax wants to merge 3 commits intoapache:trunkfrom
mjsax:minor-simplify-window-store-supplier

Conversation

@mjsax
Copy link
Member

@mjsax mjsax commented Mar 19, 2026

This PR removes an unnecessary "duplicated" constructor for
RocksDbWindowBytesStoreSupplier, and unifies the caller stack to re-use
more shared code.

Also make internal contractors non-public for
RocksDbIndexedTimeOrderedWindowBytesStoreSupplier.

Reviewers: Lan Ding isDing_L@163.com, Alieh Saeedi
asaeedi@confluent.io, TengYao Chi frankvicky@apache.org

@github-actions github-actions bot added streams small Small PRs and removed small Small PRs labels Mar 19, 2026
@mjsax mjsax force-pushed the minor-simplify-window-store-supplier branch from 35d3cf9 to 103b650 Compare March 20, 2026 01:33
@mjsax mjsax force-pushed the minor-simplify-window-store-supplier branch from 103b650 to d772288 Compare March 20, 2026 01:37
Copy link
Collaborator

@DL1231 DL1231 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this patch.

if (segmentInterval < 1L) {
throw new IllegalArgumentException("segmentInterval cannot be zero or negative");
}
if (windowSize > retentionPeriod) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windowSize > retentionPeriod validation was dropped.
Note that RocksDbIndexedTimeOrderedWindowBytesStoreSupplier.create() still keeps this exact validation (line 66-69), so it seems like an unintentional omission.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups. Deleted too much -- only wanted to delete the segmentInterval check.

final Duration windowSize,
final boolean retainDuplicates,
final boolean timestampedStore) {
final RocksDbWindowBytesStoreSupplier.WindowStoreTypes timestampedStoreType) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: windowStoreType

Copy link
Contributor

@aliehsaeedii aliehsaeedii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mjsax. LGTM, but I see some changes in indentation which I don't know if they were intentional.

throw new IllegalArgumentException("windowSize cannot be negative");
}
if (defaultSegmentInterval < 1L) {
throw new IllegalArgumentException("segmentInterval cannot be zero or negative");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check can never execute as we compute defaultSegmentInterval above ourselves.

throw new IllegalArgumentException("windowSize cannot be negative");
}
if (segmentInterval < 1L) {
throw new IllegalArgumentException("segmentInterval cannot be zero or negative");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We compute segmentInterval ourselves -- cannot be smaller than 1L.

if (segmentInterval < 1L) {
throw new IllegalArgumentException("segmentInterval cannot be zero or negative");
}
if (windowSize > retentionPeriod) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups. Deleted too much -- only wanted to delete the segmentInterval check.

@mjsax mjsax added the kip Requires or implements a KIP label Mar 20, 2026
Copy link
Collaborator

@DL1231 DL1231 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch, LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kip Requires or implements a KIP streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants