|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object backtype.storm.task.GeneralTopologyContext
public class GeneralTopologyContext
A TopologyContext is given to bolts and spouts in their "prepare" and "open" methods, respectively. This object provides information about the component's place within the topology, such as task ids, inputs and outputs, etc.
The TopologyContext is also used to declare ISubscribedState objects to synchronize state with StateSpouts this object is subscribed to.
Field Summary | |
---|---|
protected java.util.Map |
_stormConf
|
Constructor Summary | |
---|---|
GeneralTopologyContext(StormTopology topology,
java.util.Map stormConf,
java.util.Map<java.lang.Integer,java.lang.String> taskToComponent,
java.lang.String stormId)
|
Method Summary | |
---|---|
ComponentCommon |
getComponentCommon(java.lang.String componentId)
|
java.lang.String |
getComponentId(int taskId)
Gets the component id for the specified task id. |
java.util.Set<java.lang.String> |
getComponentIds()
Gets a list of all component ids in this topology |
Fields |
getComponentOutputFields(GlobalStreamId id)
Gets the declared output fields for the specified global stream id. |
Fields |
getComponentOutputFields(java.lang.String componentId,
java.lang.String streamId)
Gets the declared output fields for the specified component/stream. |
java.util.Set<java.lang.String> |
getComponentStreams(java.lang.String componentId)
Gets the set of streams declared for the specified component. |
java.util.List<java.lang.Integer> |
getComponentTasks(java.lang.String componentId)
Gets the task ids allocated for the given component id. |
StormTopology |
getRawTopology()
Gets the Thrift object representing the topology. |
java.util.Map<GlobalStreamId,Grouping> |
getSources(java.lang.String componentId)
Gets the declared inputs to the specified component. |
java.lang.String |
getStormId()
Gets the unique id assigned to this topology. |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Grouping>> |
getTargets(java.lang.String componentId)
Gets information about who is consuming the outputs of the specified component, and how. |
java.util.Map<java.lang.Integer,java.lang.String> |
getTaskToComponent()
Gets a map from task id to component id. |
int |
maxTopologyMessageTimeout()
|
java.lang.String |
toJSONString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map _stormConf
Constructor Detail |
---|
public GeneralTopologyContext(StormTopology topology, java.util.Map stormConf, java.util.Map<java.lang.Integer,java.lang.String> taskToComponent, java.lang.String stormId)
Method Detail |
---|
public java.lang.String getStormId()
public StormTopology getRawTopology()
public java.lang.String getComponentId(int taskId)
taskId
- the task id
public java.util.Set<java.lang.String> getComponentStreams(java.lang.String componentId)
public java.util.List<java.lang.Integer> getComponentTasks(java.lang.String componentId)
public Fields getComponentOutputFields(java.lang.String componentId, java.lang.String streamId)
public Fields getComponentOutputFields(GlobalStreamId id)
public java.util.Map<GlobalStreamId,Grouping> getSources(java.lang.String componentId)
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,Grouping>> getTargets(java.lang.String componentId)
public java.lang.String toJSONString()
public java.util.Map<java.lang.Integer,java.lang.String> getTaskToComponent()
public java.util.Set<java.lang.String> getComponentIds()
public ComponentCommon getComponentCommon(java.lang.String componentId)
public int maxTopologyMessageTimeout()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |