私はDriver、Mapper、Reducerクラスを持っています。 MapperクラスとReducerクラスのSystem.out.printlnステートメントは、Logs of Yarnに表示されます。一部のクラスのSystem.out.println()ステートメントがYarnログに表示されないのはなぜですか?
驚いたことに、ドライバプログラムのprintln文が表示されません。 これはprintlnステートメントを持つドライバプログラムです。
この奇妙な動作がなぜ発生するかについてのご意見はありますか?
import java.io.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
public class Weblogs {
public static void main(String[] args) throws Exception
{
Configuration conf = new Configuration();
Job job = new Job();
job.setJobName("WebLog Reader");
job.setJarByClass(Weblogs.class);
job.setMapperClass(WebLogMapper.class);
job.setReducerClass(WebLogReducer.class);
job.setOutputKeyClass(Text.class);
job.setOutputValueClass(IntWritable.class);
job.setMapOutputKeyClass(WebLogWritable.class);
job.setMapOutputValueClass(IntWritable.class);
FileInputFormat.addInputPath(job, new Path(args[0]));
FileOutputFormat.setOutputPath(job, new Path(args[1]));
//setting the second argument as a path in a path variable
Path outputPath = new Path(args[1]);
System.out.println(args[1]);
//deleting the output path automatically from hdfs so that we don't have delete it explicitly
outputPath.getFileSystem(conf).delete(outputPath);
System.exit(job.waitForCompletion(true) ? 0 : 1);
}
いずれか1つを入力してください。 printlnステートメントはドライバクラスにのみ表示されます。 –