Skip to content

KAFKA-3613: Consolidate TumblingWindows and HoppingWindows into TimeWindows#1277

Closed
miguno wants to merge 6 commits into
apache:trunkfrom
miguno:KAFKA-3613-v2
Closed

KAFKA-3613: Consolidate TumblingWindows and HoppingWindows into TimeWindows#1277
miguno wants to merge 6 commits into
apache:trunkfrom
miguno:KAFKA-3613-v2

Conversation

@miguno
Copy link
Copy Markdown
Contributor

@miguno miguno commented Apr 27, 2016

This PR includes the same code as #1261 but is rebased on latest trunk.

@miguno
Copy link
Copy Markdown
Contributor Author

miguno commented Apr 27, 2016

@guozhangwang feel free to review (/cc @enothereska and @mjsax ).

.countByKey(HoppingWindows.of("GeoPageViewsWindow").with(7 * 24 * 60 * 60 * 1000), Serdes.String())
.countByKey(TimeWindows.of("GeoPageViewsWindow", 7 * 24 * 60 * 60 * 1000L).shiftedBy(1000), Serdes.String())
// TODO: we can merge ths toStream().map(...) with a single toStream(...)
.toStream()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is out of the scope of this PR but may just be OK do to together: since now we have added the toStream(map) function to KTable, we can actually get rid of this TODO.

- Properly compute windows for a given timestamp (honoring window start time)
- Add unit tests/spec, notably to forbid negative window start times
@guozhangwang
Copy link
Copy Markdown
Contributor

LGTM overall. Just a couple of minor comments.

@guozhangwang
Copy link
Copy Markdown
Contributor

@miguno Could you address the second comment above? No further reviews needed after that.

import java.util.Map;

/**
* The window specifications used for joins.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we extend the JavaDoc? Or should this be done in #1250 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was waiting for #1250 and intentionally didn't touch javadocs in this PR where I could avoid it.

* The hop size's effective time unit is determined by the semantics of the topology's
* configured {@link org.apache.kafka.streams.processor.TimestampExtractor}.
* The size of the window's advance interval, i.e. by how much a window moves forward relative
* to the previous one. The interval's effective time unit is determined by the semantics of
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remove double blank.

@mjsax
Copy link
Copy Markdown
Member

mjsax commented Apr 28, 2016

+1

@guozhangwang
Copy link
Copy Markdown
Contributor

LGTM. Merged to trunk.

@asfgit asfgit closed this in 68433dc Apr 29, 2016
gfodor pushed a commit to AltspaceVR/kafka that referenced this pull request Jun 3, 2016
…indows

This PR includes the same code as apache#1261 but is rebased on latest trunk.

Author: Michael G. Noll <michael@confluent.io>

Reviewers: Matthias J. Sax, Guozhang Wang

Closes apache#1277 from miguno/KAFKA-3613-v2
efeg pushed a commit to efeg/kafka that referenced this pull request May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants