Package org.apache.storm.streams
Class StreamBuilder
java.lang.Object
org.apache.storm.streams.StreamBuilder
A builder for constructing a 
StormTopology via storm streams api (DSL).- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Builds a newStormTopologyfor the computation expressed via the stream api.newStream(IRichSpout spout) Creates a newStreamof tuples from the givenIRichSpout.newStream(IRichSpout spout, int parallelism) Creates a newStreamof tuples from the givenIRichSpoutwith the given parallelism.<K,V> PairStream<K, V> newStream(IRichSpout spout, PairValueMapper<K, V> pairValueMapper) Creates a newPairStreamof key-value pairs from the givenIRichSpoutby extracting key and value from tuples via the suppliedPairValueMapper.<K,V> PairStream<K, V> newStream(IRichSpout spout, PairValueMapper<K, V> pairValueMapper, int parallelism) Creates a newPairStreamof key-value pairs from the givenIRichSpoutby extracting key and value from tuples via the suppliedPairValueMapperand with the given value of parallelism.<T> Stream<T>newStream(IRichSpout spout, TupleValueMapper<T> valueMapper) Creates a newStreamof values from the givenIRichSpoutby extracting field(s) from tuples via the suppliedTupleValueMapper.<T> Stream<T>newStream(IRichSpout spout, TupleValueMapper<T> valueMapper, int parallelism) Creates a newStreamof values from the givenIRichSpoutby extracting field(s) from tuples via the suppliedTupleValueMapperwith the given parallelism.
- 
Constructor Details- 
StreamBuilderpublic StreamBuilder()Creates a newStreamBuilder.
 
- 
- 
Method Details- 
newStreamCreates a newStreamof tuples from the givenIRichSpout.- Parameters:
- spout- the spout
- Returns:
- the new stream
 
- 
newStreamCreates a newStreamof tuples from the givenIRichSpoutwith the given parallelism.- Parameters:
- spout- the spout
- parallelism- the parallelism of the stream
- Returns:
- the new stream
 
- 
newStreamCreates a newStreamof values from the givenIRichSpoutby extracting field(s) from tuples via the suppliedTupleValueMapper.- Parameters:
- spout- the spout
- valueMapper- the value mapper
- Returns:
- the new stream
 
- 
newStreamCreates a newStreamof values from the givenIRichSpoutby extracting field(s) from tuples via the suppliedTupleValueMapperwith the given parallelism.- Parameters:
- spout- the spout
- valueMapper- the value mapper
- parallelism- the parallelism of the stream
- Returns:
- the new stream
 
- 
newStreamCreates a newPairStreamof key-value pairs from the givenIRichSpoutby extracting key and value from tuples via the suppliedPairValueMapper.- Parameters:
- spout- the spout
- pairValueMapper- the pair value mapper
- Returns:
- the new stream of key-value pairs
 
- 
newStreampublic <K,V> PairStream<K,V> newStream(IRichSpout spout, PairValueMapper<K, V> pairValueMapper, int parallelism) Creates a newPairStreamof key-value pairs from the givenIRichSpoutby extracting key and value from tuples via the suppliedPairValueMapperand with the given value of parallelism.- Parameters:
- spout- the spout
- pairValueMapper- the pair value mapper
- parallelism- the parallelism of the stream
- Returns:
- the new stream of key-value pairs
 
- 
buildBuilds a newStormTopologyfor the computation expressed via the stream api.- Returns:
- the storm topology
 
 
-