在hadoop HDFS中有没有? [英] Is there ln in hadoop HDFS
问题描述
hadoop HDFS中是否存在 ln -s
?
例如:
我有10个HDFS文件
/ user / hadoop / input
,其中是 1.txt,2.txt ... 10.txt
HDFS中的另一个目录是 / user / hadoop / test
我只想从 / user / hadoop / input /1.txt
至 /user/hadoop/test/1.txt
。
最简单的方法是使用 hadoop dfs -cp /user/hadoop/1.txt / user / hadoop / test
。
但它花费更多时间和磁盘空间。有没有类似shell的方法,比如
hadoop dfs -ln /user/hadoop/1.txt /user/hadoop/test/1.txt
?HDFS支持符号链接。检查 1 , 2 , 3 , 4 了解更多详情。所以,可以使用Java API来完成,但从来没有遇到类似的CLI。
Is there ln -s
in hadoop HDFS?
For instance:
I have 10 files in HDFS
/user/hadoop/input
, which is 1.txt, 2.txt ... 10.txt
Another dir in HDFS is /user/hadoop/test
I just wanna copy 1 file from /user/hadoop/input/1.txt
to /user/hadoop/test/1.txt
.
The simplest way is use hadoop dfs -cp /user/hadoop/1.txt /user/hadoop/test
.
But it cost more time and disk space. Is there a way like shell such as hadoop dfs -ln /user/hadoop/1.txt /user/hadoop/test/1.txt
?
HDFS supports Symbolic links. Check 1, 2, 3, 4 for more details. So, it can be done using Java API, but never came across a CLI for the same.
这篇关于在hadoop HDFS中有没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!