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.

HDFS Trash interval

HDFS Trash interval

Contributor

Is it possible to use different Trash interval for hdfs directories. Eg Directory "Market" for trash interval 7days and directory search for "14" days?

 

 

5 REPLIES 5

Re: HDFS Trash interval

Champion
No. When deleting a file or folder it is access and then determines whether to send it to trash or not. I also believe there is a cleaner process that then checks it to decide when to clear items out of the trash.

Re: HDFS Trash interval

Champion

@naveen1

 

By default CM provides a common setting for fs.trash.interval like 1 day, 2 days, etc

 

But you can achieve your needs by writting a customized shell script and schedule it 

a. to move trash data to a back-up folder every day

b. delete 7 days old data automatically

 

 

Re: HDFS Trash interval

Contributor
This seems to be a overhead and I was seeing if hdfs could handle this request. Thanks for all replies.

Re: HDFS Trash interval

Rising Star

The HDFS trash policy is pluggable. The default (and the only one supported by Cloudera) is TrashPolicyDefault (org.apache.hadoop.fs.TrashPolicyDefault). But in theory you could write your own trash policy and configure NameNode to use your trash policy.

 

If you are interested to see it happen, file a feature request jira at Apache Hadoop https://issues.apache.org/jira/projects/HDFS and see if someone would pick it up.

Re: HDFS Trash interval

Contributor
I have opened a Jira for this request. Thanks Wei