blob: 508ca6800d564ebe40e212a571551ec0892fcce3 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_80) on Thu Aug 04 13:19:28 BST 2016 -->
<title>TimeWindows (kafka 0.10.0.1 API)</title>
<meta name="date" content="2016-08-04">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TimeWindows (kafka 0.10.0.1 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/kafka/streams/kstream/Reducer.html" title="interface in org.apache.kafka.streams.kstream"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/kafka/streams/kstream/Transformer.html" title="interface in org.apache.kafka.streams.kstream"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/kafka/streams/kstream/TimeWindows.html" target="_top">Frames</a></li>
<li><a href="TimeWindows.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.kafka.streams.kstream</div>
<h2 title="Class TimeWindows" class="title">Class TimeWindows</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/kafka/streams/kstream/Windows.html" title="class in org.apache.kafka.streams.kstream">org.apache.kafka.streams.kstream.Windows</a>&lt;TimeWindow&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.kafka.streams.kstream.TimeWindows</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">TimeWindows</span>
extends <a href="../../../../../org/apache/kafka/streams/kstream/Windows.html" title="class in org.apache.kafka.streams.kstream">Windows</a>&lt;TimeWindow&gt;</pre>
<div class="block">The time-based window specifications used for aggregations.
<p>
The semantics of a time-based window are: Every T1 (advance) time-units, compute the aggregate total for T2 (size) time-units.
<ul>
<li> If <code>advance &lt; size</code> a hopping windows is defined: <br />
it discretize a stream into overlapping windows, which implies that a record maybe contained in one and or more "adjacent" windows.</li>
<li> If <code>advance == size</code> a tumbling window is defined:<br />
it discretize a stream into non-overlapping windows, which implies that a record is only ever contained in one and only one tumbling window.</li>
</ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html#advance">advance</a></strong></code>
<div class="block">The size of the window's advance interval, i.e.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html#size">size</a></strong></code>
<div class="block">The size of the window, i.e.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.kafka.streams.kstream.Windows">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.kafka.streams.kstream.<a href="../../../../../org/apache/kafka/streams/kstream/Windows.html" title="class in org.apache.kafka.streams.kstream">Windows</a></h3>
<code><a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#name">name</a>, <a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#segments">segments</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html" title="class in org.apache.kafka.streams.kstream">TimeWindows</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html#advanceBy(long)">advanceBy</a></strong>(long&nbsp;interval)</code>
<div class="block">Returns a window definition with the original size, but advance ("hop") the window by the given
interval, which specifies by how much a window moves forward relative to the previous one.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html#equals(java.lang.Object)">equals</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;o)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html#hashCode()">hashCode</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html" title="class in org.apache.kafka.streams.kstream">TimeWindows</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html#of(java.lang.String,%20long)">of</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
long&nbsp;size)</code>
<div class="block">Returns a window definition with the given window size, and with the advance interval being
equal to the window size.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>,TimeWindow&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html#windowsFor(long)">windowsFor</a></strong>(long&nbsp;timestamp)</code>
<div class="block">Creates all windows that contain the provided timestamp, indexed by non-negative window start timestamps.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.kafka.streams.kstream.Windows">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.kafka.streams.kstream.<a href="../../../../../org/apache/kafka/streams/kstream/Windows.html" title="class in org.apache.kafka.streams.kstream">Windows</a></h3>
<code><a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#maintainMs()">maintainMs</a>, <a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#name()">name</a>, <a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#segments(int)">segments</a>, <a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#until(long)">until</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="size">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>size</h4>
<pre>public final&nbsp;long size</pre>
<div class="block">The size of the window, i.e. how long a window lasts.
The window size's effective time unit is determined by the semantics of the topology's
configured <a href="../../../../../org/apache/kafka/streams/processor/TimestampExtractor.html" title="interface in org.apache.kafka.streams.processor"><code>TimestampExtractor</code></a>.</div>
</li>
</ul>
<a name="advance">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>advance</h4>
<pre>public final&nbsp;long advance</pre>
<div class="block">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
the topology's configured <a href="../../../../../org/apache/kafka/streams/processor/TimestampExtractor.html" title="interface in org.apache.kafka.streams.processor"><code>TimestampExtractor</code></a>.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="of(java.lang.String, long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>of</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html" title="class in org.apache.kafka.streams.kstream">TimeWindows</a>&nbsp;of(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
long&nbsp;size)</pre>
<div class="block">Returns a window definition with the given window size, and with the advance interval being
equal to the window size. Think: [N * size, N * size + size), with N denoting the N-th
window.
This provides the semantics of tumbling windows, which are fixed-sized, gap-less,
non-overlapping windows. Tumbling windows are a specialization of hopping windows.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - The name of the window. Must not be null or empty.</dd><dd><code>size</code> - The size of the window, with the requirement that size &gt; 0.
The window size's effective time unit is determined by the semantics of the
topology's configured <a href="../../../../../org/apache/kafka/streams/processor/TimestampExtractor.html" title="interface in org.apache.kafka.streams.processor"><code>TimestampExtractor</code></a>.</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new window definition</dd></dl>
</li>
</ul>
<a name="advanceBy(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>advanceBy</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/kafka/streams/kstream/TimeWindows.html" title="class in org.apache.kafka.streams.kstream">TimeWindows</a>&nbsp;advanceBy(long&nbsp;interval)</pre>
<div class="block">Returns a window definition with the original size, but advance ("hop") the window by the given
interval, which specifies by how much a window moves forward relative to the previous one.
Think: [N * advanceInterval, N * advanceInterval + size), with N denoting the N-th window.
This provides the semantics of hopping windows, which are fixed-sized, overlapping windows.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>interval</code> - The advance interval ("hop") of the window, with the requirement that
0 &lt; interval &le; size. The interval's effective time unit is
determined by the semantics of the topology's configured
<a href="../../../../../org/apache/kafka/streams/processor/TimestampExtractor.html" title="interface in org.apache.kafka.streams.processor"><code>TimestampExtractor</code></a>.</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new window definition</dd></dl>
</li>
</ul>
<a name="windowsFor(long)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>windowsFor</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>,TimeWindow&gt;&nbsp;windowsFor(long&nbsp;timestamp)</pre>
<div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#windowsFor(long)">Windows</a></code></strong></div>
<div class="block">Creates all windows that contain the provided timestamp, indexed by non-negative window start timestamps.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/kafka/streams/kstream/Windows.html#windowsFor(long)">windowsFor</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/kafka/streams/kstream/Windows.html" title="class in org.apache.kafka.streams.kstream">Windows</a>&lt;TimeWindow&gt;</code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>timestamp</code> - the timestamp window should get created for</dd>
<dt><span class="strong">Returns:</span></dt><dd>a map of <code>windowStartTimestamp -&gt; Window</code> entries</dd></dl>
</li>
</ul>
<a name="equals(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public final&nbsp;boolean&nbsp;equals(<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;o)</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
</dl>
</li>
</ul>
<a name="hashCode()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;hashCode()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/kafka/streams/kstream/Reducer.html" title="interface in org.apache.kafka.streams.kstream"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/kafka/streams/kstream/Transformer.html" title="interface in org.apache.kafka.streams.kstream"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/kafka/streams/kstream/TimeWindows.html" target="_top">Frames</a></li>
<li><a href="TimeWindows.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>