【问题标题】:How to write a MapReduce Prog where the output of the Reducers goes to a single Reducer如何编写一个 MapReduce Prog,其中 Reducer 的输出到单个 Reducer
【发布时间】:2016-03-04 20:32:22
【问题描述】:

如何编写一个 MapReduce 程序,其中我的 Mappers 的输出到 Reducers,Reducers 的输出到另一个 Reducer,但在这种情况下,只有一个 Reducer,所以所有输出的键值对都会到同一个减速器。

【问题讨论】:

  • 您的问题不清楚。你想达到什么目标?映射器->减速器->减速器?这是你想要的吗?
  • yes....Mapper->Reducer->Reducer(reducer个数应该是1)
  • 如果没有第二个映射器(在新工作中),您无法在 MapReduce 中做到这一点

标签: hadoop mapreduce


【解决方案1】:

我认为您希望将多个减速器的输出直接输出到另一个减速器,这是不正确的。您将需要另一个 map reduce 作业,将 reducer 输出传递给 mapper 并使用单个 reducer 获取单个输出文件。

【讨论】:

  • 正确。使用另一个 reducer 需要 shuffle 和 sort 阶段,该阶段在 map 阶段结束时执行。
猜你喜欢
  • 1970-01-01
  • 2016-09-10
  • 2015-07-20
  • 1970-01-01
  • 1970-01-01
  • 2019-02-25
  • 2012-11-14
  • 2018-01-19
  • 1970-01-01
相关资源
最近更新 更多