public Set < Integer > getUnstoppedSlots ( Set < Integer > aliveTasks , Map < String , SupervisorInfo > supInfos , Assignment existAssignment ) { Set < Integer > ret = new HashSet <> ( ) ; Set < ResourceWorkerSlot > oldWorkers = existAssignment . getWorkers ( ) ; Set < String > aliveSupervisors = supInfos . keySet ( ) ; for ( ResourceWorkerSlot worker : oldWorkers ) { for ( Integer taskId : worker . getTasks ( ) ) { if ( ! aliveTasks . contains ( taskId ) ) { // task is dead continue ; } String oldTaskSupervisorId = worker . getNodeId ( ) ; if ( ! aliveSupervisors . contains ( oldTaskSupervisorId ) ) { // supervisor is dead ret . add ( taskId ) ; } } } return ret ; }
Get unstopped slots from alive task list