ozone icon indicating copy to clipboard operation
ozone copied to clipboard

HDDS-13232. Remove duplicate code in DirectoryDeletingService

Open frankvicky opened this issue 7 months ago • 9 comments

What changes were proposed in this pull request?

DirectoryDeletingService#optimizeDirDeletesAndSubmitRequest and DirectoryDeletingService#processDeletedDirectories have duplicate code snippets. This patch refactors both methods and eliminates the duplicate part.

Please describe your PR in detail: This patch has extracted a helper method processDirectoryRequests and a static inner class ProcessDirectoryResult to reduce duplicate code.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-13232

How was this patch tested?

Given that it's just a refactor, the patch won't have any new test cases, and the existing tests should pass.

frankvicky avatar Jun 19 '25 15:06 frankvicky

Hi thanks for working on this. Please run the command

./hadoop-ozone/dev-support/checks/checkstyle.sh

to verify checkstyle issues locally.

jojochuang avatar Jun 19 '25 22:06 jojochuang

Thanks @frankvicky for the patch. Currently there are some integration test failures that slipped into master while CI status reporting was broken. Once issues on master are fixed, we'll update this PR to get real test results.

In the meantime, please take a look at the failure in TestDirectoryDeletingServiceWithFSO.

adoroszlai avatar Jun 20 '25 07:06 adoroszlai

@frankvicky please enable the build-branch workflow in your fork.

adoroszlai avatar Jun 20 '25 15:06 adoroszlai

@adoroszlai: Thanks for the reminder 🙇🏼

frankvicky avatar Jun 20 '25 15:06 frankvicky

TestKeyDeletingService$Normal failed (maybe some flakiness is being introduced)

adoroszlai avatar Jul 07 '25 12:07 adoroszlai

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

github-actions[bot] avatar Nov 11 '25 00:11 github-actions[bot]

@aryangupta1998 @swamirishi can you please help resolve conflicts?

@jojochuang can you please review after conflicts are resolved?

adoroszlai avatar Nov 25 '25 11:11 adoroszlai

This IMO feels like forceful refactoring than a natural code progression. But I agree to the fact the curren code could be structured better. Let me see what we can do here

swamirishi avatar Nov 25 '25 12:11 swamirishi

This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.

github-actions[bot] avatar Dec 18 '25 00:12 github-actions[bot]

Thank you for your contribution. This PR is being closed due to inactivity. If needed, feel free to reopen it.

github-actions[bot] avatar Dec 25 '25 00:12 github-actions[bot]