public static Map < String , String > getTopologyCodeLocations ( Map < String , Assignment > assignments , String supervisorId ) throws Exception { Map < String , String > rtn = new HashMap <> ( ) ; for ( Entry < String , Assignment > entry : assignments . entrySet ( ) ) { String topologyId = entry . getKey ( ) ; Assignment assignmentInfo = entry . getValue ( ) ; Set < ResourceWorkerSlot > workers = assignmentInfo . getWorkers ( ) ; for ( ResourceWorkerSlot worker : workers ) { String node = worker . getNodeId ( ) ; if ( supervisorId . equals ( node ) ) { rtn . put ( topologyId , assignmentInfo . getMasterCodeDir ( ) ) ; break ; } } } return rtn ; }
get master code dir for each topology