package cn.jecn.hadoop.hdfs.com; import java.io.File; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public class CopyToHDFS { public static void main(String[] args) throws IOException { //获取configuration对象 Configuration conf=new Configuration(); //获取filesystem对象性 FileSystem fs=FileSystem.get(conf); Path souce=new Path("e:+"+File.separator+"word.txt"); Path dst=new Path("user/hadoop/2013"); fs.copyFromLocalFile(souce, dst); } }


pangzhihui LV14
2024年6月12日
ningningnn LV3
2024年4月9日
ewan007 LV30
2023年11月13日
sunlzh888888 LV29
2023年9月15日
飞行家真真 LV1
2023年7月2日
2716804680 LV9
2023年3月23日
1690356080 LV38
2023年2月13日
Trickster LV9
2022年8月1日
tianqi2020 LV5
2022年5月27日
cccccc12 LV8
2022年5月19日