Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there ln in hadoop HDFS

Tags:

hadoop

hdfs

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 ?

like image 251
pensz Avatar asked Nov 15 '12 15:11

pensz


1 Answers

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.

like image 180
Praveen Sripati Avatar answered Oct 06 '22 11:10

Praveen Sripati