liveBook · Manning

Mapper

As explained in Advanced Algorithms and Data Structures

A mapper is a MapReduce worker that processes an input partition and creates intermediate results for reducers.

A mapper is a MapReduce worker that processes one input partition and transforms each entry into information needed for the final computation. It emits intermediate results, usually grouped later by reducers, so machines can work on separate data shards without sending the entire dataset through one orchestrator. section 13.2.2

A mapper’s role becomes concrete in a distributed clustering workflow:

  • Receive a shard of the dataset together with shared configuration, such as the current list of centroids. section 13.3
  • Process points independently when the computation permits it, assigning each point to a centroid or canopy. section 13.3 section 13.3.3
  • Emit intermediate data keyed for reducers, which aggregate points or values belonging to the same centroid or group. section 13.2.2 section 13.3
  • Optionally reduce repeated per-key output locally with a combiner before transmission, lowering bandwidth and reducer workload. section 13.2.2

Coin recognition

Suppose each input partition contains images of coins. A mapper runs coin-recognition software on its shard and emits unsorted occurrences such as “$100: 1” or “25¢: 1”; reducers then receive all occurrences for each denomination and count them. A combiner can replace many repeated entries with local counts before transmission. section 13.2.2

$100: 1
50¢: 1
$100: 1
$1: 1
25¢: 1
...

A compact listing of mapper output makes the intermediate, per-occurrence representation visible before reduction. section 13.2.2

How Advanced Algorithms and Data Structures covers it

How deep it goes
Explains partitioning, shared configuration, local combining, and mapper reuse, but defers framework-level execution mechanics.
Examples
Uses coin recognition, per-denomination occurrences, k-means point assignment, and canopy classification to illustrate mapper work.
What it assumes
Assumes familiarity with partitioned datasets and reducers while defining mapper, Map, intermediate output, and combiner roles.
What you can do after
Apply it via MapReduce by partitioning input, supplying shared state, emitting keyed intermediate data, and optionally combining local output.
How it connects
Connects mappers to MapReduce, reducers, combiners, sharding, k-means, canopy clustering, centroids, and canopy classification.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.