Hadoop映射过程

Hadoop map process

如果有一个只有map没有reduce的job,如果所有要处理的data value都映射到一个key,这个job是不是只能在一个node上处理?

没有。 基本上,节点的数量将由映射器的数量决定。 1 个映射器将 运行 在 1 个节点上,N 个映射器在 N 个节点上,每个映射器一个节点。 您的作业所需的映射器数量将由 Hadoop 设置,具体取决于数据量以及您的数据将被拆分的块的大小。每个数据块将由 1 个映射器处理。 因此,例如,如果您有大量数据,被分成 N 个块,您将需要 N 个映射器来处理它。

直接来自 Hadoop 权威指南,第 6 章,Map reduce 作业剖析 运行。

"To create the list of tasks to run, the job scheduler first retrieves the input splits computed by the client from the shared filesystem. It then creates one map task for each split. The number of reduce tasks to create is determined by the mapred.reduce.tasks property in the Job, which is set by the setNumReduceTasks() method, and the scheduler simply creates this number of reduce tasks to be run. Tasks are given IDs at this point."