Java tutorial
/* * ============================================================ * The SSE USTC Software License * * PrintKeysReducer.java * 20141014 * * Copyright (c) 2006 China Payment and Remittance Service Co.,Ltd * All rights reserved. * ============================================================ */ package comm; import java.io.IOException; import org.apache.hadoop.io.NullWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Reducer; /** * ??Key * <p> * date author email notes<br /> * ----------------------------------------------------------------<br /> *20141014 starqiu@mail.ustc.edu.cn <br /></p> * */ public class PrintKeysReducer extends Reducer<Text, Object, Text, NullWritable> { public void reduce(Text _key, Iterable<Object> values, Context context) throws IOException, InterruptedException { // process values context.write(_key, NullWritable.get()); // System.out.println(_key); } }