54l3d
54l3d

Reputation: 3973

Hadoop HDFS : Trash location

When and where, HDFS creates the .Trash folder ?

Does there any rule or logic, any reference ?

Upvotes: 5

Views: 23940

Answers (2)

54l3d
54l3d

Reputation: 3973

The HDFS .Trash folder appears after a delete operation (whitout skipping trash) in :

  1. For each hdfs user under his home folder:
    /user/<user-name>/.Trash

  2. For each encryption zone under it's root:
    /crypto/zone/root/.Trash

Upvotes: 6

OneCricketeer
OneCricketeer

Reputation: 191725

Every HDFS user has their own .Trash folder on HDFS within hdfs:///user/<name>. The folder existance is checked and then created whenever hadoop fs -rm command gets executed by that user without a -skipTrash option.

This is purged on a schedule as per values of core-site.xml

  • fs.trash.interval
  • fs.trash.checkpoint.interval

By default, both are zero, so it is disabled and deleted files will therefore always be recoverable until manually cleared out by an HDFS administrator.

Also see this IBM post on HDFS Trash

Upvotes: 8

Related Questions