MapReduce的源码分析之Cli客户端源码讲解

MapReduce的源码分析之

Cli 客户端源码分析:

        客户端cli干了什么事情?

                 加载配置文件> 执行自定义参数的job任务(框架有很多默认参数)> submit提交任务>

计算文件的split切片个数 [maps的个数、输入类型、输入大小]  >  清单信息[block位置信息、block的index、split的大小]  >...>...       

MapReduce的源码分析之Cli客户端源码讲解

MapReduce的源码分析之Cli客户端源码讲解


 MapReduce的源码分析之Cli客户端源码讲解


MapReduce的源码分析之Cli客户端源码讲解

job到configuration中取相关默认配置。

还可以看到其map和reduce的默认的内存配置大小及参数:

MapReduce的源码分析之Cli客户端源码讲解


MapReduce的源码分析之Cli客户端源码讲解

------------------------------------

看看客户端干了什么事情:

MapReduce的源码分析之Cli客户端源码讲解

-------------------------------------

 Job任务提交:

MapReduce的源码分析之Cli客户端源码讲解

客户端提交作业时会计算切片【有了它才能支撑分布式计算】

MapReduce的源码分析之Cli客户端源码讲解

MapReduce的源码分析之Cli客户端源码讲解MapReduce的源码分析之Cli客户端源码讲解


MapReduce的源码分析之Cli客户端源码讲解

MapReduce的源码分析之Cli客户端源码讲解


MapReduce的源码分析之Cli客户端源码讲解


MapReduce的源码分析之Cli客户端源码讲解

都在父类中:

MapReduce的源码分析之Cli客户端源码讲解 

可以看见之前的配置

MapReduce的源码分析之Cli客户端源码讲解 

MapReduce的源码分析之Cli客户端源码讲解

 所以我们可以在job中自定义,如:

MapReduce的源码分析之Cli客户端源码讲解

如果我们客户没有定义InputFormatClass,那么就读取其默认的TextInputFormat.class

MapReduce的源码分析之Cli客户端源码讲解


MapReduce的源码分析之Cli客户端源码讲解

------------------------------继续

MapReduce的源码分析之Cli客户端源码讲解


MapReduce的源码分析之Cli客户端源码讲解


 MapReduce的源码分析之Cli客户端源码讲解


所以我们也可以设置输入的最小或最大值:

MapReduce的源码分析之Cli客户端源码讲解

 

继续往下 获取block的位置信息 blocklocations,block的index ,切片split的大小...对应的方法可以进去查看

MapReduce的源码分析之Cli客户端源码讲解

到此,客户端知道了文件清单 切片 等等......

转载请注明出处: http://blog.csdn.net/jackie_zhf/article/details/79493432

欢迎━(*`∀´*)ノ亻!交流学习,一起进步!

---- Jackie.Zhou