Execution Flow
- The user submits an application using spark-submit.
- spark-submit launches the driver program and invokes the main() method
specified by the user.
- The driver program contacts the cluster manager to ask for resources to launch
executors.
- The cluster manager launches executors on behalf of the driver program.
- The driver process runs through the user application. Based on the RDD actions
and transformations in the program, the driver sends work to executors in the
form of tasks.
- Tasks are run on executor processes to compute and save results.
- If the driver’s main() method exits or it calls SparkContext.stop(), it will terminate
the executors and release resources from the cluster manager.
