ArafatKhan2198 commented on code in PR #4344:
URL: https://github.com/apache/ozone/pull/4344#discussion_r1137319352
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1026,17 +1032,26 @@ public Map<String, Long> getNodeInfo() {
}
@Override
- public Map<String, List<String>> getNodeStatusInfo() {
- Map<String, List<String>> nodes = new HashMap<>();
+ public Map<String, Map<String, String>> getNodeStatusInfo() {
+ Map<String, Map<String, String>> nodes = new HashMap<>();
for (DatanodeInfo dni : nodeStateManager.getAllNodes()) {
String hostName = dni.getHostName();
+ DatanodeDetails.Port httpPort = dni.getPort(HTTP);
+ DatanodeDetails.Port httpsPort = dni.getPort(HTTPS);
NodeStatus nodestatus = dni.getNodeStatus();
Review Comment:
The code could potentially throw a `NullPointerException` if any of the
variables `nodestatus`, `health`, or `operationalState` are null. Consider
adding null checks for these variables to prevent this from happening.
--
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]