Hadoop HDFS : Trash location
Asked Answered
H

2

5

When and where, HDFS creates the .Trash folder ?

Does there any rule or logic, any reference ?

Humiliating answered 10/10, 2018 at 12:48 Comment(0)
H
6

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

Humiliating answered 11/10, 2018 at 14:28 Comment(1)
Ah, yeah, I've not used encryption zonesOffspring
O
8

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

Offspring answered 10/10, 2018 at 21:20 Comment(2)
Not only in /user/<name>, i can find .Trash under other locations !Humiliating
Okay, well, I've personally not seen that, so maybe someone manually created the folder. Do you have any examples?Offspring
H
6

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

Humiliating answered 11/10, 2018 at 14:28 Comment(1)
Ah, yeah, I've not used encryption zonesOffspring

© 2022 - 2024 — McMap. All rights reserved.