public class GeneralTopologyContext extends Object implements org.apache.storm.shade.org.json.simple.JSONAware
Modifier and Type | Field and Description |
---|---|
protected boolean |
doSanityCheck |
protected Map<String,Object> |
topoConf |
Constructor and Description |
---|
GeneralTopologyContext(StormTopology topology,
Map<String,Object> topoConf,
Map<Integer,String> taskToComponent,
Map<String,List<Integer>> componentToSortedTasks,
Map<String,Map<String,Fields>> componentToStreamToFields,
String stormId) |
Modifier and Type | Method and Description |
---|---|
boolean |
doSanityCheck() |
ComponentCommon |
getComponentCommon(String componentId) |
String |
getComponentId(int taskId)
Gets the component id for the specified task id.
|
Set<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(String componentId,
String streamId)
Gets the declared output fields for the specified component/stream.
|
Set<String> |
getComponentStreams(String componentId)
Gets the set of streams declared for the specified component.
|
List<Integer> |
getComponentTasks(String componentId)
Gets the task ids allocated for the given component id.
|
Map<String,Object> |
getConf() |
StormTopology |
getRawTopology()
Gets the Thrift object representing the topology.
|
Map<GlobalStreamId,Grouping> |
getSources(String componentId)
Gets the declared inputs to the specified component.
|
String |
getStormId()
Gets the unique id assigned to this topology.
|
Map<String,Map<String,Grouping>> |
getTargets(String componentId)
Gets information about who is consuming the outputs of the specified component, and how.
|
Map<Integer,String> |
getTaskToComponent()
Gets a map from task id to component id.
|
int |
maxTopologyMessageTimeout() |
String |
toJSONString() |
public String getStormId()
Gets the unique id assigned to this topology. The id is the storm name with a unique nonce appended to it.
public StormTopology getRawTopology()
Gets the Thrift object representing the topology.
public String getComponentId(int taskId)
Gets the component id for the specified task id. The component id maps to a component id specified for a Spout or Bolt in the topology definition.
taskId
- the task idpublic Set<String> getComponentStreams(String componentId)
Gets the set of streams declared for the specified component.
public List<Integer> getComponentTasks(String componentId)
Gets the task ids allocated for the given component id. The task ids are always returned in ascending order.
public Fields getComponentOutputFields(String componentId, String streamId)
Gets the declared output fields for the specified component/stream.
public Fields getComponentOutputFields(GlobalStreamId id)
Gets the declared output fields for the specified global stream id.
public Map<GlobalStreamId,Grouping> getSources(String componentId)
Gets the declared inputs to the specified component.
public Map<String,Map<String,Grouping>> getTargets(String componentId)
Gets information about who is consuming the outputs of the specified component, and how.
public String toJSONString()
toJSONString
in interface org.apache.storm.shade.org.json.simple.JSONAware
public Map<Integer,String> getTaskToComponent()
Gets a map from task id to component id.
public Set<String> getComponentIds()
Gets a list of all component ids in this topology.
public ComponentCommon getComponentCommon(String componentId)
public int maxTopologyMessageTimeout()
public boolean doSanityCheck()
Copyright © 2019 The Apache Software Foundation. All rights reserved.