public class LightComponent extends Object
Watch out this is also the parent class for LightBoltDispatcher
.
Modifier and Type | Field and Description |
---|---|
protected String |
componentId |
protected Map<String,org.apache.storm.tuple.Fields> |
streamDeclaration |
protected Map<String,List<LightBoltDispatcher>> |
subscribersPerStreamId |
protected org.apache.storm.task.TopologyContext |
topologyContext |
Constructor and Description |
---|
LightComponent(LightTopology topology,
String componentId,
org.apache.storm.task.TopologyContext topologyContext) |
Modifier and Type | Method and Description |
---|---|
void |
addSubscriber(LightBoltDispatcher lightBoltDispatcher,
String streamId)
A bolt dispatcher comes in to subscribe to tuples from a given stream
|
void |
declareStream(String streamId,
org.apache.storm.tuple.Fields fields)
Make this component publish some fields over a stream
|
String |
getComponentId() |
org.apache.storm.task.TopologyContext |
getTopologyContext()
The associated topology context is actually per component, as it provides
per component informations such as the component identifier.
|
boolean |
publishStream(String streamId) |
protected org.apache.storm.task.TopologyContext topologyContext
protected Map<String,List<LightBoltDispatcher>> subscribersPerStreamId
protected String componentId
public LightComponent(LightTopology topology, String componentId, org.apache.storm.task.TopologyContext topologyContext)
public org.apache.storm.task.TopologyContext getTopologyContext()
public String getComponentId()
public void addSubscriber(LightBoltDispatcher lightBoltDispatcher, String streamId)
lightBoltDispatcher
- the subscriber boltstreamId
- the corresponding stream identifierpublic boolean publishStream(String streamId)
streamId
- a stream identifierpublic void declareStream(String streamId, org.apache.storm.tuple.Fields fields)
streamId
- the stream identifierfields
- the corresponding fieldsCopyright © 2023. All rights reserved.