Interface TopologyContext

    • Method Detail

      • getThisTaskId

        int getThisTaskId()
        Gets the task id of this task.
        Returns:
        the task id
      • getThisComponentId

        String getThisComponentId()
        Gets the component id for this task. The component id maps to a component id specified for a Spout or Bolt in the topology definition.
      • getThisOutputFields

        Fields getThisOutputFields​(String streamId)
        Gets the declared output fields for the specified stream id for the component this task is a part of.
      • getThisStreams

        Set<String> getThisStreams()
        Gets the set of streams declared for the component of this task.
      • getThisTaskIndex

        int getThisTaskIndex()
        Gets the index of this task id in getComponentTasks(getThisComponentId()). An example use case for this method is determining which task accesses which resource in a distributed resource to ensure an even distribution.
      • getThisSources

        Map<org.apache.heron.api.generated.TopologyAPI.StreamId,​org.apache.heron.api.generated.TopologyAPI.Grouping> getThisSources()
        Gets the declared inputs to this component.
        Returns:
        A map from subscribed component/stream to the grouping subscribed with.
      • getThisTargets

        Map<String,​Map<String,​org.apache.heron.api.generated.TopologyAPI.Grouping>> getThisTargets()
        Gets information about who is consuming the outputs of this component, and how.
        Returns:
        Map from stream id to component id to the Grouping used.
      • setTaskData

        void setTaskData​(String name,
                         Object data)
      • addTaskHook

        void addTaskHook​(ITaskHook hook)
        Add a Task Hook for this instance
      • registerMetric

        <T,​U,​V> ReducedMetric<T,​U,​V> registerMetric​(String name,
                                                                            IReducer<T,​U,​V> reducer,
                                                                            int timeBucketSizeInSecs)