我在Hadoop中遇到了一個相當奇怪的問題。Hadoop作業剛剛結束
我寫了一個MR作業,就像那樣結束,而不執行映射或減少代碼。它生成輸出文件夾,但該文件夾是空的。我沒有看到這種行爲的理由。
我甚至試着用默認的Mapper和Reducer來找到問題,但我沒有例外,沒有錯誤,工作剛剛結束併產生一個空文件夾。這裏是最簡單的驅動程序:
Configuration conf = new Configuration();
//DistributedCache.addCacheFile(new URI(firstPivotsInput), conf);
Job pivotSelection = new Job(conf);
pivotSelection.setJarByClass(Driver.class);
pivotSelection.setJobName("Silhoutte");
pivotSelection.setMapperClass(Mapper.class);
pivotSelection.setReducerClass(Reducer.class);
pivotSelection.setMapOutputKeyClass(IntWritable.class);
pivotSelection.setMapOutputValueClass(Text.class);
pivotSelection.setOutputKeyClass(IntWritable.class);
pivotSelection.setOutputValueClass(Text.class);
FileInputFormat.addInputPath(pivotSelection, new Path("/home/pera/WORK/DECOMPRESSION_RESULT.csv"));
FileOutputFormat.setOutputPath(pivotSelection, new Path("/home/pera/WORK/output"));
pivotSelection.setNumReduceTasks(1);
pivotSelection.waitForCompletion(true);
在這樣一個簡單的例子中會出現什麼問題?
謝謝你的回答,但它確實有條目,它在本地文件系統上,我正在通過IDE以獨立模式運行它?另外,當我嘗試自定義映射器並在設置方法中設置斷點時也會發生同樣的情況。像我沒有設置映射器。 – Marko
@pera但它仍然應該在HDFS上。嘗試把它放在那裏,看看它是否運行 – vefthym