virajith commented on code in PR #5071:
URL: https://github.com/apache/hadoop/pull/5071#discussion_r1011042738


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -734,6 +811,13 @@ public boolean mkdirs(String src, FsPermission masked, 
boolean createParent)
         new Class<?>[] {String.class, FsPermission.class, boolean.class},
         new RemoteParam(), masked, createParent);
 
+    // Auto-create user home dir for a trash path.
+    // moveToTrash() will first call fs.mkdirs() to create the parent dir, 
before calling rename()
+    // to move the file into it. As a result, we need to create user home dir 
in mkdirs().
+    if (autoCreateUserHomeForTrash) {
+      createUserHomeForTrashPath(src, locations);

Review Comment:
   I don't think you should be piggybacking on {{mkdirs}} to get this created. 
If this is a useful feature to have, I'd suggest adding a new FileSystem API 
named something like {{provisionTrashPath()}} similar to {{provisionEZTrash}} 
and call it in {{TrashPolicy#moveToTrash}} before {{mkdirs}}. 
   
   Can you also call out why you need this vs. provisioning user trash paths as 
part of the (off band) process of provisioning the user home directories on 
HDFS?



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


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

Reply via email to