xiaoyuyao commented on a change in pull request #941:
URL: https://github.com/apache/hadoop-ozone/pull/941#discussion_r428208942



##########
File path: 
hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OFSPath.java
##########
@@ -238,4 +248,23 @@ static String getTempMountBucketNameOfCurrentUser() throws 
IOException {
     String username = UserGroupInformation.getCurrentUser().getUserName();
     return getTempMountBucketName(username);
   }
+
+  /**
+   * Return trash root for the given path.
+   * @return trash root for the given path
+   */
+  public Path getTrashRoot() {
+    try {
+      String username = UserGroupInformation.getCurrentUser().getUserName();
+      URI uri = new URIBuilder().setScheme(OZONE_OFS_URI_SCHEME)

Review comment:
       Given we don't have a home directory per bucket, I think this PR took an 
approach similar to encryption zone where the .Trash is created per bucket, 
i.e., ofs://vol1/bucket1/.Trash/username, which have a common trash root per 
bucket. 
   
   If we take ofs:///vol1/bucket1/username/.Trash, we won't have a common trash 
root. As a result, the trash clean up will be expensive as we don't have a 
common root per bucket to check the expired trash checkpoints. 
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to