今天在做hadoop小实验(类似于倒排索引),
在本地运行时本地job“Running job: job_local_0001” 的得到的数据格式为为:
Hello file3.txt:1;
MapReduce file3.txt:2;file1.txt:1;file2.txt:1;
bye file3.txt:1;
is file1.txt:1;file2.txt:2;
powerful file2.txt:1;
simple file2.txt:1;file1.txt:1;
而 提交到集群上运行“Running job: job_201405091426_0019”得到数据格式为空值。
输入文件内容为:
file1.txt
MapReduce is simple
file2.txt
MapReduce is powerful is simple
file3.txt
Hello MapReduce bye MapReduce
搞了半天不知道什么问题。记录下来 以后解决。
程序源码如下:
package org.edu.bupt.xiaoye.hadooptest;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Iterator;
imp