我有一個文件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和相應的服務器地址 –