During the development and review process of the disk health indicator we noticed that it was hard to understand. Since we learnt a lot from the first round of development we want to go through the code one more time and restructure it.
server/src/main/java/org/elasticsearch/health/node/DiskHealthIndicatorService.java
)
            );
        }
        String unhealthyNonMasterNonDataRoles = unhealthyRoles.stream()
            .filter(role -> role.canContainData() == false && role.equals(DiscoveryNodeRole.MASTER_ROLE) == false)
            .map(DiscoveryNodeRole::roleName)
            .distinct()
            .sorted()
            .collect(Collectors.joining(", "));
        if (unhealthyNonMasterNonDataRoles.isBlank() == false) {
            impacts.add(
                new HealthIndicatorImpact(
                    NAME,
                    IMPACT_CLUSTER_FUNCTIONALITY_UNAVAILABLE_ID,
                    2,
                    String.format(Locale.ROOT, "The [%s] functionality might be impaired.", unhealthyNonMasterNonDataRoles),
                    List.of(ImpactArea.DEPLOYMENT_MANAGEMENT)
                )
            );
        }
        return impacts;
    }
    private List<Diagnosis> getDiagnoses(
        Set<String> indicesWithBlock,
        Set<String> indicesOnRedNodes,
        Set<String> indicesOnYellowNodes,
        Set<String> nodesWithBlockedIndices,
        Set<String> redDataNodes,
        Set<String> yellowDataNodes,
        Set<String> redMasterNodes,