HADOOP-5323. Trash documentation should describe its directory structure and 
configurations. Contributed by Weiwei Yang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9a87f81c
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9a87f81c
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9a87f81c

Branch: refs/heads/YARN-1197
Commit: 9a87f81ce6839d1b5ab3d663c1e82c7e572bdeb8
Parents: b469ac5
Author: Tsuyoshi Ozawa <[email protected]>
Authored: Thu Sep 3 22:34:25 2015 +0900
Committer: Tsuyoshi Ozawa <[email protected]>
Committed: Thu Sep 3 22:34:25 2015 +0900

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                    | 3 +++
 .../hadoop-hdfs/src/site/markdown/HdfsDesign.md                | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9a87f81c/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt 
b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 22b80a6..275beb2 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1297,6 +1297,9 @@ Release 2.7.2 - UNRELEASED
 
     HDFS-8659. Block scanner INFO message is spamming logs. (Yongjun Zhang)
 
+    HADOOP-5323. Trash documentation should describe its directory structure 
and
+    configurations. (Weiwei Yang via ozawa)
+
   OPTIMIZATIONS
 
     HDFS-8722. Optimize datanode writes for small writes and flushes (kihwal)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9a87f81c/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsDesign.md
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsDesign.md 
b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsDesign.md
index c441ae8..5b1f66e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsDesign.md
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HdfsDesign.md
@@ -226,9 +226,11 @@ Space Reclamation
 
 ### File Deletes and Undeletes
 
-When a file is deleted by a user or an application, it is not immediately 
removed from HDFS. Instead, HDFS first renames it to a file in the trash 
directory(`/user/<username>/.Trash`). The file can be restored quickly as long 
as it remains in trash. A file remains in trash for a configurable amount of 
time. After the expiry of its life in trash, the NameNode deletes the file from 
the HDFS namespace. The deletion of a file causes the blocks associated with 
the file to be freed. Note that there could be an appreciable time delay 
between the time a file is deleted by a user and the time of the corresponding 
increase in free space in HDFS.
+When a file is deleted by a user or an application, it is not immediately 
removed from HDFS. Instead, HDFS moves it to a trash directory (each user has 
its own trash directory under `/user/<username>/.Trash`).
+The file can be restored quickly as long as it remains in trash. Most recent 
deleted files are moved to the current trash directory 
(`/user/<username>/.Trash/Current`), and in a configurable interval, HDFS 
creates checkpoints (under `/user/<username>/.Trash/<date>`) for files in 
current trash directory and deletes old checkpoints when they are expired.
+After the expiry of its life in trash, the NameNode deletes the file from the 
HDFS namespace. The deletion of a file causes the blocks associated with the 
file to be freed. Note that there could be an appreciable time delay between 
the time a file is deleted by a user and the time of the corresponding increase 
in free space in HDFS.
 
-A user can Undelete a file after deleting it as long as it remains in the 
trash directory. If a user wants to undelete a file that he/she has deleted, 
he/she can navigate the trash directory and retrieve the file. The trash 
directory contains only the latest copy of the file that was deleted. The trash 
directory is just like any other directory with one special feature: HDFS 
applies specified policies to automatically delete files from this directory. 
Current default trash interval is set to 0 (Deletes file without storing in 
trash). This value is configurable parameter stored as `fs.trash.interval` 
stored in core-site.xml.
+Currently, the trash feature is disabled by default (deleting files without 
storing in trash). User can enable this feature by setting a value greater than 
zero for parameter `fs.trash.interval` (in core-site.xml). This value tells the 
NameNode how long a checkpoint will be expired and removed from HDFS. In 
addition, user can configure an appropriate time to tell NameNode how often to 
create checkpoints in trash (the parameter stored as 
`fs.trash.checkpoint.interval` in core-site.xml), this value should be smaller 
or equal to fs.trash.interval.
 
 ### Decrease Replication Factor
 

Reply via email to