public Task removeTask ( ExecutionAttemptID executionAttemptID ) { checkInit ( ) ; TaskSlotMapping taskSlotMapping = taskSlotMappings . remove ( executionAttemptID ) ; if ( taskSlotMapping != null ) { Task task = taskSlotMapping . getTask ( ) ; TaskSlot taskSlot = taskSlotMapping . getTaskSlot ( ) ; taskSlot . remove ( task . getExecutionId ( ) ) ; if ( taskSlot . isReleasing ( ) && taskSlot . isEmpty ( ) ) { slotActions . freeSlot ( taskSlot . getAllocationId ( ) ) ; } return task ; } else { return null ; } }
Remove the task with the given execution attempt id from its task slot . If the owning task slot is in state releasing and empty after removing the task the slot is freed via the slot actions .