You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/09/14 00:36:08 UTC

[GitHub] [hadoop] omalley commented on a diff in pull request #4869: HADOOP-18444 Add Support for localized trash for ViewFileSystem in Trash.moveToAppropriateTrash

omalley commented on code in PR #4869:
URL: https://github.com/apache/hadoop/pull/4869#discussion_r970145340


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Trash.java:
##########
@@ -94,6 +96,34 @@ public static boolean moveToAppropriateTrash(FileSystem fs, Path p,
       LOG.warn("Failed to get server trash configuration", e);
       throw new IOException("Failed to get server trash configuration", e);
     }
+
+    /*
+     * In HADOOP-18144, we fixed the logical path vs. target path bug of getTrashRoot() in ViewFileSystem.
+     * moveToTrash works for ViewFileSystem now. ViewFileSystem will do path resolution internally by itself.
+     *
+     * When localized trash flag is enabled:
+     *    1). if fs is a ViewFileSystem, we can initialize Trash() with this ViewFileSystem object;
+     *    2). When fs is not a ViewFileSystem, the only place we would need to resolve a path is for symbolic links.
+     *        However, symlink is not enabled in Hadoop due to the complexity to support it (HADOOP-10019).
+     */
+    if (conf.getBoolean(CONFIG_VIEWFS_TRASH_FORCE_INSIDE_MOUNT_POINT,
+        CONFIG_VIEWFS_TRASH_FORCE_INSIDE_MOUNT_POINT_DEFAULT)) {
+      // Save the original config in savedValue for localized trash config.
+      String savedValue = fs.getConf().get(CONFIG_VIEWFS_TRASH_FORCE_INSIDE_MOUNT_POINT);

Review Comment:
   Do we really need to copy the value over between configs? Doesn't ViewFS use its own config when creating the child file systems?



-- 
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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org