Is there ln in hadoop HDFS

此生再无相见时 提交于 2019-12-30 02:08:14

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/13401118/is-there-ln-in-hadoop-hdfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!