peterxcli commented on code in PR #8610:
URL: https://github.com/apache/ozone/pull/8610#discussion_r2144416654
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DiskBalancerManager.java:
##########
@@ -107,7 +108,21 @@ public List<HddsProtos.DatanodeDiskBalancerInfoProto>
getDiskBalancerStatus(
List<DatanodeDetails> filterDns = null;
if (hosts.isPresent() && !hosts.get().isEmpty()) {
filterDns = NodeUtils.mapHostnamesToDatanodes(nodeManager, hosts.get(),
- useHostnames);
+ useHostnames).stream()
+ .filter(dn -> {
+ try {
+ NodeStatus nodeStatus = nodeManager.getNodeStatus(dn);
+ if (nodeStatus != NodeStatus.inServiceHealthy()) {
+ LOG.warn("Datanode {} is not in optimal state for disk
balancing." +
+ " Operational state: {}", dn.getHostName(),
nodeStatus.getOperationalState());
Review Comment:
Thanks for working on the test,
To create **not** InServceHealthy nodes, you can refer to:
1.
https://github.com/apache/ozone/blob/232d133e3be61db15612f3cbee328423f441b10d/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/safemode/TestHealthyPipelineSafeModeRule.java#L122-L125
2.
https://github.com/apache/ozone/blob/232d133e3be61db15612f3cbee328423f441b10d/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java#L213-L240
But for setting the node operational state, they haven't been implemented
yet...
https://github.com/apache/ozone/blob/232d133e3be61db15612f3cbee328423f441b10d/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/MockNodeManager.java#L483-L502
--
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]