presto-main/src/main/java/io/prestosql/server/GracefulShutdownHandler.java/GracefulShutdownHandler/getActiveTasks
class GracefulShutdownHandler:    private List<TaskInfo> getActiveTasks()
    {
        return sqlTaskManager.getAllTaskInfo()
                .stream()
                .filter(taskInfo -> !taskInfo.getTaskStatus().getState().isDone())
                .collect(toImmutableList());
    }