ZanderXu commented on PR #4661:
URL: https://github.com/apache/hadoop/pull/4661#issuecomment-1201945547
@ayushtkn Thank you very much for helping me review it.
Yes, you are right, we should return an empty value for this case. How about
change it same with `getDiskBalancerStatus`, such as:
```
@Override // DataNodeMXBean
public String getVolumeInfo() {
if (data == null) {
LOG.debug("Storage not yet initialized.");
return ""; // it's different with JSON.toString(new HashMap<String,
Object>())
}
return JSON.toString(data.getVolumeInfoMap());
}
```
Developers or SREs are very sensitive to NPE, so I feel we shouldn't out put
it in this expected situation.
> Extra Stuff: This log line just below is wrong, incorrect placeholder, can
fix in a separate jira if interested. :-)
Copy, sir. I will fix it in a separate Jira.
--
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]