The function generates a (possibly empty) list of (K2, V2) pairs for a given (K1, V1)
input pair. The OutputCollector receives the output of the mapping process, and
the Reporter provides the option to record extra information about the mapper as
the task progresses.
Hadoop provides a few useful mapper implementations. You can see some of them
in the table 3.2.
Table 3.2 Some useful Mapper implementations predefined by Hadoop
Class Description
IdentityMapper<K,V> Implements Mapper<K,V,K,V> and maps inputs directly to outputs
InverseMapper<K,V> Implements Mapper<K,V,V,K> and reverses the key/value pair
RegexMapper<K> Implements Mapper<K,Text,Text,LongWritable> and generates a
(match, 1) pair for every regular expression match
TokenCountMapper<K> Implements Mapper<K,Text,Text,LongWritable> and generates a
(token, 1) pair when the input value is tokenized
As the MapReduce name implies, the major data flow operation after map is the reduce
phase, shown in the bottom part of figure 3.1.
input pair. The OutputCollector receives the output of the mapping process, and
the Reporter provides the option to record extra information about the mapper as
the task progresses.
Hadoop provides a few useful mapper implementations. You can see some of them
in the table 3.2.
Table 3.2 Some useful Mapper implementations predefined by Hadoop
Class Description
IdentityMapper<K,V> Implements Mapper<K,V,K,V> and maps inputs directly to outputs
InverseMapper<K,V> Implements Mapper<K,V,V,K> and reverses the key/value pair
RegexMapper<K> Implements Mapper<K,Text,Text,LongWritable> and generates a
(match, 1) pair for every regular expression match
TokenCountMapper<K> Implements Mapper<K,Text,Text,LongWritable> and generates a
(token, 1) pair when the input value is tokenized
As the MapReduce name implies, the major data flow operation after map is the reduce
phase, shown in the bottom part of figure 3.1.
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步