[ 
https://issues.apache.org/jira/browse/HDFS-10756?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15423864#comment-15423864
 ] 

Yuanbo Liu commented on HDFS-10756:
-----------------------------------

[~xiaochen]
I've tested EZ deletion in my own environment, and my hadoop version is 2.7.2.
Actually I find that EZ file can not be moved from EZ to a trash directory 
under the same EZ while using hadoop client.
I do some research about this issue and find a comment from Harsh, see the 
details from here: 
https://community.cloudera.com/t5/Storage-Random-Access-HDFS/Is-it-possible-to-use-trash-in-HDFS-encryption-zone/td-p/36567
He suggests that we create a .Trash in the EZ directory and use "mv" not "rm" 
to delete the file in EZ.
If we want to use "rm" command to delete EZ file, we have to add option 
"-skipTrash" which apparently is not related to  
[getTrashRoot|https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L2708]
Is my understanding right?

> Expose getTrashRoot to HTTPFS and WebHDFS
> -----------------------------------------
>
>                 Key: HDFS-10756
>                 URL: https://issues.apache.org/jira/browse/HDFS-10756
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: encryption, httpfs, webhdfs
>            Reporter: Xiao Chen
>
> Currently, hadoop FileSystem API has 
> [getTrashRoot|https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L2708]
>  to determine trash directory at run time. Default trash dir is under 
> {{/user/$USER}}
> For an encrypted file, since moving files between/in/out of EZs are not 
> allowed, when an EZ file is deleted via CLI, it calls in to [DFS 
> implementation|https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L2485]
>  to move the file to a trash directory under the same EZ.
> This works perfectly fine for CLI users or java users who call FileSystem 
> API. But for users via httpfs/webhdfs, currently there is no way to figure 
> out what the trash root would be. This jira is proposing we add such 
> interface to httpfs and webhdfs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to