public abstract class AbstractJdbcBolt extends BaseTickTupleAwareRichBolt
| Modifier and Type | Field and Description |
|---|---|
protected OutputCollector |
collector |
protected String |
configKey |
protected ConnectionProvider |
connectionProvider |
protected JdbcClient |
jdbcClient |
protected Integer |
queryTimeoutSecs |
| Constructor and Description |
|---|
AbstractJdbcBolt(ConnectionProvider connectionProviderParam)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Cleanup.
|
void |
prepare(Map<String,Object> map,
TopologyContext topologyContext,
OutputCollector outputCollector)
Subclasses should call this to ensure output collector and connection
provider are set up, and finally jdbcClient is initialized properly.
|
execute, onTickTuple, processgetComponentConfigurationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdeclareOutputFields, getComponentConfigurationprotected OutputCollector collector
protected transient JdbcClient jdbcClient
protected String configKey
protected Integer queryTimeoutSecs
protected ConnectionProvider connectionProvider
public AbstractJdbcBolt(ConnectionProvider connectionProviderParam)
connectionProviderParam - database connection providerpublic void prepare(Map<String,Object> map, TopologyContext topologyContext, OutputCollector outputCollector)
This includes the:
map - The Storm configuration for this bolt. This is the configuration provided to the topology merged in with cluster
configuration on this machine.topologyContext - This object can be used to get information about this task's place within the topology, including the task id and
component id of this task, input and output information, etc.outputCollector - The collector is used to emit tuples from this bolt. Tuples can be emitted at any time, including the prepare and
cleanup methods. The collector is thread-safe and should be saved as an instance variable of this bolt object.public void cleanup()
cleanup in interface IBoltcleanup in class BaseRichBoltCopyright © 2023 The Apache Software Foundation. All rights reserved.