| <!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 (1.8.0_112) on Mon Dec 18 11:25:19 EST 2017 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>PlumbingStreams (Apache Edgent (incubating) v1.2.0 API)</title> |
| <meta name="date" content="2017-12-18"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="PlumbingStreams (Apache Edgent (incubating) v1.2.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":9,"i1":9,"i2":9,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9,"i10":9,"i11":9,"i12":9,"i13":9,"i14":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <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="class-use/PlumbingStreams.html">Use</a></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/edgent/topology/plumbing/LoadBalancedSplitter.html" title="class in org.apache.edgent.topology.plumbing"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/edgent/topology/plumbing/Valve.html" title="class in org.apache.edgent.topology.plumbing"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/edgent/topology/plumbing/PlumbingStreams.html" target="_top">Frames</a></li> |
| <li><a href="PlumbingStreams.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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.edgent.topology.plumbing</div> |
| <h2 title="Class PlumbingStreams" class="title">Class PlumbingStreams</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="http://docs.oracle.com/javase/8/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>org.apache.edgent.topology.plumbing.PlumbingStreams</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public class <span class="typeNameLabel">PlumbingStreams</span> |
| extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block">Plumbing utilities for <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology"><code>TStream</code></a>. |
| Methods that manipulate the flow of tuples in a streaming topology, |
| but are not part of the logic of the application.</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#PlumbingStreams--">PlumbingStreams</a></span>()</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== 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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete 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>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><T>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#barrier-java.util.List-">barrier</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>> streams)</code> |
| <div class="block">A tuple synchronization barrier.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><T>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#barrier-java.util.List-int-">barrier</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>> streams, |
| int queueCapacity)</code> |
| <div class="block">A tuple synchronization barrier.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#blockingDelay-org.apache.edgent.topology.TStream-long-java.util.concurrent.TimeUnit-">blockingDelay</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| long delay, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a> unit)</code> |
| <div class="block">Insert a blocking delay between tuples.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#blockingOneShotDelay-org.apache.edgent.topology.TStream-long-java.util.concurrent.TimeUnit-">blockingOneShotDelay</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| long delay, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a> unit)</code> |
| <div class="block">Insert a blocking delay before forwarding the first tuple and |
| no delay for subsequent tuples.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#blockingThrottle-org.apache.edgent.topology.TStream-long-java.util.concurrent.TimeUnit-">blockingThrottle</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| long delay, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a> unit)</code> |
| <div class="block">Maintain a constant blocking delay between tuples.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>static <T,U,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#concurrent-org.apache.edgent.topology.TStream-java.util.List-org.apache.edgent.function.Function-">concurrent</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>,<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><U>>> pipelines, |
| <a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><U>,R> combiner)</code> |
| <div class="block">Perform analytics concurrently.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>static <T,U,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#concurrentMap-org.apache.edgent.topology.TStream-java.util.List-org.apache.edgent.function.Function-">concurrentMap</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><T,U>> mappers, |
| <a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><U>,R> combiner)</code> |
| <div class="block">Perform analytics concurrently.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#gate-org.apache.edgent.topology.TStream-java.util.concurrent.Semaphore-">gate</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Semaphore.html?is-external=true" title="class or interface in java.util.concurrent">Semaphore</a> semaphore)</code> |
| <div class="block">Control the flow of tuples to an output stream.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#isolate-org.apache.edgent.topology.TStream-boolean-">isolate</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| boolean ordered)</code> |
| <div class="block">Isolate upstream processing from downstream processing.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#isolate-org.apache.edgent.topology.TStream-int-">isolate</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int queueCapacity)</code> |
| <div class="block">Isolate upstream processing from downstream processing.</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>static <T,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#parallel-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.ToIntFunction-org.apache.edgent.function.BiFunction-">parallel</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int width, |
| <a href="../../../../../org/apache/edgent/function/ToIntFunction.html" title="interface in org.apache.edgent.function">ToIntFunction</a><T> splitter, |
| <a href="../../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>,<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R>> pipeline)</code> |
| <div class="block">Perform an analytic pipeline on tuples in parallel.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>static <T,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#parallelBalanced-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.BiFunction-">parallelBalanced</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int width, |
| <a href="../../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>,<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R>> pipeline)</code> |
| <div class="block">Perform an analytic pipeline on tuples in parallel.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>static <T,U> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><U></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#parallelMap-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.ToIntFunction-org.apache.edgent.function.BiFunction-">parallelMap</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int width, |
| <a href="../../../../../org/apache/edgent/function/ToIntFunction.html" title="interface in org.apache.edgent.function">ToIntFunction</a><T> splitter, |
| <a href="../../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a><T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>,U> mapper)</code> |
| <div class="block">Perform an analytic function on tuples in parallel.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code>static <T,K> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#pressureReliever-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-int-">pressureReliever</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><T,K> keyFunction, |
| int count)</code> |
| <div class="block">Relieve pressure on upstream processing by discarding tuples.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>static <T> <a href="../../../../../org/apache/edgent/function/ToIntFunction.html" title="interface in org.apache.edgent.function">ToIntFunction</a><T></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#roundRobinSplitter-int-">roundRobinSplitter</a></span>(int width)</code> |
| <div class="block">A round-robin splitter ToIntFunction</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/8/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/8/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/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/8/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/8/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/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/8/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/8/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/8/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/8/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/8/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/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" 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"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="PlumbingStreams--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>PlumbingStreams</h4> |
| <pre>public PlumbingStreams()</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="blockingDelay-org.apache.edgent.topology.TStream-long-java.util.concurrent.TimeUnit-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>blockingDelay</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> blockingDelay(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| long delay, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a> unit)</pre> |
| <div class="block">Insert a blocking delay between tuples. |
| Returned stream is the input stream delayed by <code>delay</code>. |
| <p> |
| Delays less than 1msec are translated to a 0 delay. |
| <p> |
| This function always adds the <code>delay</code> amount after receiving |
| a tuple before forwarding it. |
| <p> |
| Downstream tuple processing delays will affect |
| the overall delay of a subsequent tuple. |
| <p> |
| e.g., the input stream contains two tuples t1 and t2 and |
| the delay is 100ms. The forwarding of t1 is delayed by 100ms. |
| Then if a downstream processing delay of 80ms occurs, this function |
| receives t2 80ms after it forwarded t1 and it will delay another |
| 100ms before forwarding t2. Hence the overall delay between forwarding |
| t1 and t2 is 180ms. |
| See <a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#blockingThrottle-long-java.util.concurrent.TimeUnit-"><code>blockingThrottle</code></a>.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - Stream t</dd> |
| <dd><code>delay</code> - Amount of time to delay a tuple.</dd> |
| <dd><code>unit</code> - Time unit for <code>delay</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Stream that will be delayed.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="blockingThrottle-org.apache.edgent.topology.TStream-long-java.util.concurrent.TimeUnit-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>blockingThrottle</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> blockingThrottle(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| long delay, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a> unit)</pre> |
| <div class="block">Maintain a constant blocking delay between tuples. |
| The returned stream is the input stream throttled by <code>delay</code>. |
| <p> |
| Delays less than 1msec are translated to a 0 delay. |
| <p> |
| Sample use: |
| <pre><code> |
| TStream<String> stream = topology.strings("a", "b, "c"); |
| // Create a stream with tuples throttled to 1 second intervals. |
| TStream<String> throttledStream = blockingThrottle(stream, 1, TimeUnit.SECOND); |
| // print out the throttled tuples as they arrive |
| throttledStream.peek(t -> System.out.println(new Date() + " - " + t)); |
| </code></pre> |
| <p> |
| The function adjusts for downstream processing delays. |
| The first tuple is not delayed. If <code>delay</code> has already |
| elapsed since the prior tuple was forwarded, the tuple |
| is forwarded immediately. |
| Otherwise, forwarding the tuple is delayed to achieve |
| a <code>delay</code> amount since forwarding the prior tuple. |
| <p> |
| e.g., the input stream contains two tuples t1 and t2 and |
| the delay is 100ms. The forwarding of t1 is delayed by 100ms. |
| Then if a downstream processing delay of 80ms occurs, this function |
| receives t2 80ms after it forwarded t1 and it will only delay another |
| 20ms (100ms - 80ms) before forwarding t2. |
| Hence the overall delay between forwarding t1 and t2 remains 100ms.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - the stream to throttle</dd> |
| <dd><code>delay</code> - Amount of time to delay a tuple.</dd> |
| <dd><code>unit</code> - Time unit for <code>delay</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the throttled stream</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="blockingOneShotDelay-org.apache.edgent.topology.TStream-long-java.util.concurrent.TimeUnit-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>blockingOneShotDelay</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> blockingOneShotDelay(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| long delay, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a> unit)</pre> |
| <div class="block">Insert a blocking delay before forwarding the first tuple and |
| no delay for subsequent tuples. |
| <p> |
| Delays less than 1msec are translated to a 0 delay. |
| <p> |
| Sample use: |
| <pre><code> |
| TStream<String> stream = topology.strings("a", "b, "c"); |
| // create a stream where the first tuple is delayed by 5 seconds. |
| TStream<String> oneShotDelayedStream = |
| stream.map( blockingOneShotDelay(5, TimeUnit.SECONDS) ); |
| </code></pre></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - input stream</dd> |
| <dd><code>delay</code> - Amount of time to delay a tuple.</dd> |
| <dd><code>unit</code> - Time unit for <code>delay</code>.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the delayed stream</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="pressureReliever-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>pressureReliever</h4> |
| <pre>public static <T,K> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> pressureReliever(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><T,K> keyFunction, |
| int count)</pre> |
| <div class="block">Relieve pressure on upstream processing by discarding tuples. |
| This method ensures that upstream processing is not |
| constrained by any delay in downstream processing, |
| for example by a connector not being able to connect |
| to its external system. |
| <P> |
| Any downstream processing of the returned stream is isolated |
| from <code>stream</code> so that any slow down does not affect <code>stream</code>. |
| When the downstream processing cannot keep up with rate of |
| <code>stream</code> tuples will be dropped from returned stream. |
| <BR> |
| Up to <code>count</code> of the most recent tuples per key from <code>stream</code> |
| are maintained when downstream processing is slow, any older tuples |
| that have not been submitted to the returned stream will be discarded. |
| <BR> |
| Tuple order is maintained within a partition but is not guaranteed to |
| be maintained across partitions. |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type.</dd> |
| <dd><code>K</code> - Key type.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - Stream to be isolated from downstream processing.</dd> |
| <dd><code>keyFunction</code> - Function defining the key of each tuple.</dd> |
| <dd><code>count</code> - Maximum number of tuples to maintain when downstream processing is backing up.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Stream that is isolated from and thus relieves pressure on <code>stream</code>.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#isolate-org.apache.edgent.topology.TStream-int-"><code>isolate</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isolate-org.apache.edgent.topology.TStream-boolean-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isolate</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> isolate(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| boolean ordered)</pre> |
| <div class="block">Isolate upstream processing from downstream processing. |
| <BR> |
| Implementations may throw <code>OutOfMemoryExceptions</code> |
| if the processing against returned stream cannot keep up |
| with the arrival rate of tuples on <code>stream</code>.</div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - Stream to be isolated from downstream processing.</dd> |
| <dd><code>ordered</code> - <code>true</code> to maintain arrival order on the returned stream, |
| <code>false</code> to not guaranteed arrival order.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Stream that is isolated from <code>stream</code>.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isolate-org.apache.edgent.topology.TStream-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isolate</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> isolate(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int queueCapacity)</pre> |
| <div class="block">Isolate upstream processing from downstream processing. |
| <P> |
| If the processing against the returned stream cannot keep up |
| with the arrival rate of tuples on <code>stream</code>, upstream |
| processing will block until there is space in the queue between |
| the streams. |
| </P><P> |
| Processing of tuples occurs in the order they were received. |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - Stream to be isolated from downstream processing.</dd> |
| <dd><code>queueCapacity</code> - size of the queue between <code>stream</code> and |
| the returned stream.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>Stream that is isolated from <code>stream</code>.</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#pressureReliever-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-int-"><code>pressureReliever</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="concurrentMap-org.apache.edgent.topology.TStream-java.util.List-org.apache.edgent.function.Function-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>concurrentMap</h4> |
| <pre>public static <T,U,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R> concurrentMap(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><T,U>> mappers, |
| <a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><U>,R> combiner)</pre> |
| <div class="block">Perform analytics concurrently. |
| <P> |
| This is a convenience function that calls |
| <a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#concurrent-org.apache.edgent.topology.TStream-java.util.List-org.apache.edgent.function.Function-"><code>concurrent(TStream, List, Function)</code></a> after |
| creating <code>pipeline</code> and <code>combiner</code> functions |
| from the supplied <code>mappers</code> and <code>combiner</code> arguments. |
| </P><P> |
| That is, it is logically, if not exactly, the same as: |
| </P> |
| <pre><code> |
| List<Function<TStream<T>,TStream<U>>> pipelines = new ArrayList<>(); |
| for (Function<T,U> mapper : mappers) |
| pipelines.add(s -> s.map(mapper)); |
| concurrent(stream, pipelines, combiner); |
| </code></pre></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type on input stream.</dd> |
| <dd><code>U</code> - Tuple type generated by mappers.</dd> |
| <dd><code>R</code> - Tuple type of the result.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - input stream</dd> |
| <dd><code>mappers</code> - functions to be run concurrently. Each mapper MUST |
| return a non-null result. |
| A runtime error will be generated if a null result |
| is returned.</dd> |
| <dd><code>combiner</code> - function to create a result tuple from the list of |
| results from <code>mappers</code>. |
| The input list order is 1:1 with the <code>mappers</code> list. |
| I.e., list entry [0] is the result from mappers[0], |
| list entry [1] is the result from mappers[1], etc.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>result stream</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="concurrent-org.apache.edgent.topology.TStream-java.util.List-org.apache.edgent.function.Function-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>concurrent</h4> |
| <pre>public static <T,U,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R> concurrent(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>,<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><U>>> pipelines, |
| <a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><U>,R> combiner)</pre> |
| <div class="block">Perform analytics concurrently. |
| <P> |
| Process input tuples one at at time, invoking the specified |
| analytics (<code>pipelines</code>) concurrently, combine the results, |
| and then process the next input tuple in the same manner. |
| </P><P> |
| Logically, instead of doing this: |
| </P> |
| <pre><code> |
| sensorReadings<T> -> A1 -> A2 -> A3 -> results<R> |
| </code></pre> |
| create a graph that's logically like this: |
| <pre><code> |
| - |
| |-> A1 ->| |
| sensorReadings<T> -> |-> A2 ->| -> results<R> |
| |-> A3 ->| |
| |
| </code></pre> |
| more specifically a graph like this: |
| <pre><code> |
| - |
| |-> isolate(1) -> pipeline1 -> | |
| stream -> |-> isolate(1) -> pipeline2 -> |-> barrier(10) -> combiner |
| |-> isolate(1) -> pipeline3 -> | |
| . . . |
| </code></pre> |
| <P> |
| The typical use case for this is when an application has a collection |
| of independent analytics to perform on each tuple and the analytics |
| are sufficiently long running such that performing them concurrently |
| is desired. |
| </P><P> |
| Note, this is in contrast to "parallel" stream processing, |
| which in Java8 Streams and other contexts means processing multiple |
| tuples in parallel, each on a replicated processing pipeline. |
| </P><P> |
| Threadsafety - one of the following must be true: |
| </P> |
| <ul> |
| <li>the tuples from <code>stream</code> are threadsafe</li> |
| <li>the <code>pipelines</code> do not modify the input tuples</li> |
| <li>the <code>pipelines</code> provide their own synchronization controls |
| to protect concurrent modifications of the input tuples</li> |
| </ul> |
| <P> |
| Logically, a thread is allocated for each of the <code>pipelines</code>. |
| The actual degree of concurrency may be <a href="../../../../../org/apache/edgent/topology/TopologyProvider.html" title="interface in org.apache.edgent.topology"><code>TopologyProvider</code></a> dependent. |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type on input stream.</dd> |
| <dd><code>U</code> - Tuple type generated by pipelines.</dd> |
| <dd><code>R</code> - Tuple type of the result.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - input stream</dd> |
| <dd><code>pipelines</code> - a list of functions to add a pipeline to the topology. |
| Each <code>pipeline.apply()</code> is called with <code>stream</code> |
| as the input, yielding the pipeline's result stream. |
| For each input tuple, a pipeline MUST create exactly one output tuple. |
| Tuple flow into the pipelines will cease if that requirement |
| is not met.</dd> |
| <dd><code>combiner</code> - function to create a result tuple from the list of |
| results from <code>pipelines</code>. |
| The input tuple list's order is 1:1 with the <code>pipelines</code> list. |
| I.e., list entry [0] is the result from pipelines[0], |
| list entry [1] is the result from pipelines[1], etc.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>result stream</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#barrier-java.util.List-int-"><code>barrier</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="barrier-java.util.List-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>barrier</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><T>> barrier(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>> streams)</pre> |
| <div class="block">A tuple synchronization barrier. |
| <P> |
| Same as <code>barrier(others, 1)</code> |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>streams</code> - input streams</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the output stream</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#barrier-java.util.List-int-"><code>barrier(List, int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="barrier-java.util.List-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>barrier</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><T>> barrier(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>> streams, |
| int queueCapacity)</pre> |
| <div class="block">A tuple synchronization barrier. |
| <P> |
| A barrier has n input streams with tuple type <code>T</code> |
| and one output stream with tuple type <code>List<T></code>. |
| Once the barrier receives one tuple on each of its input streams, |
| it generates an output tuple containing one tuple from each input stream. |
| It then waits until it has received another tuple from each input stream. |
| </P><P> |
| Input stream 0's tuple is in the output tuple's list[0], |
| stream 1's tuple in list[1], and so on. |
| </P><P> |
| The barrier's output stream is isolated from the input streams. |
| </P><P> |
| The barrier has a queue of size <code>queueCapacity</code> for each |
| input stream. When a tuple for an input stream is received it is |
| added to its queue. The stream will block if the queue is full. |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Type of the tuple.</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>streams</code> - the list of input streams</dd> |
| <dd><code>queueCapacity</code> - the size of each input stream's queue</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the output stream</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/oplet/plumbing/Barrier.html" title="class in org.apache.edgent.oplet.plumbing"><code>Barrier</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="parallelMap-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.ToIntFunction-org.apache.edgent.function.BiFunction-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parallelMap</h4> |
| <pre>public static <T,U> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><U> parallelMap(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int width, |
| <a href="../../../../../org/apache/edgent/function/ToIntFunction.html" title="interface in org.apache.edgent.function">ToIntFunction</a><T> splitter, |
| <a href="../../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a><T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>,U> mapper)</pre> |
| <div class="block">Perform an analytic function on tuples in parallel. |
| <P> |
| Same as <code>parallel(stream, width, splitter, (s,ch) -> s.map(t -> mapper.apply(t, ch))</code> |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Input stream tuple type</dd> |
| <dd><code>U</code> - Result stream tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - input stream</dd> |
| <dd><code>splitter</code> - the tuple channel allocation function</dd> |
| <dd><code>mapper</code> - analytic function</dd> |
| <dd><code>width</code> - number of channels</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the unordered result stream</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#roundRobinSplitter-int-"><code>roundRobinSplitter</code></a>, |
| <a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#concurrentMap-org.apache.edgent.topology.TStream-java.util.List-org.apache.edgent.function.Function-"><code>concurrentMap</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="parallel-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.ToIntFunction-org.apache.edgent.function.BiFunction-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parallel</h4> |
| <pre>public static <T,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R> parallel(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int width, |
| <a href="../../../../../org/apache/edgent/function/ToIntFunction.html" title="interface in org.apache.edgent.function">ToIntFunction</a><T> splitter, |
| <a href="../../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>,<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R>> pipeline)</pre> |
| <div class="block">Perform an analytic pipeline on tuples in parallel. |
| <P> |
| Splits <code>stream</code> into <code>width</code> parallel processing channels, |
| partitioning tuples among the channels using <code>splitter</code>. |
| Each channel runs a copy of <code>pipeline</code>. |
| The resulting stream is isolated from the upstream parallel channels. |
| </P><P> |
| The ordering of tuples in <code>stream</code> is not maintained in the |
| results from <code>parallel</code>. |
| </P><P> |
| <code>pipeline</code> is not required to yield a result for each input |
| tuple. |
| </P><P> |
| A common splitter function is a <a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#roundRobinSplitter-int-"><code>roundRobinSplitter</code></a>. |
| </P><P> |
| The generated graph looks like this: |
| </P> |
| <pre><code> |
| - |
| |-> isolate(10) -> pipeline-ch1 -> | |
| stream -> split(width,splitter) -> |-> isolate(10) -> pipeline-ch2 -> |-> union -> isolate(width) |
| |-> isolate(10) -> pipeline-ch3 -> | |
| . . . |
| </code></pre></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Input stream tuple type</dd> |
| <dd><code>R</code> - Result stream tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - the input stream</dd> |
| <dd><code>width</code> - number of parallel processing channels</dd> |
| <dd><code>splitter</code> - the tuple channel allocation function</dd> |
| <dd><code>pipeline</code> - the pipeline for each channel. |
| <code>pipeline.apply(inputStream,channel)</code> |
| is called to generate the pipeline for each channel.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the isolated unordered result from each parallel channel</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#roundRobinSplitter-int-"><code>roundRobinSplitter</code></a>, |
| <a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#concurrent-org.apache.edgent.topology.TStream-java.util.List-org.apache.edgent.function.Function-"><code>concurrent</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="parallelBalanced-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.BiFunction-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>parallelBalanced</h4> |
| <pre>public static <T,R> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R> parallelBalanced(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| int width, |
| <a href="../../../../../org/apache/edgent/function/BiFunction.html" title="interface in org.apache.edgent.function">BiFunction</a><<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>,<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><R>> pipeline)</pre> |
| <div class="block">Perform an analytic pipeline on tuples in parallel. |
| <P> |
| Splits <code>stream</code> into <code>width</code> parallel processing channels, |
| partitioning tuples among the channels in a load balanced fashion. |
| Each channel runs a copy of <code>pipeline</code>. |
| The resulting stream is isolated from the upstream parallel channels. |
| </P><P> |
| The ordering of tuples in <code>stream</code> is not maintained in the |
| results from <code>parallel</code>. |
| </P><P> |
| A <code>pipeline</code> <b>MUST</b> yield a result for each input |
| tuple. Failure to do so will result in the channel remaining |
| in a busy state and no longer available to process additional tuples. |
| </P><P> |
| A <a href="../../../../../org/apache/edgent/topology/plumbing/LoadBalancedSplitter.html" title="class in org.apache.edgent.topology.plumbing"><code>LoadBalancedSplitter</code></a> is used to distribute tuples. |
| </P><P> |
| The generated graph looks like this: |
| </P> |
| <pre><code> |
| - |
| |-> isolate(1) -> pipeline-ch1 -> peek(splitter.channelDone()) -> | |
| stream -> split(width,splitter) -> |-> isolate(1) -> pipeline-ch2 -> peek(splitter.channelDone()) -> |-> union -> isolate(width) |
| |-> isolate(1) -> pipeline-ch3 -> peek(splitter.channelDone()) -> | |
| . . . |
| </code></pre> |
| <P> |
| Note, this implementation requires that the splitter is used from |
| only a single JVM. The <code>org.apache.edgent.providers.direct.DirectProvider</code> |
| provider meets this requirement. |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Input stream tuple type</dd> |
| <dd><code>R</code> - Result stream tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - the input stream</dd> |
| <dd><code>width</code> - number of parallel processing channels</dd> |
| <dd><code>pipeline</code> - the pipeline for each channel. |
| <code>pipeline.apply(inputStream,channel)</code> |
| is called to generate the pipeline for each channel.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the isolated unordered result from each parallel channel</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#parallel-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.ToIntFunction-org.apache.edgent.function.BiFunction-"><code>parallel(TStream, int, ToIntFunction, BiFunction)</code></a>, |
| <a href="../../../../../org/apache/edgent/topology/plumbing/LoadBalancedSplitter.html" title="class in org.apache.edgent.topology.plumbing"><code>LoadBalancedSplitter</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="roundRobinSplitter-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>roundRobinSplitter</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/function/ToIntFunction.html" title="interface in org.apache.edgent.function">ToIntFunction</a><T> roundRobinSplitter(int width)</pre> |
| <div class="block">A round-robin splitter ToIntFunction |
| <P> |
| The splitter function cycles among the <code>width</code> channels |
| on successive calls to <code>roundRobinSplitter.applyAsInt()</code>, |
| returning <code>0, 1, ..., width-1, 0, 1, ..., width-1</code>. |
| </P></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>width</code> - number of splitter channels</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the splitter</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/edgent/topology/TStream.html#split-int-org.apache.edgent.function.ToIntFunction-"><code>TStream.split</code></a>, |
| <a href="../../../../../org/apache/edgent/topology/plumbing/PlumbingStreams.html#parallel-org.apache.edgent.topology.TStream-int-org.apache.edgent.function.ToIntFunction-org.apache.edgent.function.BiFunction-"><code>parallel</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="gate-org.apache.edgent.topology.TStream-java.util.concurrent.Semaphore-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>gate</h4> |
| <pre>public static <T> <a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> gate(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a><T> stream, |
| <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Semaphore.html?is-external=true" title="class or interface in java.util.concurrent">Semaphore</a> semaphore)</pre> |
| <div class="block">Control the flow of tuples to an output stream. |
| <P> |
| A <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Semaphore.html?is-external=true" title="class or interface in java.util.concurrent"><code>Semaphore</code></a> is used to control the flow of tuples |
| through the <code>gate</code>. |
| The gate acquires a permit from the |
| semaphore to pass the tuple through, blocking until a permit is |
| acquired (and applying backpressure upstream while blocked). |
| Elsewhere, some code calls <a href="http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Semaphore.html?is-external=true#release-int-" title="class or interface in java.util.concurrent"><code>Semaphore.release(int)</code></a> |
| to make permits available. |
| </P><P> |
| If a TopologyProvider is used that can distribute a topology's |
| streams to different JVM's the gate and the code releasing the |
| permits must be in the same JVM. |
| </P><P> |
| Sample use: |
| <BR> |
| Suppose you wanted to control processing such that concurrent |
| pipelines processed each tuple in lock-step. |
| I.e., You want all of the pipelines to start processing a tuple |
| at the same time and not start a new tuple until the current |
| tuple had been fully processed by each of them: |
| </P> |
| <pre><code> |
| TStream<Integer> readings = ...; |
| Semaphore gateControl = new Semaphore(1); // allow the first to pass through |
| TStream<Integer> gated = PlumbingStreams.gate(readings, gateControl); |
| |
| // Create the concurrent pipeline combiner and have it |
| // signal that concurrent processing of the tuple has completed. |
| // In this sample the combiner just returns the received list of |
| // each pipeline result. |
| |
| Function<TStream<List<Integer>>,TStream<List<Integer>>> combiner = |
| stream -> stream.map(list -> { |
| gateControl.release(); |
| return list; |
| }); |
| |
| TStream<List<Integer>> results = PlumbingStreams.concurrent(gated, pipelines, combiner); |
| </code></pre></div> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - Tuple type</dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>stream</code> - the input stream</dd> |
| <dd><code>semaphore</code> - gate control</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>gated stream</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> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <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="class-use/PlumbingStreams.html">Use</a></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/edgent/topology/plumbing/LoadBalancedSplitter.html" title="class in org.apache.edgent.topology.plumbing"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/edgent/topology/plumbing/Valve.html" title="class in org.apache.edgent.topology.plumbing"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/edgent/topology/plumbing/PlumbingStreams.html" target="_top">Frames</a></li> |
| <li><a href="PlumbingStreams.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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2016–2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |