import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class InversedIndex {
/**
* 将输入文件拆分,
* 将关键字和关键字所在的文件名作为map的key输出,
* 该组合的频率作为value输出
* */
public static class InversedIndexMapper extends Mapper<Object, Text, Text, Text> {
private Text outKey = new Text
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.FileSplit;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class InversedIndex {
/**
* 将输入文件拆分,
* 将关键字和关键字所在的文件名作为map的key输出,
* 该组合的频率作为value输出
* */
public static class InversedIndexMapper extends Mapper<Object, Text, Text, Text> {
private Text outKey = new Text