[
https://issues.apache.org/jira/browse/HADOOP-18110?focusedWorklogId=724162&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-724162
]
ASF GitHub Bot logged work on HADOOP-18110:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 09/Feb/22 23:35
Start Date: 09/Feb/22 23:35
Worklog Time Spent: 10m
Work Description: omalley commented on a change in pull request #3956:
URL: https://github.com/apache/hadoop/pull/3956#discussion_r803178289
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
##########
@@ -1130,16 +1132,49 @@ public BlockStoragePolicySpi getStoragePolicy(Path src)
throws IOException {
* Get the trash root directory for current user when the path
* specified is deleted.
*
+ * If CONFIG_VIEWFS_MOUNT_POINT_LOCAL_TRASH is not set, return
+ * the default trash root from targetFS.
+ *
+ * When CONFIG_VIEWFS_MOUNT_POINT_LOCAL_TRASH is set to true,
+ * 1) If path p is in fallback FS or from the same mount point as the default
+ * trash root for targetFS, return the default trash root for targetFS.
+ * 2) else, return a trash root in the mounted targetFS
+ * (/mntpoint/.Trash/<user>)
Review comment:
The "<user>" causes javadoc to fail as an unknown tag. You need to quote
using < and >.
##########
File path:
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/viewfs/ViewFileSystemBaseTest.java
##########
@@ -1102,6 +1104,131 @@ public void testTrashRoot() throws IOException {
Assert.assertTrue("", fsView.getTrashRoots(true).size() > 0);
}
+ /**
Review comment:
Please add a test where the child file system returns a root inside of
the mount point, such as what will happen when there is an encryption zone
root. To do so, you'll need to define a mock/stub fs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 724162)
Time Spent: 2h (was: 1h 50m)
> ViewFileSystem: Add Support for Localized Trash Root
> ----------------------------------------------------
>
> Key: HADOOP-18110
> URL: https://issues.apache.org/jira/browse/HADOOP-18110
> Project: Hadoop Common
> Issue Type: Improvement
> Components: common
> Reporter: Xing Lin
> Assignee: Xing Lin
> Priority: Major
> Labels: pull-request-available
> Time Spent: 2h
> Remaining Estimate: 0h
>
> getTrashRoot() in ViewFileSystem calls getTrashRoot() from underlying
> filesystem, to return the trash root. Most of the time, we get a trash root
> in user home dir. This can lead to problems when an application wants to
> delete a file in a mounted point using moveToTrash() in TrashPolicyDefault,
> because we can not rename across multiple filesystems/hdfs namenodes.
>
> We propose the following extension to getTrashRoot/getTrashRoots in
> ViewFileSystem: add a flag to return a localized trash root for
> ViewFileSystem. A localized trash root is a trash root which starts from the
> root of a mount point (e.g., /mountpointRoot/.Trash/\{user}).
> * If CONFIG_VIEWFS_MOUNT_POINT_LOCAL_TRASH is not set to true, or
> * when the path p is in a snapshot or an encryption zone, return
> * the default trash root in user home dir.
> *
> * when CONFIG_VIEWFS_MOUNT_POINT_LOCAL_TRASH is set to true,
> * 1) if path p is mounted from the same targetFS as user home dir,
> * return a trash root in user home dir.
> * 2) else, return a trash root in the mounted targetFS
> *
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]