Hadoop query regarding setJarByClass method of Job class

前端 未结 3 1714
旧时难觅i
旧时难觅i 2021-01-03 20:33

In the Hadoop API documentation it\'s given

that

setJarByClass 

public void setJarByClass(Class cls)

Set the Jar by finding where a give         


        
3条回答
  •  梦谈多话
    2021-01-03 21:07

    This method sets the jar file in which each node will look for the Mapper and Reducer classes.

    It does not create a jar from the given class. Rather, it identifies the jar containing the given class. And yes, that jar file is "executed" (really the Mapper and Reducer in that jar file are executed) for the MapReduce job.

    (Also see Stanley Xu's answer to a similar question about the need for this method since you give the jar on the command line)

提交回复
热议问题