Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

About hadoop api safely delete

Highlighted

About hadoop api safely delete

New Contributor

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

New Contributor

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...

Don't have an account?
Coming from Hortonworks? Activate your account here