shell
#检查文件是否存在 hdfs dfs -test -e /hdfstestfile.txt #查看结果,0表示存在,1表示不存在 echo $? #文件已经存在,追加到原文件末尾 hdfs dfs -appendTOFile localtestfile.txt /hdfstestfile.txt #文件已经存在,追加到原文件末尾 hdfs dfs -copyFromLocal -f localtestfile.txt /hdfstestfile.txt
java
import org.apache.hadoop.conf.Configuration; import



