您的位置:首页 > 编程语言

Hadoop程序中怎样用代码删除hafs中的文件和目录

2011-05-11 11:19 603 查看
Configuration conf = new Configuration();
String uri="hdfs://hadoop1:9000";
FileSystem fs=FileSystem.get(URI.create(uri),conf);
String s="/user/root/"+ args[1];
Path p=new Path(s);
boolean a=fs.delete(p,true);
System.out.println(a);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: