MINOR: Switch order of sections on tumbling and hopping windows in streams doc. Tumbling windows are defined as "special case of hopping time windows" - but hopping windows currently only explained later in the docs. (#8505)
Currently, tumbling windows are defined as "a special case of hopping time windows" in the streams docs, but hopping windows are only explained in a subsequent section.
I think it would make sense to switch the order of these paragraphs around. To me this also makes more sense semantically.
Testing
Built the site and checked that everything looks ok and html is valid (or at least didn't contain any new warnings that were caused by this change).
Reviewers: Bill Bejeck <bbejeck@apache.org>
<trclass="row-even"><td><aclass="reference internal"href="#windowing-sliding"><spanclass="std std-ref">Sliding time window</span></a></td>
<td>Time-based</td>
@ -3197,39 +3197,6 @@
@@ -3197,39 +3197,6 @@
</tr>
</tbody>
</table>
<divclass="section"id="tumbling-time-windows">
<spanid="windowing-tumbling"></span><h5><aclass="toc-backref"href="#id20">Tumbling time windows</a><aclass="headerlink"href="#tumbling-time-windows"title="Permalink to this headline"></a></h5>
<p>Tumbling time windows are a special case of hopping time windows and, like the latter, are windows based on time
intervals. They model fixed-size, non-overlapping, gap-less windows.
A tumbling window is defined by a single property: the window’s <em>size</em>.
A tumbling window is a hopping window whose window size is equal to its advance interval.
Since tumbling windows never overlap, a data record will belong to one and only one window.</p>
<pclass="caption"><spanclass="caption-text">This diagram shows windowing a stream of data records with tumbling windows. Windows do not overlap because, by
definition, the advance interval is identical to the window size. In this diagram the time numbers represent minutes;
e.g. t=5 means “at the five-minute mark”. In reality, the unit of time in Kafka Streams is milliseconds, which means
the time numbers would need to be multiplied with 60 * 1,000 to convert from minutes to milliseconds (e.g. t=5 would
become t=300,000).</span></p>
</div>
<p>Tumbling time windows are <em>aligned to the epoch</em>, with the lower interval bound being inclusive and the upper bound
being exclusive. “Aligned to the epoch” means that the first window starts at timestamp zero. For example, tumbling
windows with a size of 5000ms have predictable window boundaries <codeclass="docutils literal"><spanclass="pre">[0;5000),[5000;10000),...</span></code>— and <strong>not</strong>
<codeclass="docutils literal"><spanclass="pre">[1000;6000),[6000;11000),...</span></code> or even something “random” like <codeclass="docutils literal"><spanclass="pre">[1452;6452),[6452;11452),...</span></code>.</p>
<p>The following code defines a tumbling window with a size of 5 minutes:</p>
<spanid="windowing-hopping"></span><h5><aclass="toc-backref"href="#id21">Hopping time windows</a><aclass="headerlink"href="#hopping-time-windows"title="Permalink to this headline"></a></h5>
<p>Hopping time windows are windows based on time intervals. They model fixed-sized, (possibly) overlapping windows.
@ -3271,6 +3238,39 @@ milliseconds (e.g. t=5 would become t=300,000).</span></p>
@@ -3271,6 +3238,39 @@ milliseconds (e.g. t=5 would become t=300,000).</span></p>
corresponding window instance and the embedded key can be retrieved as <codeclass="docutils literal"><spanclass="pre">Windowed#window()</span></code> and <codeclass="docutils literal"><spanclass="pre">Windowed#key()</span></code>,
respectively.</p>
</div>
<divclass="section"id="tumbling-time-windows">
<spanid="windowing-tumbling"></span><h5><aclass="toc-backref"href="#id20">Tumbling time windows</a><aclass="headerlink"href="#tumbling-time-windows"title="Permalink to this headline"></a></h5>
<p>Tumbling time windows are a special case of hopping time windows and, like the latter, are windows based on time
intervals. They model fixed-size, non-overlapping, gap-less windows.
A tumbling window is defined by a single property: the window’s <em>size</em>.
A tumbling window is a hopping window whose window size is equal to its advance interval.
Since tumbling windows never overlap, a data record will belong to one and only one window.</p>
<pclass="caption"><spanclass="caption-text">This diagram shows windowing a stream of data records with tumbling windows. Windows do not overlap because, by
definition, the advance interval is identical to the window size. In this diagram the time numbers represent minutes;
e.g. t=5 means “at the five-minute mark”. In reality, the unit of time in Kafka Streams is milliseconds, which means
the time numbers would need to be multiplied with 60 * 1,000 to convert from minutes to milliseconds (e.g. t=5 would
become t=300,000).</span></p>
</div>
<p>Tumbling time windows are <em>aligned to the epoch</em>, with the lower interval bound being inclusive and the upper bound
being exclusive. “Aligned to the epoch” means that the first window starts at timestamp zero. For example, tumbling
windows with a size of 5000ms have predictable window boundaries <codeclass="docutils literal"><spanclass="pre">[0;5000),[5000;10000),...</span></code>— and <strong>not</strong>
<codeclass="docutils literal"><spanclass="pre">[1000;6000),[6000;11000),...</span></code> or even something “random” like <codeclass="docutils literal"><spanclass="pre">[1452;6452),[6452;11452),...</span></code>.</p>
<p>The following code defines a tumbling window with a size of 5 minutes:</p>
<spanid="windowing-sliding"></span><h5><aclass="toc-backref"href="#id22">Sliding time windows</a><aclass="headerlink"href="#sliding-time-windows"title="Permalink to this headline"></a></h5>
<p>Sliding windows are actually quite different from hopping and tumbling windows. In Kafka Streams, sliding windows