@Override
    public Map<String, ClusterReindexing> getReindexingStatus(ModelResult application) throws IOException {
        Map<ClusterId, List<ServiceInfo>> clusters = clusterControllerClusters(application);
        Map<ClusterId, CompletableFuture<Map<String, ClusterReindexing>>> futureStatusPerCluster = new HashMap<>();
        clusters.forEach((clusterId, clusterNodes) -> {
            var parallelRequests = clusterNodes.stream()
                    .map(this::getReindexingStatus)
                    .toList();
            CompletableFuture<Map<String, ClusterReindexing>> combinedRequest = CompletableFutures.firstOf(parallelRequests);
            futureStatusPerCluster.put(clusterId, combinedRequest);
        });

        try {
            Map<String, ClusterReindexing> statusPerCluster = new HashMap<>();
            futureStatusPerCluster.forEach((clusterId, futureStatus) -> {
                statusPerCluster.putAll(futureStatus.join());
            });
            return Map.copyOf(statusPerCluster);
        } catch (Exception e) {
            throw new IOException("Failed to get reindexing status from cluster controllers: " + e.getMessage(), e);
        }
    }
@Test
    public void combines_result_from_multiple_cluster_controller_clusters() throws IOException {
        var client = new DefaultClusterReindexingStatusClient();
        MockApplication app = new MockApplication();
        String uriPath = "/reindexing/v1/status";
        server1.stubFor(get(urlEqualTo(uriPath)).willReturn(serverError()));
        server2.stubFor(get(urlEqualTo(uriPath)).willReturn(okJson(
                "{" +
                "  \"clusters\": {" +
                "    \"cluster1\": {" +
                "      \"documentTypes\": {" +
                "        \"music\": {" +
                "          \"startedMillis\":0," +
                "          \"state\": \"" + ClusterReindexing.State.RUNNING.asString() + "\"" +
                "        }" +
                "      }" +
                "    }" +
                "  }" +
                "}")));
        server3.stubFor(get(urlEqualTo(uriPath)).willReturn(okJson(
                "{" +
                "  \"clusters\": {" +
                "    \"cluster2\": {" +
                "      \"documentTypes\": {" +
                "        \"artist\": {" +
                "          \"startedMillis\":50," +
                "          \"endedMillis\":150," +
                "          \"progress\": 0.5," +
                "          \"state\": \"" + ClusterReindexing.State.SUCCESSFUL.asString() + "\"," +
                "          \"message\":\"success\"" +
                "        }" +
                "      }" +
                "    }" +
                "  }" +
                "}")));
        Map<String, ClusterReindexing> expected = Map.of("cluster1",
                                                         new ClusterReindexing(Map.of("music",
                                                                                      new ClusterReindexing.Status(Instant.ofEpochMilli(0),
                                                                                                                   null,
                                                                                                                   ClusterReindexing.State.RUNNING,
                                                                                                                   null,
                                                                                                                   null))),
                                                         "cluster2",
                                                         new ClusterReindexing(Map.of("artist",
                                                                                      new ClusterReindexing.Status(Instant.ofEpochMilli(50),
                                                                                                                   Instant.ofEpochMilli(150),
                                                                                                                   ClusterReindexing.State.SUCCESSFUL,
                                                                                                                   "success",
                                                                                                                   0.5))));
        Map<String, ClusterReindexing> result = client.getReindexingStatus(app);
        assertEquals(expected, result);
    }