Package org.apache.storm.topology.base
Class BaseStatefulBolt<T extends State>
- java.lang.Object
-
- org.apache.storm.topology.base.BaseStatefulBolt<T>
-
- All Implemented Interfaces:
Serializable,IComponent,IStatefulBolt<T>,IStatefulComponent<T>
- Direct Known Subclasses:
StatefulWordCounter
public abstract class BaseStatefulBolt<T extends State> extends Object implements IStatefulBolt<T>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BaseStatefulBolt()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Analogue to bolt function.voiddeclareOutputFields(OutputFieldsDeclarer declarer)Declare the output schema for all the streams of this topology.Map<String,Object>getComponentConfiguration()Declare configuration specific to this component.voidpreCommit(long txid)This is a hook for the component to perform some actions just before the framework commits its state.voidprepare(Map<String,Object> topoConf, TopologyContext context, OutputCollector collector)Analogue to bolt function.voidprePrepare(long txid)This is a hook for the component to perform some actions just before the framework prepares its state.voidpreRollback()This is a hook for the component to perform some actions just before the framework rolls back the prepared state.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.storm.topology.IStatefulBolt
execute
-
Methods inherited from interface org.apache.storm.topology.IStatefulComponent
initState
-
-
-
-
Method Detail
-
prepare
public void prepare(Map<String,Object> topoConf, TopologyContext context, OutputCollector collector)
Description copied from interface:IStatefulBoltAnalogue to bolt function.- Specified by:
preparein interfaceIStatefulBolt<T extends State>- See Also:
IBolt.prepare(Map, TopologyContext, OutputCollector)
-
cleanup
public void cleanup()
Description copied from interface:IStatefulBoltAnalogue to bolt function.- Specified by:
cleanupin interfaceIStatefulBolt<T extends State>- See Also:
IBolt.cleanup()
-
declareOutputFields
public void declareOutputFields(OutputFieldsDeclarer declarer)
Description copied from interface:IComponentDeclare the output schema for all the streams of this topology.- Specified by:
declareOutputFieldsin interfaceIComponent- Parameters:
declarer- this is used to declare output stream ids, output fields, and whether or not each output stream is a direct stream
-
getComponentConfiguration
public Map<String,Object> getComponentConfiguration()
Description copied from interface:IComponentDeclare configuration specific to this component. Only a subset of the "topology.*" configs can be overridden. The component configuration can be further overridden when constructing the topology usingTopologyBuilder- Specified by:
getComponentConfigurationin interfaceIComponent
-
preCommit
public void preCommit(long txid)
Description copied from interface:IStatefulComponentThis is a hook for the component to perform some actions just before the framework commits its state.- Specified by:
preCommitin interfaceIStatefulComponent<T extends State>
-
prePrepare
public void prePrepare(long txid)
Description copied from interface:IStatefulComponentThis is a hook for the component to perform some actions just before the framework prepares its state.- Specified by:
prePreparein interfaceIStatefulComponent<T extends State>
-
preRollback
public void preRollback()
Description copied from interface:IStatefulComponentThis is a hook for the component to perform some actions just before the framework rolls back the prepared state.- Specified by:
preRollbackin interfaceIStatefulComponent<T extends State>
-
-