Boa Tarde Galera,
Tenho pouco conhecimento em Java ou quase nada!
Estou fazendo MBA em ciências de dados e me deparei com erro que não consigo resolver.
Estou criando um projeto : MapReduce JAVA
Estou usando Eclipse Version: 2019-09 R (4.13.0) - Build id: 20190917-1200.
Meu código está assim:
package pkg.mt;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
public class MaxTemperature extends Configured implements Tool{
public int run(String[]args) throws Exception {
if (args.length != 3) {
System.err.printf("Usage: %s [generic options] <input> <output>\n",
getClass().getSimpleName
());
ToolRunner.printGenericCommandUsage(System.err);
return -1;
}
Class<? extends MaxTemperature> conf = this.getClass();
Job job = new Job(conf);
job.setJarByClass(MaxTemperature.class);
job.setJobName("Max temperature");
FileInputFormat.addInputPath(job, new Path(args[1]));
FileOutputFormat.setOutputPath(job, new Path(args[2]));
job.setMapperClass(MaxTemperatureMapper.class);
job.setReducerClass(MaxTemperatureReducer.class);
job.setCombinerClass(MaxTemperatureReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
return job.waitForCompletion(true) ? 0 : 1;
}
public static void main(String[] args) throws Exception {
int exitCode = ToolRunner.run(new MaxTemperature(), args);
System.exit(exitCode);
}
}
Estou tendo retorno abaixo:
The type Tool cannot be a superinterface of MaxTemperature; a superinterface must be an interface
Algum dos amigos poderia me a ajudar a solucionar esse erro?