package api; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; public class Utils { public static FileSystem HDFS() throws Exception{ Configuration conf = new Configuration(); conf.set("fs.defaultFS","hdfs://potter2:9000"); System.setProperty("HADOOP_USER_NAME", "potter"); FileSystem fs = FileSystem.get(conf); return fs; } }
删除HDFS集群中的所有空文件和空目录
内容版权声明:除非注明,否则皆为本站原创文章。