Support Questions
Find answers, ask questions, and share your expertise

About hadoop api safely delete

About hadoop api safely delete

Explorer

Hi,

as we know,Hadoop API deleted cannot go to trash.

Is there any other way to solve this Hadoop API deletion problem, except at the code layer?

What I want to know is whether it can be solved on the platform ?

1 REPLY 1

Re: About hadoop api safely delete

Explorer

I think you can do this using the WebHDFS REST API. The call Get_Trash_Root will tell you where the current users trash folder is.

https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Get_Trash_Root

Then rename the files to change its path to the .trash folder

https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Rename_a_FileDir...