有关Job类的setJarByClass方法的Hadoop查询 [英] Hadoop query regarding setJarByClass method of Job class

查看:1554
本文介绍了有关Job类的setJarByClass方法的Hadoop查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



 在Hadoop API文档中给出它 

setJarByClass

public void setJarByClass(Class <?> cls)

通过查找给定类来自哪里来设置Jar。

这个解释究竟是什么意思?它是否根据上面方法中指定的类文件参数创建了一个JAR文件?并为该MapReduce任务执行该jar文件?

解决方案

该方法设置每个节点将看起来的jar文件对于Mapper和Reducer类。

它不会从给定的类创建一个jar。相反,它标识包含给定类的jar。是的,该jar文件是执行(实际上该jar文件中的Mapper和Reducer被执行)用于MapReduce作业。



(另请参阅 Stanley Xu对类似问题的回答关于这种方法的必要性,命令行)


In the Hadoop API documentation it's given

that

setJarByClass 

public void setJarByClass(Class<?> cls)

Set the Jar by finding where a given class came from.

What exactly does this explanation mean? does it creates a JAR file from the class file argument specified in the method above? and does that jar file is executed for the MapReduce task.?

解决方案

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)

这篇关于有关Job类的setJarByClass方法的Hadoop查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆