server/src/main/java/org/elasticsearch/health/node/DiskHealthIndicatorService.java
static Set<String> getIndicesForNodes(List<DiscoveryNode> nodes, ClusterState clusterState) {
            RoutingNodes routingNodes = clusterState.getRoutingNodes();
            return nodes.stream()
                .map(node -> routingNodes.node(node.getId()))
                .filter(Objects::nonNull)
                .flatMap(routingNode -> Arrays.stream(routingNode.copyIndices()))
                .map(Index::getName)
                .collect(Collectors.toSet());
        }
        private Diagnosis createNonDataNodeDiagnosis(HealthStatus healthStatus, Collection<DiscoveryNode> nodes, boolean isMaster) {
            return new Diagnosis(
                new Diagnosis.Definition(
                    NAME,
                    isMaster ? "add_disk_capacity_master_nodes" : "add_disk_capacity",
                    healthStatus == HealthStatus.RED ? "Disk is full." : "The cluster is running low on disk space.",
                    "Please add capacity to the current nodes, or replace them with ones with higher capacity.",
                    isMaster ? "https://ela.st/fix-master-disk" : "https://ela.st/fix-disk-space"
                ),
                List.of(new Diagnosis.Resource(nodes))
            );
        }
        private int getUnhealthyNodeSize(Map<HealthStatus, List<DiscoveryNode>> nodes) {
            return (nodes.containsKey(HealthStatus.RED) ? nodes.get(HealthStatus.RED).size() : 0) + (nodes.containsKey(HealthStatus.YELLOW)
                ? nodes.get(HealthStatus.YELLOW).size()
                : 0);
        }
    }
}