public class BoltWrapper<IN,OUT> extends AbstractStreamOperator<OUT> implements OneInputStreamOperator<IN,OUT>
BoltWrapper wraps an IRichBolt in order to execute the Storm bolt within a Flink Streaming program.
It takes the Flink input tuples of type IN and transforms them into StormTuples that the bolt can
process. Furthermore, it takes the bolt's output tuples and transforms them into Flink tuples of type OUT
(see AbstractStormCollector for supported types).MergedInputsBoltWrapper for multi-input stream
Bolts.| Modifier and Type | Field and Description |
|---|---|
protected backtype.storm.topology.IRichBolt |
bolt
The wrapped Storm
bolt. |
static String |
DEFAULT_ID
The default input component ID.
|
static String |
DEFUALT_BOLT_NAME
The default bolt ID.
|
protected TimestampedCollector<OUT> |
flinkCollector
We have to use this because Operators must output
StreamRecord. |
chainingStrategy, LOG, output| Constructor and Description |
|---|
BoltWrapper(backtype.storm.topology.IRichBolt bolt)
Instantiates a new
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. |
BoltWrapper(backtype.storm.topology.IRichBolt bolt,
Collection<String> rawOutputs)
Instantiates a new
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. |
BoltWrapper(backtype.storm.topology.IRichBolt bolt,
backtype.storm.tuple.Fields inputSchema)
Instantiates a new
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. |
BoltWrapper(backtype.storm.topology.IRichBolt bolt,
backtype.storm.tuple.Fields inputSchema,
Collection<String> rawOutputs)
Instantiates a new
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. |
BoltWrapper(backtype.storm.topology.IRichBolt bolt,
backtype.storm.tuple.Fields inputSchema,
String[] rawOutputs)
Instantiates a new
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. |
BoltWrapper(backtype.storm.topology.IRichBolt bolt,
String[] rawOutputs)
Instantiates a new
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. |
BoltWrapper(backtype.storm.topology.IRichBolt bolt,
String name,
String inputStreamId,
String inputComponentId,
backtype.storm.tuple.Fields inputSchema,
Collection<String> rawOutputs)
Instantiates a new
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
void |
open() |
void |
processElement(StreamRecord<IN> element) |
void |
processWatermark(Watermark mark) |
void |
setStormTopology(backtype.storm.generated.StormTopology stormTopology)
Sets the original Storm topology.
|
close, disableInputCopy, getChainingStrategy, getContainingTask, getExecutionConfig, getOperatorConfig, getPartitionedState, getPartitionedState, getRuntimeContext, getStateBackend, getUserCodeClassloader, isInputCopyingDisabled, notifyOfCompletedCheckpoint, registerTimer, restoreState, setChainingStrategy, setKeyContext, setKeyContextElement1, setKeyContextElement2, setup, snapshotOperatorStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getChainingStrategy, isInputCopyingDisabled, notifyOfCompletedCheckpoint, restoreState, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setup, snapshotOperatorStatepublic static final String DEFAULT_ID
public static final String DEFUALT_BOLT_NAME
protected final backtype.storm.topology.IRichBolt bolt
bolt.protected transient TimestampedCollector<OUT> flinkCollector
StreamRecord.public BoltWrapper(backtype.storm.topology.IRichBolt bolt)
throws IllegalArgumentException
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. As no input schema is defined, attribute-by-name access in only possible for
POJO input types. The output type will be one of Tuple0 to Tuple25 depending on the bolt's
declared number of attributes.bolt - The Storm bolt to be used.IllegalArgumentException - If the number of declared output attributes is not with range [0;25].public BoltWrapper(backtype.storm.topology.IRichBolt bolt,
backtype.storm.tuple.Fields inputSchema)
throws IllegalArgumentException
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. The given input schema enable attribute-by-name access for input types
Tuple0 to Tuple25. The output type will be one of Tuple0 to Tuple25 depending on
the bolt's declared number of attributes.bolt - The Storm bolt to be used.inputSchema - The schema (ie, ordered field names) of the input stream. @throws IllegalArgumentExceptionIllegalArgumentException - If the number of declared output attributes is not with range [0;25].public BoltWrapper(backtype.storm.topology.IRichBolt bolt,
String[] rawOutputs)
throws IllegalArgumentException
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. As no input schema is defined, attribute-by-name access in only possible for
POJO input types. The output type can be any type if parameter rawOutput is true and the bolt's
number of declared output tuples is 1. If rawOutput is false the output type will be one of
Tuple0 to Tuple25 depending on the bolt's declared number of attributes.bolt - The Storm bolt to be used.rawOutputs - Contains stream names if a single attribute output stream, should not be of type Tuple1 but be
of a raw type.IllegalArgumentException - If rawOuput is true and the number of declared output attributes is not 1 or if
rawOuput is false and the number of declared output attributes is not within range
[1;25].public BoltWrapper(backtype.storm.topology.IRichBolt bolt,
Collection<String> rawOutputs)
throws IllegalArgumentException
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. As no input schema is defined, attribute-by-name access in only possible for
POJO input types. The output type can be any type if parameter rawOutput is true and the bolt's
number of declared output tuples is 1. If rawOutput is false the output type will be one of
Tuple0 to Tuple25 depending on the bolt's declared number of attributes.bolt - The Storm bolt to be used.rawOutputs - Contains stream names if a single attribute output stream, should not be of type Tuple1 but be
of a raw type.IllegalArgumentException - If rawOuput is true and the number of declared output attributes is not 1 or if
rawOuput is false and the number of declared output attributes is not with range
[1;25].public BoltWrapper(backtype.storm.topology.IRichBolt bolt,
backtype.storm.tuple.Fields inputSchema,
String[] rawOutputs)
throws IllegalArgumentException
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. The given input schema enable attribute-by-name access for input types
Tuple0 to Tuple25. The output type can be any type if parameter rawOutput is true
and the bolt's number of declared output tuples is 1. If rawOutput is false the output type will
be one of Tuple0 to Tuple25 depending on the bolt's declared number of attributes.bolt - The Storm bolt to be used.inputSchema - The schema (ie, ordered field names) of the input stream.rawOutputs - Contains stream names if a single attribute output stream, should not be of type Tuple1 but be
of a raw type.IllegalArgumentException - If rawOuput is true and the number of declared output attributes is not 1 or if
rawOuput is false and the number of declared output attributes is not with range
[0;25].public BoltWrapper(backtype.storm.topology.IRichBolt bolt,
backtype.storm.tuple.Fields inputSchema,
Collection<String> rawOutputs)
throws IllegalArgumentException
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. The given input schema enable attribute-by-name access for input types
Tuple0 to Tuple25. The output type can be any type if parameter rawOutput is true
and the bolt's number of declared output tuples is 1. If rawOutput is false the output type will
be one of Tuple0 to Tuple25 depending on the bolt's declared number of attributes.bolt - The Storm bolt to be used.inputSchema - The schema (ie, ordered field names) of the input stream. @throws IllegalArgumentException If
rawOuput is true and the number of declared output attributes is not 1 or if
rawOuput is false and the number of declared output attributes is not with rangerawOutputs - Contains stream names if a single attribute output stream, should not be of type Tuple1 but be
of a raw type.IllegalArgumentException - If rawOuput is true and the number of declared output attributes is not 1 or if
rawOuput is false and the number of declared output attributes is not with range
[0;25].public BoltWrapper(backtype.storm.topology.IRichBolt bolt,
String name,
String inputStreamId,
String inputComponentId,
backtype.storm.tuple.Fields inputSchema,
Collection<String> rawOutputs)
throws IllegalArgumentException
BoltWrapper that wraps the given Storm bolt such that it can be used
within a Flink streaming program. The given input schema enable attribute-by-name access for input types
Tuple0 to Tuple25. The output type can be any type if parameter rawOutput is true
and the bolt's number of declared output tuples is 1. If rawOutput is false the output type will
be one of Tuple0 to Tuple25 depending on the bolt's declared number of attributes.bolt - The Storm bolt to be used.name - The name of the bolt.rawOutputs - Contains stream names if a single attribute output stream, should not be of type Tuple1 but be
of a raw type.IllegalArgumentException - If rawOuput is true and the number of declared output attributes is not 1 or if
rawOuput is false and the number of declared output attributes is not with range
[0;25].public void setStormTopology(backtype.storm.generated.StormTopology stormTopology)
stormTopology - The original Storm topology.public void open()
throws Exception
open in interface StreamOperator<OUT>open in class AbstractStreamOperator<OUT>Exceptionpublic void dispose()
dispose in interface StreamOperator<OUT>dispose in class AbstractStreamOperator<OUT>public void processElement(StreamRecord<IN> element) throws Exception
processElement in interface OneInputStreamOperator<IN,OUT>Exceptionpublic void processWatermark(Watermark mark) throws Exception
processWatermark in interface OneInputStreamOperator<IN,OUT>ExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.