Reducer 的核心方法有哪些?分别做什么?
What are the core methods of a reducer?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: hard
分类: MapReduce, Reducer 原理
标签: reducer, setup, reduce, cleanup, distributed-cache
参考答案摘要
TL;DR Reducer 的三个核心方法是: setup() 、 reduce() 、 cleanup() 。 1) setup() 用于配置参数,如输入数据大小、distributed cache 等 定义: public void setup(context) 2) reduce() Reducer 的核心逻辑:每个 key 调用一次,并处理对应的 values 定义: public voi...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。