先上类图:
=====================================================================================
JobContext: A read-only view of the job that is provided to the tasks while they are running.
JobContext它提供只读属性,它含有两个成员JobConf以及JobID。它提供的只读属性除了jobId保存在JobID中以外,所有的属性都是从jobConf中读取,包括以下属性:
1.mapred.reduce.tasks,默认值为1
2.mapred.working.dir,文件系统的工作目录
3.mapred.job.name,用户设置的job 的名字
4.mapreduce.map.class
5.mapreduce.inputformat.class
6.mapreduce.combine.class
7.mapreduce.reduce.class
8.mapreduce.outputformat.class
9.mapreduce.partitioner.class
=====================================================================================
TaskAttemptContext:The context for task attempts.
它继承自JobContext,并实现了Progressable接口,它比JobContext多了一个成员TaskAttemptID和status,对Progressable的实现是空实现。
=====================================================================================
Job:The job submitter's view of the Job. It allows the user to configure thejob, submit it, control its execution, and query the state. The set methodsonly work until the job is submitted, afterwards they will throw an IllegalStateException.它可以对job进行配置,提交,控制其执行,查询状态。
它有两个成员:JobClient和RunningJob
=====================================================================================