初学hadoop,使用JAVA API操作hdfs,在练习将本地文件上传到hdfs时,书上提供的代码如下所示,网上的很多实例也是这样写的:
<span style="font-size:14px;"> Configuration conf= new Configuration();
FileSystem hdfs=FileSystem. get( conf);
Path src= new Path( "/home/hadoop/Documents/hadoop/testdoc/tiger.txt" );
Path dst= new Path( "/" );