HDDS-10507. Use equals() instead of == for nodes in NetworkTopology#6368
HDDS-10507. Use equals() instead of == for nodes in NetworkTopology#6368adoroszlai merged 8 commits intoapache:masterfrom
Conversation
|
@adoroszlai, @ChenSammi could you please review the changes? Thanks. |
|
cc: @kerneltime could you also please take a look, thanks. |
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @tanvipenumudy for the patch. Please use java.utils.Objects#equals for null-safe equals instead of reimplementing it. (Added one suggestion, but also applies to other parts of the change.)
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/net/NetworkTopologyImpl.java
Outdated
Show resolved
Hide resolved
…t/NetworkTopologyImpl.java Co-authored-by: Doroszlai, Attila <6454655+adoroszlai@users.noreply.github.com>
|
Thank you @adoroszlai for the review, I have simplified the patch as suggested utilizing: |
|
Thanks @tanvipenumudy for updating the patch, LGTM. If you don't want to wait for @kerneltime's review, it can be merged. |
|
Sure, I believe we can check in the change, thank you @adoroszlai for the review! |
|
Thanks @tanvipenumudy for the patch, @dineshchitlangia for the review. |
…pache#6368) (cherry picked from commit a73fb37)
…rkTopology (apache#6368) (cherry picked from commit a73fb37)
What changes were proposed in this pull request?
NetworkTopologyclass, various operations employ the==/!=operator for comparison.InnerNode#equalsmethod instead. This adjustment is required as certain use cases, as described in1., 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