Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-18110

ViewFileSystem: Add Support for Localized Trash Root

    XMLWordPrintableJSON

Details

    Description

      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
        *

      Attachments

        Activity

          People

            xinglin Xing Lin
            xinglin Xing Lin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 5h
                5h