public static Set < Integer > worker_output_tasks ( WorkerData workerData ) { ContextMaker context_maker = workerData . getContextMaker ( ) ; Set < Integer > taskIds = workerData . getTaskIds ( ) ; StormTopology topology = workerData . getSysTopology ( ) ; Set < Integer > rtn = new HashSet <> ( ) ; for ( Integer taskId : taskIds ) { TopologyContext context = context_maker . makeTopologyContext ( topology , taskId , null ) ; // <StreamId, <ComponentId, Grouping>> Map < String , Map < String , Grouping > > targets = context . getThisTargets ( ) ; for ( Map < String , Grouping > e : targets . values ( ) ) { for ( String componentId : e . keySet ( ) ) { List < Integer > tasks = context . getComponentTasks ( componentId ) ; rtn . addAll ( tasks ) ; } } } return rtn ; }
get current task s output task list