1 /* Copyright (c) 2005 The Nutch Organization. All rights reserved. */ 2 /* Use subject to the conditions in http://www.nutch.org/LICENSE.txt. */ 3 4 package net.nutch.mapReduce; 5 6 import java.io.IOException; 7 8 import net.nutch.io.Writable; 9 import net.nutch.io.WritableComparable; 10 11 /** Maps input key/value pairs to a set of intermediate key/value pairs. All 12 * intermediate values associated with a given output key are subsequently 13 * grouped by the map/reduce system, and passed to a {@link Reducer} to 14 * determine the final output.. */ 15 public interface Mapper { 16 /** Maps a single input key/value pair into intermediate key/value pairs. 17 * Output pairs need not be of the same types as input pairs. A given input 18 * pair may map to zero or many output pairs. Output pairs are collected 19 * with calls to {@link 20 * OutputCollector#collect(WritableComparable,Writable)}. 21 * 22 * @param key the key 23 * @param value the values 24 * @param output collects mapped keys and values 25 */ 26 void map(WritableComparable key, Writable value, OutputCollector output) 27 throws IOException; 28 } 29