Idea如果有参数,怎么debug
如上图,输入输出路径是需要运行的时候给参数。
那么
FileInputFormat.setInputPaths(job, new Path(args[0])); FileOutputFormat.setOutputPath(job, new Path(args[1]));
给上面的代码给参数的步骤为
1.在类名或者方法名上右键,选择More Run/Debug
2.选择 Modify Run Configuration
3.设置参数
com.lotus.mapreduce.wordcount.WordCountDriver为类名,下面是参数,用空格隔开
例如/MapReduce/WordCountTest/input是第一个参数就是args[0],
/MapReduce/WordCountTest/output是第二个参数就是args[1]
4.点击ok
5.可以运行了
如下图:可以看到args[0],args[1]已经有值了