presto-main/src/main/java/io/prestosql/operator/TaskContext.java/TaskContext/initialize
class TaskContext:    private void initialize()
    {
        taskStateMachine.addStateChangeListener(this::updateStatsIfDone);
    }