我有一个文件MapReduce的设置输入和输出
import java.io.IOException;
import java.nio.file.Paths;
import java.util.*;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import org.apache.hadoop.mapreduce.lib.input.*;
import org.apache.hadoop.mapreduce.lib.output.*;
import org.apache.hadoop.util.*;
public class ViewCount extends Configured implements Tool {
public static void main(String args[]) throws Exception {
int res = ToolRunner.run(new ViewCount(), args);
System.exit(res);
}
public int run(String[] args) throws Exception {
//Path inputPath = new Path(args[0]);
Path inputPath = Paths.get("C:/WorkSpace/input.txt");
Path outputPath = Paths.get("C:/WorkSpace/output.txt");
Configuration conf = getConf();
Job job = new Job(conf, this.getClass().toString());
我尝试在Windows运行的应用程序。如何设置inputPath和outputPath?我现在使用的方法不起作用。之前我有
Path inputPath = new Path(args[0]);
Path outputPath = new Path(args[1]);
我必须去命令行。现在我想从IDE运行应用程序。
我越来越
Required:
org.apache.hadoop.fs.Path
Found:
java.nio.file.Path
我应该将它们分开吗? C:\ WorkSpace \ input.txt,C:\ WorkSpace \ output.txt –
现在我得到这个错误java.io.IOException:无法初始化群集。请检查您的配置mapreduce.framework.name和相应的服务器地址 –