ozone icon indicating copy to clipboard operation
ozone copied to clipboard

HDDS-10507. Revise NetworkTopology-based use cases to leverage custom equals() method

Open tanvipenumudy opened this issue 1 year ago • 2 comments

What changes were proposed in this pull request?

  1. The changes introduced in PR: #5391 involve reconstructing the hierarchical cluster tree object (that represents the network topology) on the Ozone Manager side.
  2. Under the NetworkTopology class, various operations employ the ==/!= operator for comparison.
  3. However, this comparator needs to be modified to utilize the InnerNode#equals method instead. This adjustment is required as certain use cases, as described in 1., involve object reconstruction necessitating custom equality comparisons based on individual object attributes.

What is the link to the Apache JIRA

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

How was this patch tested?

Existing tests should cover the changes, Green Git CI: https://github.com/tanvipenumudy/ozone/actions/runs/8433408560

tanvipenumudy avatar Mar 12 '24 07:03 tanvipenumudy

@adoroszlai, @ChenSammi could you please review the changes? Thanks.

tanvipenumudy avatar Mar 26 '24 12:03 tanvipenumudy

cc: @kerneltime could you also please take a look, thanks.

tanvipenumudy avatar Mar 28 '24 04:03 tanvipenumudy

Thank you @adoroszlai for the review, I have simplified the patch as suggested utilizing: java.utils.Objects#equals.

tanvipenumudy avatar Apr 01 '24 09:04 tanvipenumudy

Thanks @tanvipenumudy for updating the patch, LGTM. If you don't want to wait for @kerneltime's review, it can be merged.

adoroszlai avatar Apr 01 '24 13:04 adoroszlai

Sure, I believe we can check in the change, thank you @adoroszlai for the review!

tanvipenumudy avatar Apr 02 '24 04:04 tanvipenumudy

Thanks @tanvipenumudy for the patch, @dineshchitlangia for the review.

adoroszlai avatar Apr 02 '24 05:04 adoroszlai