@InterfaceStability.Unstable public class StreamBuilder extends Object
A builder for constructing a StormTopology
via storm streams api (DSL).
Constructor and Description |
---|
StreamBuilder()
Creates a new
StreamBuilder . |
Modifier and Type | Method and Description |
---|---|
StormTopology |
build()
Builds a new
StormTopology for the computation expressed via the stream api. |
Stream<Tuple> |
newStream(IRichSpout spout)
Creates a new
Stream of tuples from the given IRichSpout . |
Stream<Tuple> |
newStream(IRichSpout spout,
int parallelism)
Creates a new
Stream of tuples from the given IRichSpout with the given parallelism. |
<K,V> PairStream<K,V> |
newStream(IRichSpout spout,
PairValueMapper<K,V> pairValueMapper)
Creates a new
PairStream of key-value pairs from the given IRichSpout by extracting key and value from tuples via the supplied PairValueMapper . |
<K,V> PairStream<K,V> |
newStream(IRichSpout spout,
PairValueMapper<K,V> pairValueMapper,
int parallelism)
Creates a new
PairStream of key-value pairs from the given IRichSpout by extracting key and value from tuples via the supplied PairValueMapper and with the given value of parallelism. |
<T> Stream<T> |
newStream(IRichSpout spout,
TupleValueMapper<T> valueMapper)
Creates a new
Stream of values from the given IRichSpout by extracting field(s) from tuples via the supplied TupleValueMapper . |
<T> Stream<T> |
newStream(IRichSpout spout,
TupleValueMapper<T> valueMapper,
int parallelism)
Creates a new
Stream of values from the given IRichSpout by extracting field(s) from tuples via the supplied TupleValueMapper with the given parallelism. |
public StreamBuilder()
Creates a new StreamBuilder
.
public Stream<Tuple> newStream(IRichSpout spout)
Creates a new Stream
of tuples from the given IRichSpout
.
spout
- the spoutpublic Stream<Tuple> newStream(IRichSpout spout, int parallelism)
Creates a new Stream
of tuples from the given IRichSpout
with the given parallelism.
spout
- the spoutparallelism
- the parallelism of the streampublic <T> Stream<T> newStream(IRichSpout spout, TupleValueMapper<T> valueMapper)
Creates a new Stream
of values from the given IRichSpout
by extracting field(s) from tuples via the supplied TupleValueMapper
.
spout
- the spoutvalueMapper
- the value mapperT
- the type of values in the resultant streampublic <T> Stream<T> newStream(IRichSpout spout, TupleValueMapper<T> valueMapper, int parallelism)
Creates a new Stream
of values from the given IRichSpout
by extracting field(s) from tuples via the supplied TupleValueMapper
with the given parallelism.
spout
- the spoutvalueMapper
- the value mapperparallelism
- the parallelism of the streamT
- the type of values in the resultant streampublic <K,V> PairStream<K,V> newStream(IRichSpout spout, PairValueMapper<K,V> pairValueMapper)
Creates a new PairStream
of key-value pairs from the given IRichSpout
by extracting key and value from tuples via the supplied PairValueMapper
.
spout
- the spoutpairValueMapper
- the pair value mapperK
- the key typeV
- the value typepublic <K,V> PairStream<K,V> newStream(IRichSpout spout, PairValueMapper<K,V> pairValueMapper, int parallelism)
Creates a new PairStream
of key-value pairs from the given IRichSpout
by extracting key and value from tuples via the supplied PairValueMapper
and with the given value of parallelism.
spout
- the spoutpairValueMapper
- the pair value mapperparallelism
- the parallelism of the streamK
- the key typeV
- the value typepublic StormTopology build()
Builds a new StormTopology
for the computation expressed via the stream api.
Copyright © 2022 The Apache Software Foundation. All rights reserved.