Job shortestPathJob = new Job(conf, "ShortestPathJob"); shortestPathJob.setJarByClass(GraphAlgorithm.class); FileInputFormat.addInputPath(shortestPathJob, new Path("hdfs://input/graph.txt")); FileOutputFormat.setOutputPath(shortestPathJob, new Path("hdfs://output/shortestPath")); shortestPathJob.setMapperClass(ShortestPathMapper.class); shortestPathJob.setReducerClass(ShortestPathReducer.class); shortestPathJob.setInputFormatClass(TextInputFormat.class); shortestPathJob.setOutputFormatClass(TextOutputFormat.class); shortestPathJob.waitForCompletion(true);


上一篇:
下一篇:
切换中文