OutputFormat数据输出
OutputFormat概述
OutputFormat是MapReduce输出的基类,所有实现MapReduce输出都实现了OutputFormat接口。
在MR中默认的使用的OutputFormat子类是TextOutputFormat。
源码分析
打开IDEA,双击两下Shift键搜索OutputFormat查看源码,然后将光标防放在OutputFormat类名上按Ctrl + H查看层次结构。

Input ---> InputFormat --->Mapper--->Shuffle--->Reducer--->OutputFormat--->Output
Map阶段---->Reduce阶段
Map阶段 ---> Shuffle(Map后半段+Reduce前半段)--->Reduce阶段
MapTask:map ---> sort
1 | mapPhase = getProgress().addPhase("map", 0.667f); |
ReduceTask : copy ---> sort ---> reduce
1 | copyPhase = getProgress().addPhase("copy"); |
Hadoop的运行模式包括:本地模式、伪分布式以及完全分布式