You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by jm...@apache.org on 2017/06/09 18:46:24 UTC
svn commit: r1798258 [5/22] - in /samza/site: ./ archive/ community/
contribute/ img/latest/learn/documentation/introduction/
img/latest/learn/tutorials/
img/latest/learn/tutorials/hello-samza-high-level/
learn/documentation/latest/ learn/documentation...
Modified: samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/ContextManager.html
URL: http://svn.apache.org/viewvc/samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/ContextManager.html?rev=1798258&r1=1798257&r2=1798258&view=diff
==============================================================================
--- samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/ContextManager.html (original)
+++ samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/ContextManager.html Fri Jun 9 18:46:20 2017
@@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
-<!-- Generated by javadoc (1.8.0_74) on Wed Feb 22 13:00:21 PST 2017 -->
-<title>ContextManager (samza-api 0.13.0-SNAPSHOT API)</title>
-<meta name="date" content="2017-02-22">
+<!-- Generated by javadoc (1.8.0_60) on Fri Jun 09 11:41:34 PDT 2017 -->
+<title>ContextManager (samza-api 0.13.1-SNAPSHOT API)</title>
+<meta name="date" content="2017-06-09">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
@@ -12,14 +12,14 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="ContextManager (samza-api 0.13.0-SNAPSHOT API)";
+ parent.document.title="ContextManager (samza-api 0.13.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
-var methods = {"i0":18,"i1":18};
-var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],16:["t5","Default Methods"]};
+var methods = {"i0":6,"i1":6};
+var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
@@ -102,7 +102,7 @@ var activeTableTab = "activeTableTab";
<br>
<pre><a href="../../../../org/apache/samza/annotation/InterfaceStability.Unstable.html" title="annotation in org.apache.samza.annotation">@InterfaceStability.Unstable</a>
public interface <span class="typeNameLabel">ContextManager</span></pre>
-<div class="block">Interface class defining methods to initialize and finalize the context used by the transformation functions.</div>
+<div class="block">Manages custom context that is shared across multiple operator functions in a task.</div>
</li>
</ul>
</div>
@@ -116,22 +116,22 @@ public interface <span class="typeNameLa
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
-<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption>
+<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
-<td class="colFirst"><code>default void</code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/ContextManager.html#finalizeTaskContext--">finalizeTaskContext</a></span>()</code>
-<div class="block">The finalize method to allow users to close resource initialized in <a href="../../../../org/apache/samza/operators/ContextManager.html#initTaskContext-org.apache.samza.config.Config-org.apache.samza.task.TaskContext-"><code>initTaskContext(org.apache.samza.config.Config, org.apache.samza.task.TaskContext)</code></a> method.</div>
+<td class="colFirst"><code>void</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/ContextManager.html#close--">close</a></span>()</code>
+<div class="block">Allows closing the custom context that is shared across multiple operator functions in a task.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
-<td class="colFirst"><code>default <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task">TaskContext</a></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/ContextManager.html#initTaskContext-org.apache.samza.config.Config-org.apache.samza.task.TaskContext-">initTaskContext</a></span>(<a href="../../../../org/apache/samza/config/Config.html" title="class in org.apache.samza.config">Config</a> config,
- <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task">TaskContext</a> context)</code>
-<div class="block">The initialization method to create shared context for the whole task in Samza.</div>
+<td class="colFirst"><code>void</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/ContextManager.html#init-org.apache.samza.config.Config-org.apache.samza.task.TaskContext-">init</a></span>(<a href="../../../../org/apache/samza/config/Config.html" title="class in org.apache.samza.config">Config</a> config,
+ <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task">TaskContext</a> context)</code>
+<div class="block">Allows initializing and setting a custom context that is shared across multiple operator functions in a task.</div>
</td>
</tr>
</table>
@@ -149,32 +149,34 @@ public interface <span class="typeNameLa
<!-- -->
</a>
<h3>Method Detail</h3>
-<a name="initTaskContext-org.apache.samza.config.Config-org.apache.samza.task.TaskContext-">
+<a name="init-org.apache.samza.config.Config-org.apache.samza.task.TaskContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
-<h4>initTaskContext</h4>
-<pre>default <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task">TaskContext</a> initTaskContext(<a href="../../../../org/apache/samza/config/Config.html" title="class in org.apache.samza.config">Config</a> config,
- <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task">TaskContext</a> context)</pre>
-<div class="block">The initialization method to create shared context for the whole task in Samza. Default to NO-OP</div>
+<h4>init</h4>
+<pre>void init(<a href="../../../../org/apache/samza/config/Config.html" title="class in org.apache.samza.config">Config</a> config,
+ <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task">TaskContext</a> context)</pre>
+<div class="block">Allows initializing and setting a custom context that is shared across multiple operator functions in a task.
+ <p>
+ This method is invoked before any <a href="../../../../org/apache/samza/operators/functions/InitableFunction.html" title="interface in org.apache.samza.operators.functions"><code>InitableFunction</code></a>s are initialized.
+ Use <a href="../../../../org/apache/samza/task/TaskContext.html#setUserContext-java.lang.Object-"><code>TaskContext.setUserContext(Object)</code></a> to set the context here and <a href="../../../../org/apache/samza/task/TaskContext.html#getUserContext--"><code>TaskContext.getUserContext()</code></a> to
+ get it in InitableFunctions.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
-<dd><code>config</code> - the configuration object for the task</dd>
-<dd><code>context</code> - the <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task"><code>TaskContext</code></a> object</dd>
-<dt><span class="returnLabel">Returns:</span></dt>
-<dd>User-defined task-wide context object</dd>
+<dd><code>config</code> - the <a href="../../../../org/apache/samza/config/Config.html" title="class in org.apache.samza.config"><code>Config</code></a> for the application</dd>
+<dd><code>context</code> - the <a href="../../../../org/apache/samza/task/TaskContext.html" title="interface in org.apache.samza.task"><code>TaskContext</code></a> for this task</dd>
</dl>
</li>
</ul>
-<a name="finalizeTaskContext--">
+<a name="close--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
-<h4>finalizeTaskContext</h4>
-<pre>default void finalizeTaskContext()</pre>
-<div class="block">The finalize method to allow users to close resource initialized in <a href="../../../../org/apache/samza/operators/ContextManager.html#initTaskContext-org.apache.samza.config.Config-org.apache.samza.task.TaskContext-"><code>initTaskContext(org.apache.samza.config.Config, org.apache.samza.task.TaskContext)</code></a> method. Default to NO-OP.</div>
+<h4>close</h4>
+<pre>void close()</pre>
+<div class="block">Allows closing the custom context that is shared across multiple operator functions in a task.</div>
</li>
</ul>
</li>
Modified: samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/MessageStream.html
URL: http://svn.apache.org/viewvc/samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/MessageStream.html?rev=1798258&r1=1798257&r2=1798258&view=diff
==============================================================================
--- samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/MessageStream.html (original)
+++ samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/MessageStream.html Fri Jun 9 18:46:20 2017
@@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
-<!-- Generated by javadoc (1.8.0_74) on Wed Feb 22 13:00:21 PST 2017 -->
-<title>MessageStream (samza-api 0.13.0-SNAPSHOT API)</title>
-<meta name="date" content="2017-02-22">
+<!-- Generated by javadoc (1.8.0_60) on Fri Jun 09 11:41:35 PDT 2017 -->
+<title>MessageStream (samza-api 0.13.1-SNAPSHOT API)</title>
+<meta name="date" content="2017-06-09">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
@@ -12,14 +12,14 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="MessageStream (samza-api 0.13.0-SNAPSHOT API)";
+ parent.document.title="MessageStream (samza-api 0.13.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
-var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6};
-var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
+var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":17,"i6":6,"i7":6,"i8":6,"i9":6};
+var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
@@ -100,15 +100,15 @@ var activeTableTab = "activeTableTab";
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
-<dd><code>M</code> - type of messages in this stream</dd>
+<dd><code>M</code> - the type of messages in this stream</dd>
</dl>
<hr>
<br>
<pre><a href="../../../../org/apache/samza/annotation/InterfaceStability.Unstable.html" title="annotation in org.apache.samza.annotation">@InterfaceStability.Unstable</a>
public interface <span class="typeNameLabel">MessageStream<M></span></pre>
-<div class="block">Represents a stream of messages.
+<div class="block">A stream of messages that can be transformed into another <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.
<p>
- A <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> can be transformed into another <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> by applying the transforms in this API.</div>
+ A <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> corresponding to an input stream can be obtained using <a href="../../../../org/apache/samza/operators/StreamGraph.html#getInputStream-java.lang.String-java.util.function.BiFunction-"><code>StreamGraph.getInputStream(java.lang.String, java.util.function.BiFunction<? super K, ? super V, ? extends M>)</code></a>.</div>
</li>
</ul>
</div>
@@ -122,64 +122,73 @@ public interface <span class="typeNameLa
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
-<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption>
+<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#filter-org.apache.samza.operators.functions.FilterFunction-">filter</a></span>(<a href="../../../../org/apache/samza/operators/functions/FilterFunction.html" title="interface in org.apache.samza.operators.functions">FilterFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> filterFn)</code>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#filter-org.apache.samza.operators.functions.FilterFunction-">filter</a></span>(<a href="../../../../org/apache/samza/operators/functions/FilterFunction.html" title="interface in org.apache.samza.operators.functions">FilterFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> filterFn)</code>
<div class="block">Applies the provided function to messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> and returns the
- transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
+ filtered <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
-<td class="colFirst"><code><TM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><TM></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#flatMap-org.apache.samza.operators.functions.FlatMapFunction-">flatMap</a></span>(<a href="../../../../org/apache/samza/operators/functions/FlatMapFunction.html" title="interface in org.apache.samza.operators.functions">FlatMapFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,TM> flatMapFn)</code>
+<td class="colFirst"><code><OM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#flatMap-org.apache.samza.operators.functions.FlatMapFunction-">flatMap</a></span>(<a href="../../../../org/apache/samza/operators/functions/FlatMapFunction.html" title="interface in org.apache.samza.operators.functions">FlatMapFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? extends OM> flatMapFn)</code>
<div class="block">Applies the provided 1:n function to transform a message in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>
to n messages in the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></div>
</td>
</tr>
<tr id="i2" class="altColor">
-<td class="colFirst"><code><K,OM,RM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><RM></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#join-org.apache.samza.operators.MessageStream-org.apache.samza.operators.functions.JoinFunction-">join</a></span>(<a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM> otherStream,
- <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions">JoinFunction</a><K,<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,OM,RM> joinFn)</code>
-<div class="block">Joins this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> with another <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> using the provided pairwise <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions"><code>JoinFunction</code></a>.</div>
+<td class="colFirst"><code><K,JM,OM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#join-org.apache.samza.operators.MessageStream-org.apache.samza.operators.functions.JoinFunction-java.time.Duration-">join</a></span>(<a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><JM> otherStream,
+ <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions">JoinFunction</a><? extends K,? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? super JM,? extends OM> joinFn,
+ java.time.Duration ttl)</code>
+<div class="block">Joins this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> with another <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> using the provided
+ pairwise <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions"><code>JoinFunction</code></a>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
-<td class="colFirst"><code><TM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><TM></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#map-org.apache.samza.operators.functions.MapFunction-">map</a></span>(<a href="../../../../org/apache/samza/operators/functions/MapFunction.html" title="interface in org.apache.samza.operators.functions">MapFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,TM> mapFn)</code>
+<td class="colFirst"><code><OM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#map-org.apache.samza.operators.functions.MapFunction-">map</a></span>(<a href="../../../../org/apache/samza/operators/functions/MapFunction.html" title="interface in org.apache.samza.operators.functions">MapFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? extends OM> mapFn)</code>
<div class="block">Applies the provided 1:1 function to messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> and returns the
transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#merge-java.util.Collection-">merge</a></span>(java.util.Collection<<a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>>> otherStreams)</code>
-<div class="block">Merge all <code>otherStreams</code> with this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#merge-java.util.Collection-">merge</a></span>(java.util.Collection<? extends <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><? extends <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>>> otherStreams)</code>
+<div class="block">Merges all <code>otherStreams</code> with this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
-<td class="colFirst"><code><K> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#partitionBy-java.util.function.Function-">partitionBy</a></span>(java.util.function.Function<<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,K> parKeyExtractor)</code>
-<div class="block">Send the input message to an output <a href="../../../../org/apache/samza/system/SystemStream.html" title="class in org.apache.samza.system"><code>SystemStream</code></a> and consume it as input <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> again.</div>
+<td class="colFirst"><code>static <T> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><T></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#mergeAll-java.util.Collection-">mergeAll</a></span>(java.util.Collection<? extends <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><? extends T>> streams)</code>
+<div class="block">Merges all <code>streams</code>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
-<td class="colFirst"><code>void</code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#sendTo-org.apache.samza.operators.OutputStream-">sendTo</a></span>(<a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators">OutputStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> stream)</code>
-<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an output <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
+<td class="colFirst"><code><K> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>></code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#partitionBy-java.util.function.Function-">partitionBy</a></span>(java.util.function.Function<? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? extends K> keyExtractor)</code>
+<div class="block">Re-partitions this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> using keys from the <code>keyExtractor</code> by creating a new
+ intermediate stream on the <code>job.default.system</code>.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
-<td class="colFirst"><code>void</code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#sink-org.apache.samza.operators.functions.SinkFunction-">sink</a></span>(<a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions">SinkFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> sinkFn)</code>
-<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an output using the provided <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a>.</div>
+<td class="colFirst"><code><K,V> void</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#sendTo-org.apache.samza.operators.OutputStream-">sendTo</a></span>(<a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators">OutputStream</a><K,V,<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> outputStream)</code>
+<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an <a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators"><code>OutputStream</code></a>.</div>
</td>
</tr>
<tr id="i8" class="altColor">
+<td class="colFirst"><code>void</code></td>
+<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#sink-org.apache.samza.operators.functions.SinkFunction-">sink</a></span>(<a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions">SinkFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> sinkFn)</code>
+<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an output system using the provided <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a>.</div>
+</td>
+</tr>
+<tr id="i9" class="rowColor">
<td class="colFirst"><code><K,WV> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/windows/WindowPane.html" title="class in org.apache.samza.operators.windows">WindowPane</a><K,WV>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/MessageStream.html#window-org.apache.samza.operators.windows.Window-">window</a></span>(<a href="../../../../org/apache/samza/operators/windows/Window.html" title="interface in org.apache.samza.operators.windows">Window</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,K,WV> window)</code>
<div class="block">Groups the messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> according to the provided <a href="../../../../org/apache/samza/operators/windows/Window.html" title="interface in org.apache.samza.operators.windows"><code>Window</code></a> semantics
@@ -207,12 +216,12 @@ public interface <span class="typeNameLa
<ul class="blockList">
<li class="blockList">
<h4>map</h4>
-<pre><TM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><TM> map(<a href="../../../../org/apache/samza/operators/functions/MapFunction.html" title="interface in org.apache.samza.operators.functions">MapFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,TM> mapFn)</pre>
+<pre><OM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM> map(<a href="../../../../org/apache/samza/operators/functions/MapFunction.html" title="interface in org.apache.samza.operators.functions">MapFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? extends OM> mapFn)</pre>
<div class="block">Applies the provided 1:1 function to messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> and returns the
transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
-<dd><code>TM</code> - the type of messages in the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
+<dd><code>OM</code> - the type of messages in the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mapFn</code> - the function to transform a message to another message</dd>
<dt><span class="returnLabel">Returns:</span></dt>
@@ -226,12 +235,12 @@ public interface <span class="typeNameLa
<ul class="blockList">
<li class="blockList">
<h4>flatMap</h4>
-<pre><TM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><TM> flatMap(<a href="../../../../org/apache/samza/operators/functions/FlatMapFunction.html" title="interface in org.apache.samza.operators.functions">FlatMapFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,TM> flatMapFn)</pre>
+<pre><OM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM> flatMap(<a href="../../../../org/apache/samza/operators/functions/FlatMapFunction.html" title="interface in org.apache.samza.operators.functions">FlatMapFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? extends OM> flatMapFn)</pre>
<div class="block">Applies the provided 1:n function to transform a message in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>
to n messages in the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
-<dd><code>TM</code> - the type of messages in the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
+<dd><code>OM</code> - the type of messages in the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>flatMapFn</code> - the function to transform a message to zero or more messages</dd>
<dt><span class="returnLabel">Returns:</span></dt>
@@ -245,15 +254,15 @@ public interface <span class="typeNameLa
<ul class="blockList">
<li class="blockList">
<h4>filter</h4>
-<pre><a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> filter(<a href="../../../../org/apache/samza/operators/functions/FilterFunction.html" title="interface in org.apache.samza.operators.functions">FilterFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> filterFn)</pre>
+<pre><a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> filter(<a href="../../../../org/apache/samza/operators/functions/FilterFunction.html" title="interface in org.apache.samza.operators.functions">FilterFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> filterFn)</pre>
<div class="block">Applies the provided function to messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> and returns the
- transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.
+ filtered <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.
<p>
The <code>Function</code> is a predicate which determines whether a message in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>
- should be retained in the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
+ should be retained in the filtered <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
-<dd><code>filterFn</code> - the predicate to filter messages from this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
+<dd><code>filterFn</code> - the predicate to filter messages from this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
</dl>
@@ -265,13 +274,18 @@ public interface <span class="typeNameLa
<ul class="blockList">
<li class="blockList">
<h4>sink</h4>
-<pre>void sink(<a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions">SinkFunction</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> sinkFn)</pre>
-<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an output using the provided <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a>.
-
- NOTE: the output may not be a <a href="../../../../org/apache/samza/system/SystemStream.html" title="class in org.apache.samza.system"><code>SystemStream</code></a>. It can be an external database, etc.</div>
+<pre>void sink(<a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions">SinkFunction</a><? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> sinkFn)</pre>
+<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an output system using the provided <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a>.
+ <p>
+ Offers more control over processing and sending messages than <a href="../../../../org/apache/samza/operators/MessageStream.html#sendTo-org.apache.samza.operators.OutputStream-"><code>sendTo(OutputStream)</code></a> since
+ the <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a> has access to the <a href="../../../../org/apache/samza/task/MessageCollector.html" title="interface in org.apache.samza.task"><code>MessageCollector</code></a> and
+ <a href="../../../../org/apache/samza/task/TaskCoordinator.html" title="interface in org.apache.samza.task"><code>TaskCoordinator</code></a>.
+ <p>
+ This can also be used to send output to a system (e.g. a database) that doesn't have a corresponding
+ Samza SystemProducer implementation.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
-<dd><code>sinkFn</code> - the function to send messages in this stream to output</dd>
+<dd><code>sinkFn</code> - the function to send messages in this stream to an external system</dd>
</dl>
</li>
</ul>
@@ -281,13 +295,14 @@ public interface <span class="typeNameLa
<ul class="blockList">
<li class="blockList">
<h4>sendTo</h4>
-<pre>void sendTo(<a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators">OutputStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> stream)</pre>
-<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an output <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.
-
- NOTE: the <code>stream</code> has to be a <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.</div>
+<pre><K,V> void sendTo(<a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators">OutputStream</a><K,V,<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> outputStream)</pre>
+<div class="block">Allows sending messages in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to an <a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators"><code>OutputStream</code></a>.</div>
<dl>
+<dt><span class="paramLabel">Type Parameters:</span></dt>
+<dd><code>K</code> - the type of key in the outgoing message</dd>
+<dd><code>V</code> - the type of message in the outgoing message</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
-<dd><code>stream</code> - the output <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
+<dd><code>outputStream</code> - the output stream to send messages to</dd>
</dl>
</li>
</ul>
@@ -302,7 +317,9 @@ public interface <span class="typeNameLa
(e.g. tumbling, sliding or session windows) and returns the transformed <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> of
<a href="../../../../org/apache/samza/operators/windows/WindowPane.html" title="class in org.apache.samza.operators.windows"><code>WindowPane</code></a>s.
<p>
- Use the <a href="../../../../org/apache/samza/operators/windows/Windows.html" title="class in org.apache.samza.operators.windows"><code>Windows</code></a> helper methods to create the appropriate windows.</div>
+ Use the <a href="../../../../org/apache/samza/operators/windows/Windows.html" title="class in org.apache.samza.operators.windows"><code>Windows</code></a> helper methods to create the appropriate windows.
+ <p>
+ <b>Warning:</b> As of version 0.13.0, messages in windows are kept in memory and will be lost during restarts.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - the type of key in the message in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>. If a key is specified,
@@ -315,25 +332,33 @@ public interface <span class="typeNameLa
</dl>
</li>
</ul>
-<a name="join-org.apache.samza.operators.MessageStream-org.apache.samza.operators.functions.JoinFunction-">
+<a name="join-org.apache.samza.operators.MessageStream-org.apache.samza.operators.functions.JoinFunction-java.time.Duration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>join</h4>
-<pre><K,OM,RM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><RM> join(<a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM> otherStream,
- <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions">JoinFunction</a><K,<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,OM,RM> joinFn)</pre>
-<div class="block">Joins this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> with another <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> using the provided pairwise <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions"><code>JoinFunction</code></a>.
+<pre><K,JM,OM> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><OM> join(<a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><JM> otherStream,
+ <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions">JoinFunction</a><? extends K,? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? super JM,? extends OM> joinFn,
+ java.time.Duration ttl)</pre>
+<div class="block">Joins this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> with another <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> using the provided
+ pairwise <a href="../../../../org/apache/samza/operators/functions/JoinFunction.html" title="interface in org.apache.samza.operators.functions"><code>JoinFunction</code></a>.
<p>
- We currently only support 2-way joins.</div>
+ Messages in each stream are retained for the provided <code>ttl</code> and join results are
+ emitted as matches are found.
+ <p>
+ Both inputs being joined must have the same number of partitions, and should be partitioned by the join key.
+ <p>
+ <b>Warning:</b> As of version 0.13.0, messages in joins are kept in memory and will be lost during restarts.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - the type of join key</dd>
-<dd><code>OM</code> - the type of messages in the other stream</dd>
-<dd><code>RM</code> - the type of messages resulting from the <code>joinFn</code></dd>
+<dd><code>JM</code> - the type of messages in the other stream</dd>
+<dd><code>OM</code> - the type of messages resulting from the <code>joinFn</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>otherStream</code> - the other <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> to be joined with</dd>
<dd><code>joinFn</code> - the function to join messages from this and the other <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
+<dd><code>ttl</code> - the ttl for messages in each stream</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the joined <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
</dl>
@@ -345,10 +370,10 @@ public interface <span class="typeNameLa
<ul class="blockList">
<li class="blockList">
<h4>merge</h4>
-<pre><a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> merge(java.util.Collection<<a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>>> otherStreams)</pre>
-<div class="block">Merge all <code>otherStreams</code> with this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.
+<pre><a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> merge(java.util.Collection<? extends <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><? extends <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>>> otherStreams)</pre>
+<div class="block">Merges all <code>otherStreams</code> with this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>.
<p>
- The merging streams must have the same messages of type <code>M</code>.</div>
+ The merged stream contains messages from all streams in the order they arrive.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>otherStreams</code> - other <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>s to be merged with this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
@@ -357,23 +382,57 @@ public interface <span class="typeNameLa
</dl>
</li>
</ul>
+<a name="mergeAll-java.util.Collection-">
+<!-- -->
+</a>
+<ul class="blockList">
+<li class="blockList">
+<h4>mergeAll</h4>
+<pre>static <T> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><T> mergeAll(java.util.Collection<? extends <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><? extends T>> streams)</pre>
+<div class="block">Merges all <code>streams</code>.
+ <p>
+ The merged <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> contains messages from all <code>streams</code> in the order they arrive.</div>
+<dl>
+<dt><span class="paramLabel">Type Parameters:</span></dt>
+<dd><code>T</code> - the type of messages in each of the streams</dd>
+<dt><span class="paramLabel">Parameters:</span></dt>
+<dd><code>streams</code> - <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a>s to be merged</dd>
+<dt><span class="returnLabel">Returns:</span></dt>
+<dd>the merged <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
+<dt><span class="throwsLabel">Throws:</span></dt>
+<dd><code>java.lang.IllegalArgumentException</code> - if <code>streams</code> is empty</dd>
+</dl>
+</li>
+</ul>
<a name="partitionBy-java.util.function.Function-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>partitionBy</h4>
-<pre><K> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> partitionBy(java.util.function.Function<<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,K> parKeyExtractor)</pre>
-<div class="block">Send the input message to an output <a href="../../../../org/apache/samza/system/SystemStream.html" title="class in org.apache.samza.system"><code>SystemStream</code></a> and consume it as input <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> again.
-
- Note: this is an transform function only used in logic DAG. In a physical DAG, this is either translated to a NOOP function, or a <code>MessageStream#sendThrough</code> function.</div>
+<pre><K> <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators">MessageStream</a><<a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>> partitionBy(java.util.function.Function<? super <a href="../../../../org/apache/samza/operators/MessageStream.html" title="type parameter in MessageStream">M</a>,? extends K> keyExtractor)</pre>
+<div class="block">Re-partitions this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> using keys from the <code>keyExtractor</code> by creating a new
+ intermediate stream on the <code>job.default.system</code>. This intermediate stream is both an output and
+ input to the job.
+ <p>
+ The key and message Serdes configured for the default system must be able to serialize and deserialize
+ types K and M respectively.
+ <p>
+ The number of partitions for this intermediate stream is determined as follows:
+ If the stream is an eventual input to a <a href="../../../../org/apache/samza/operators/MessageStream.html#join-org.apache.samza.operators.MessageStream-org.apache.samza.operators.functions.JoinFunction-java.time.Duration-"><code>join(org.apache.samza.operators.MessageStream<JM>, org.apache.samza.operators.functions.JoinFunction<? extends K, ? super M, ? super JM, ? extends OM>, java.time.Duration)</code></a>, and the number of partitions for the other stream is known,
+ then number of partitions for this stream is set to the number of partitions in the other input stream.
+ Else, the number of partitions is set to the value of the <code>job.intermediate.stream.partitions</code>
+ configuration, if present.
+ Else, the number of partitions is set to to the max of number of partitions for all input and output streams
+ (excluding intermediate streams).</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
-<dd><code>K</code> - the type of partition key</dd>
+<dd><code>K</code> - the type of output message key and partition key</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
-<dd><code>parKeyExtractor</code> - a <code>Function</code> that extract the partition key from a message in this <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
+<dd><code>keyExtractor</code> - the <code>Function</code> to extract the output message key and partition key from
+ the input message</dd>
<dt><span class="returnLabel">Returns:</span></dt>
-<dd>a <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a> object after the re-partition</dd>
+<dd>the repartitioned <a href="../../../../org/apache/samza/operators/MessageStream.html" title="interface in org.apache.samza.operators"><code>MessageStream</code></a></dd>
</dl>
</li>
</ul>
Modified: samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/OutputStream.html
URL: http://svn.apache.org/viewvc/samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/OutputStream.html?rev=1798258&r1=1798257&r2=1798258&view=diff
==============================================================================
--- samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/OutputStream.html (original)
+++ samza/site/learn/documentation/latest/api/javadocs/org/apache/samza/operators/OutputStream.html Fri Jun 9 18:46:20 2017
@@ -2,9 +2,9 @@
<!-- NewPage -->
<html lang="en">
<head>
-<!-- Generated by javadoc (1.8.0_74) on Wed Feb 22 13:00:21 PST 2017 -->
-<title>OutputStream (samza-api 0.13.0-SNAPSHOT API)</title>
-<meta name="date" content="2017-02-22">
+<!-- Generated by javadoc (1.8.0_60) on Fri Jun 09 11:41:35 PDT 2017 -->
+<title>OutputStream (samza-api 0.13.1-SNAPSHOT API)</title>
+<meta name="date" content="2017-06-09">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
@@ -12,18 +12,12 @@
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
- parent.document.title="OutputStream (samza-api 0.13.0-SNAPSHOT API)";
+ parent.document.title="OutputStream (samza-api 0.13.1-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
-var methods = {"i0":6};
-var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
-var altColor = "altColor";
-var rowColor = "rowColor";
-var tableTab = "tableTab";
-var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
@@ -76,13 +70,13 @@ var activeTableTab = "activeTableTab";
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
-<li><a href="#method.summary">Method</a></li>
+<li>Method</li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
-<li><a href="#method.detail">Method</a></li>
+<li>Method</li>
</ul>
</div>
<a name="skip.navbar.top">
@@ -92,7 +86,7 @@ var activeTableTab = "activeTableTab";
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.samza.operators</div>
-<h2 title="Interface OutputStream" class="title">Interface OutputStream<M></h2>
+<h2 title="Interface OutputStream" class="title">Interface OutputStream<K,V,M></h2>
</div>
<div class="contentContainer">
<div class="description">
@@ -100,70 +94,15 @@ var activeTableTab = "activeTableTab";
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
-<dd><code>M</code> - The type of message to be send to this output stream</dd>
+<dd><code>K</code> - the type of key in the outgoing message</dd>
+<dd><code>V</code> - the type of message in the outgoing message</dd>
+<dd><code>M</code> - the type of message in this <a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators"><code>OutputStream</code></a></dd>
</dl>
<hr>
<br>
<pre><a href="../../../../org/apache/samza/annotation/InterfaceStability.Unstable.html" title="annotation in org.apache.samza.annotation">@InterfaceStability.Unstable</a>
-public interface <span class="typeNameLabel">OutputStream<M></span></pre>
-<div class="block">The interface class defining the specific <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a> for a system <a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators"><code>OutputStream</code></a>.</div>
-</li>
-</ul>
-</div>
-<div class="summary">
-<ul class="blockList">
-<li class="blockList">
-<!-- ========== METHOD SUMMARY =========== -->
-<ul class="blockList">
-<li class="blockList"><a name="method.summary">
-<!-- -->
-</a>
-<h3>Method Summary</h3>
-<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
-<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption>
-<tr>
-<th class="colFirst" scope="col">Modifier and Type</th>
-<th class="colLast" scope="col">Method and Description</th>
-</tr>
-<tr id="i0" class="altColor">
-<td class="colFirst"><code><a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions">SinkFunction</a><<a href="../../../../org/apache/samza/operators/OutputStream.html" title="type parameter in OutputStream">M</a>></code></td>
-<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/samza/operators/OutputStream.html#getSinkFunction--">getSinkFunction</a></span>()</code>
-<div class="block">Returns the specific <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a> for this output stream.</div>
-</td>
-</tr>
-</table>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-<div class="details">
-<ul class="blockList">
-<li class="blockList">
-<!-- ============ METHOD DETAIL ========== -->
-<ul class="blockList">
-<li class="blockList"><a name="method.detail">
-<!-- -->
-</a>
-<h3>Method Detail</h3>
-<a name="getSinkFunction--">
-<!-- -->
-</a>
-<ul class="blockListLast">
-<li class="blockList">
-<h4>getSinkFunction</h4>
-<pre><a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions">SinkFunction</a><<a href="../../../../org/apache/samza/operators/OutputStream.html" title="type parameter in OutputStream">M</a>> getSinkFunction()</pre>
-<div class="block">Returns the specific <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a> for this output stream. The <a href="../../../../org/apache/samza/operators/OutputStream.html" title="interface in org.apache.samza.operators"><code>OutputStream</code></a> is created
- via <a href="../../../../org/apache/samza/operators/StreamGraph.html#createOutStream-org.apache.samza.operators.StreamSpec-org.apache.samza.serializers.Serde-org.apache.samza.serializers.Serde-"><code>StreamGraph.createOutStream(StreamSpec, Serde, Serde)</code></a> or <a href="../../../../org/apache/samza/operators/StreamGraph.html#createIntStream-org.apache.samza.operators.StreamSpec-org.apache.samza.serializers.Serde-org.apache.samza.serializers.Serde-"><code>StreamGraph.createIntStream(StreamSpec, Serde, Serde)</code></a>.
- Hence, the proper types of serdes for key and value are instantiated and are used in the <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a> returned.</div>
-<dl>
-<dt><span class="returnLabel">Returns:</span></dt>
-<dd>The pre-defined <a href="../../../../org/apache/samza/operators/functions/SinkFunction.html" title="interface in org.apache.samza.operators.functions"><code>SinkFunction</code></a> to apply proper serdes before sending the message to the output stream.</dd>
-</dl>
-</li>
-</ul>
-</li>
-</ul>
+public interface <span class="typeNameLabel">OutputStream<K,V,M></span></pre>
+<div class="block">An output stream to send messages to.</div>
</li>
</ul>
</div>
@@ -217,13 +156,13 @@ public interface <span class="typeNameLa
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
-<li><a href="#method.summary">Method</a></li>
+<li>Method</li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
-<li><a href="#method.detail">Method</a></li>
+<li>Method</li>
</ul>
</div>
<a name="skip.navbar.bottom">