Hi Chengxiang Li, my thoughts are
Task.execute() method is overridden by other classes and corresponding sub classes will be responsible for executing the work.
In spark task situation for executing spark job required resource loading and submission of job need to be done here by using spark client.
Spark client will be a wrapper class for providing the sparks functionality.
I have added one TODO for job monitoring in sprak task, here also we can use the class which provides functionality of the spark job monitoring and get the job status in spark task class itself.
Similar approach i have seen in ExecDriver.java and TezTask.java.