《Hadoop The Definitive Guide》ch07 MapReduce Types and Formats

来源:互联网 发布:js去掉字符串最后几个 编辑:程序博客网 时间:2024/06/11 21:40

MapReduce的数据模型非常简单,它的Map和Reduce函数使用键值对进行输入和输出。本章将深入讨论MapReduce的数据模型,尤其是文本或者二进制类型的数据如何在MapReduce中使用。

1. MapReduce的类型

map和reduce函数遵循以下的形式:

map: (K1, V1) -> list(K2, V2)

reduce: (K2, list(V2)) -> list(K3, V3)

In general, the map input key and value types (K1 and V1) are different from the map output types (K2 and V2). However, the reduce input must have the same types as the
map output, although the reduce output types may be different again (K3 and V3).

2. 输入格式

Text Input 
Binary Input 
Multiple Inputs 
Database Input

3. 输出格式

Text Output 
Binary Output 
Multiple Outputs 
Lazy Output 
Database Output

原创粉丝点击