smengcl commented on a change in pull request #1215:
URL: https://github.com/apache/hadoop-ozone/pull/1215#discussion_r457595248
##########
File path:
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
##########
@@ -397,6 +398,32 @@ public boolean rename(Path src, Path dst) throws
IOException {
return result;
}
+ /**
+ * Intercept rename to trash calls from TrashPolicyDefault,
+ * convert them to delete calls instead.
+ */
+ @Deprecated
+ protected void rename(final Path src, final Path dst,
+ final Rename... options) throws IOException {
+ boolean hasMoveToTrash = false;
+ if (options != null) {
+ for (Rename option : options) {
+ if (option == Rename.TO_TRASH) {
+ hasMoveToTrash = true;
+ break;
+ }
+ }
+ }
+ if (!hasMoveToTrash) {
+ // if doesn't have TO_TRASH option, just pass the call to super
+ super.rename(src, dst, options);
+ } else {
+ // intercept when TO_TRASH is found
Review comment:
done in
https://github.com/apache/hadoop-ozone/pull/1215/commits/a929357c62a60bdfccfb48f1c65f5adf47c30069
----------------------------------------------------------------
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]