public static void main(String[] args) throws Exception {
//main()函数首先进行Hadoop的相关配置类
Configuration conf = new Configuration(); //创建COnfiguration
//因为HDFS默认情况下是输出文件路径事先不存在 所以 我们在这里新增一个对 已存在输出文件清理的功能
//除了在代码中实现,我们还可以在hdfs 命令行手动删除(比较low的方法)
Path outputPath=new Path(args[1]);
FileSystem file = FileSystem.get(new URI(HDFS_PATH),conf); //这里需要加上hdfs的URI地址
if(file.exists(outputPath)){
//如果存在,则删除
file.delete(outputPath,true);
System.out.println("output path exists,but it's deleted...");
}
就是 Path outputPath=new Path(args[1]);
这个里面的args[1]是什么意思,它有什么作用,为什么要这样写?