what is the basic difference between jobconf and job?

元气小坏坏 提交于 2019-12-18 14:15:23

问题


hi i wanted to know the basic difference between jobconf and job objects,currently i am submitting my job like this

JobClient.runJob(jobconf);

i saw other way of submitting jobs like this

Configuration conf = getConf();
Job job = new Job(conf, "secondary sort");
job.waitForCompletion(true);     
return 0;

and how can i specify the sortcomparator class for the job using jobconf?

can any one explain me this concept?


回答1:


In short: JobConf and everything else in the org.apache.hadoop.mapred package is part of the old API used to write hadoop jobs, Job and everything in the org.apache.hadoop.mapreduce package is part of the new and preferred API to write hadoop jobs. Both APIs generally provide equivalent core functionality.

If you're new to hadoop just start using the new API (i.e. Job and Configuration instead of JobConf). Make sure to not import anything from the mapred package. When you find examples on the internet using the old API you can use this presentation or this guide to translate it to the new API.




回答2:


In old API job configuration is done by JobConf object. In the new API, job configuration is done through a Configuration object.

Job control is performed through the Job class in the new API, rather than the old JobClient, which no longer exists in the new API.



来源:https://stackoverflow.com/questions/18402360/what-is-the-basic-difference-between-jobconf-and-job

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!