ivandika3 commented on code in PR #8063:
URL: https://github.com/apache/hadoop/pull/8063#discussion_r2700676534


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:
##########
@@ -3429,6 +3429,29 @@ public Collection<? extends BlockStoragePolicySpi> 
getAllStoragePolicies()
         + " doesn't support getAllStoragePolicies");
   }
 
+  /**
+   * Get the trash policy implementation used by this FileSystem. This trash 
policy
+   * is used by classes of {@link Trash} to implement the trash behavior.
+   * <p>
+   * FileSystem implementation can consider overriding this method to handle
+   * situation where a single FileSystem client shares a configuration, but
+   * each FileSystem scheme requires a distinct TrashPolicy implementation.
+   *
+   * @param conf configuration which can be used to choose the TrashPolicy
+   *             implementation.
+   * @return TrashPolicy implementation by this filesystem.
+   *         The default implementation returns the configured TrashPolicy
+   *         based on the value of the configuration parameter 
fs.trash.classname
+   *         of the passed configuration.
+   */
+  @InterfaceAudience.Public
+  @InterfaceStability.Unstable
+  public TrashPolicy getTrashPolicy(Configuration conf) {

Review Comment:
   Good point, updated.
   
   However, the reason I don't put the `Path` is because the `FileSystem` 
resolution logic is already done in `Trash#moveToAppropriateTrash`. In that 
case, we might not need to use a `Path`. This is the reason why I mentioned in 
the filesystem.md that 
   
   > FileSystem implementations with multiple child file systems (e.g. 
`ViewFileSystem`) should NOT implement this method since the Hadoop trash 
mechanism should resolve to the underlying filesystem before invoking 
`getTrashPolicy`. 
   
   Please let me know what you think.



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