美文网首页hadoop
MapReduce架构师1- 机制和架构

MapReduce架构师1- 机制和架构

作者: fat32jin | 来源:发表于2020-08-15 16:12 被阅读0次

1 MR 架构概述 0:33:00 ~ 1:20:00

1采用职责链设计模式

数据源 InputFormat RecordReader 实现类 TextInputFormat LineRecordReader
一阶段 Mapper
二阶段 Partio ner Sorter Combiner
三阶段 reduce
输出 OutputFormat RecordWrtier

job 是核心

job.getinstance(conf)
job.setmapperClass(xxx)
job.setReduceClass(xxx)
job.setpartionerClass(xxx)

job.submit()

核心对象2: Context上下文对象

boolean result = context.nextkeyvalue()
inkey = context.getCurrentKey()
invalue = context.getCurrentValue()
( inkey,invalue) = ( outkey ,outvalue)

context.write(outkey , outvalue)

2个实现类 MapContext ReduceContext

内部 装饰模式

2 Mapper阶段 0:54:00 ~ 1:04:00

org.apache.hadoop.mapreduce.Mapper 类
map方法

3 整体流程 1:04:00 ~1:25:00

相关文章

网友评论

    本文标题:MapReduce架构师1- 机制和架构

    本文链接:https://www.haomeiwen.com/subject/yghadktx.html