This is because Task was an internal API that we might want to change, while TaskContext was a more external one that anyone subclassing RDD might use. Which fields of Task do you need to use in metrics?