kerneltime commented on code in PR #7418:
URL: https://github.com/apache/ozone/pull/7418#discussion_r1849086030
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java:
##########
@@ -579,6 +580,15 @@ public boolean equals(Object obj) {
uuid.equals(((DatanodeDetails) obj).uuid);
}
+
+ public boolean validateNodeValue(DatanodeDetails datanodeDetails) {
Review Comment:
Validation != comparison or equality.
The check here compares if the node passed in matches the current node, and
the checks are quite a few
1. if UUID matched
2. Network path matches
3. Ipaddress, hostname and port match
Why do we need any thing beyond UUID?
```suggestion
public boolean compareNodeValue(DatanodeDetails datanodeDetails) {
```
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/pipeline/Pipeline.java:
##########
@@ -330,7 +330,8 @@ public List<DatanodeDetails> getNodesInOrder() {
}
void reportDatanode(DatanodeDetails dn) throws IOException {
- if (nodeStatus.get(dn) == null) {
+ if (dn == null || (nodeStatus.get(dn) == null
Review Comment:
Which case is this validation expected to catch?
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeDetails.java:
##########
@@ -579,6 +580,15 @@ public boolean equals(Object obj) {
uuid.equals(((DatanodeDetails) obj).uuid);
}
+
+ public boolean validateNodeValue(DatanodeDetails datanodeDetails) {
Review Comment:
Please add a java doc, this method and its intended usage are not clear.
--
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]