Class GeneralTopologyContext

  • All Implemented Interfaces:
    org.json.simple.JSONAware
    Direct Known Subclasses:
    WorkerTopologyContext

    public class GeneralTopologyContext
    extends Object
    implements org.json.simple.JSONAware
    • Method Detail

      • getStormId

        public String getStormId()
        Gets the unique id assigned to this topology. The id is the storm name with a unique nonce appended to it.
        Returns:
        the storm id
      • getRawTopology

        public StormTopology getRawTopology()
        Gets the Thrift object representing the topology.
        Returns:
        the Thrift definition representing the topology
      • getComponentId

        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.
        Parameters:
        taskId - the task id
        Returns:
        the component id for the input task id
      • getComponentStreams

        public Set<String> getComponentStreams​(String componentId)
        Gets the set of streams declared for the specified component.
      • getComponentTasks

        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.
      • getComponentOutputFields

        public Fields getComponentOutputFields​(String componentId,
                                               String streamId)
        Gets the declared output fields for the specified component/stream.
      • toJSONString

        public String toJSONString()
        Gets information about who is consuming the outputs of the specified component, and how.
        Specified by:
        toJSONString in interface org.json.simple.JSONAware
        Returns:
        Map from stream id to component id to the Grouping used.
      • getTaskToComponent

        public Map<Integer,​String> getTaskToComponent()
        Gets a map from task id to component id.
      • getComponentIds

        public Set<String> getComponentIds()
        Gets a list of all component ids in this topology