You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`TimeWindows` is a concrete <<kafka-streams-Windows.adoc#, window specification>> of <<kafka-streams-TimeWindow.adoc#, time windows>>.
3
+
`TimeWindows` is a <<kafka-streams-Windows.adoc#, window specification>> of <<kafka-streams-internals-TimeWindow.adoc#, time windows>>.
4
4
5
5
[[creating-instance]]
6
6
`TimeWindows` is described by the following properties:
7
7
8
-
* [[sizeMs]] *Duration* (aka _size_) (in millis)
8
+
* [[sizeMs]] *Window duration* (aka _window size_) (in millis)
9
9
* [[advanceMs]] *Advance interval* (in millis)
10
+
* [[grace]] *Grace period* for late events
11
+
* [[maintainDurationMs]] *Maintain duration* (in millis)
12
+
13
+
NOTE: <<maintainDurationMs, Maintain duration>> is no longer in use.
10
14
11
15
`TimeWindows` can be created only using the <<of, of>> factory method.
12
16
13
17
[source, java]
14
18
----
15
-
TimeWindows of(final long sizeMs) throws IllegalArgumentException
19
+
static TimeWindows of(final Duration size)
16
20
----
17
21
18
-
`of` is used to create a time specification of *tumbling windows* which are fixed-sized, gap-less, non-overlapping windows (and simply sets the <<sizeMs, sizeMs>> and <<advanceMs, advanceMs>> internal properties to the same value).
22
+
`of` is used to create a time specification of *tumbling windows* which are fixed-sized, gap-less, non-overlapping windows (and simply sets the <<sizeMs, sizeMs>> and <<advanceMs, advanceMs>> internal properties to the given value).
19
23
20
-
`TimeWindows` can be further configured using the <<advanceBy, advanceBy>> method.
`TimeWindows` can be further configured using the <<advanceBy, advanceBy>> and <<grace-method, grace>> methods.
21
34
22
35
[source, java]
23
36
----
24
-
TimeWindows advanceBy(final long advanceMs)
37
+
TimeWindows advanceBy(final Duration advance)
25
38
----
26
39
27
40
`advanceBy` allows for a time specification of *hopping windows* which are fixed-sized, overlapping windows (and simply sets the <<advanceMs, advanceMs>> internal property).
NOTE: `until` is part of the <<kafka-streams-Windows.adoc#until, Windows Contract>> to set the window maintain duration (retention time).
66
-
67
-
`until` simply makes sure that the input `durationMs` is at least the <<sizeMs, size>> of the window and executes the parent's <<kafka-streams-Windows.adoc#until, until>>.
68
-
69
-
`until` throws an `IllegalArgumentException` when the input `durationMs` is smaller than the <<sizeMs, size>>:
70
-
71
-
```
72
-
Window retention time (durationMs) cannot be smaller than the window size.
0 commit comments