Reputation: 9024
What is the best possible way to rename a directory in HDFS?
For example, there are 2 folders A and B, each with more than 10000 files.
I want to rename B to A and A to X.
Is this possible with the mv command? In which case, what happens behind the scene (just a rename or the copy and remove)?
Upvotes: 1
Views: 4027
Reputation: 1881
It just a rename which happens. It is very expensive to copy over all the data blocks all over. Instead it will just rename the directory and update the Namenode metadata.
Upvotes: 2