0
IntelliJ 내부에서 Map-Reduce 작업을 실행하려고합니다. 이것은 내 러너 코드입니다IntelliJ에서 Mapreduce 작업이 실패했습니다
public class ViewCount extends Configured implements Tool{
@Override
public int run(String[] args) throws Exception {
Configuration conf = this.getConf();
Job job = Job.getInstance(conf);
job.setJobName("viewCount");
job.setJarByClass(ViewCount.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setMapperClass(Map.class);
job.setReducerClass(Reduce.class);
Path inputFilePath = new Path(args[0]);
Path outputFilePath = new Path(args[1]);
FileInputFormat.addInputPath(job, inputFilePath);
FileOutputFormat.setOutputPath(job, outputFilePath);
return job.waitForCompletion(true) ? 0:1;
}
public static void main(String[] args) throws Exception {
int exitCode = ToolRunner.run(new ViewCount(), args);
System.exit(exitCode);
}
작업을 다음 오류 메시지와 함께 빌드하지 못합니다.
error: incompatible types: Job cannot be converted to JobConf
FileOutputFormat.setOutputPath(job, outputFilePath);
Apached 문서
이 방법은 실제로, 그래서 내가 뭘 잘못 일이 아닌 JobConf을 소요하는 것이 좋습니다?
이것은 IntelliJ와 아무런 관련이 없습니다 – Moira
map reduce 1 및 2 APIs. FileOutputFormat을 가져올 위치를 확인하십시오. old mapreduce (org.apache.hadoop.mapred.FileOutputFormat)는 JobConf를 사용하고, 새로운 mapreduce (org.apache.hadoop.mapreduce.lib.output.FileOutputFormat)는 Job을 매개 변수로 사용합니다. – Amit