G- Type of the
T- Type of data on the stream.
The functional primitives are:
|Modifier||Constructor and Description|
|Modifier and Type||Method and Description|
Convert this stream to a stream of
Declare a new stream that modifies each tuple from this stream into one (or zero) tuple of the same type
Utility method to print the contents of this stream to
Sink (terminate) this stream using a function.
Topology this element is contained in.
Declare a stream that will contain all tuples from this stream and
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected AbstractTStream(G topology)
public G topology()
public TStream<T> modify(UnaryOperator<T> modifier)
T. For each tuple
ton this stream, the returned stream will contain a tuple that is the result of
modifier.apply(t)when the return is not
null. The function may return the same reference as its input
tor a different object of the same type. If
nullthen no tuple is submitted to the returned stream for
Example of modifying a stream
String values by adding the suffix '
TStream<String> strings = ... TStream<String> modifiedStrings = strings.modify(t -> t.concat("extra"));
This method is equivalent to
Stringtuples by calling
toString()on each tuple. This is equivalent to
System.outat runtime. Each tuple is printed using
other. A stream cannot be unioned with itself, in this case
thiswill be returned.
ton this stream
sinker.accept(t)will be called. This is typically used to send information to external systems, such as databases or dashboards.
method will be called when the topology's execution is terminated.
Example of terminating a stream of
String tuples by printing them
TStream<String> values = ... values.sink(t -> System.out.println(tuple));
Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.