private static Map<String, ClusterReindexing> toClusterReindexing(byte[] requestBody) throws IOException {
        JsonNode jsonNode = Jackson.mapper().readTree(requestBody);
        Map<String, ClusterReindexing> clusters = new HashMap<>();
        for (var clusterNames = jsonNode.get("clusters").fieldNames(); clusterNames.hasNext(); ) {
            String clusterName = clusterNames.next();
            JsonNode clusterJson = jsonNode.get("clusters").get(clusterName);
            Map<String, ClusterReindexing.Status> documentStatuses = new HashMap<>();
            for (var documentTypes = clusterJson.get("documentTypes").fieldNames(); documentTypes.hasNext(); ) {
                String type = documentTypes.next();
                JsonNode statusJson = clusterJson.get("documentTypes").get(type);
                Instant startedMillis = Instant.ofEpochMilli(statusJson.get("startedMillis").longValue());
                Instant endedMillis = Optional.ofNullable(statusJson.get("endedMillis"))
                                              .map(json -> Instant.ofEpochMilli(json.longValue()))
                                              .orElse(null);
                Double progress = Optional.ofNullable(statusJson.get("progress"))
                                          .map(JsonNode::doubleValue)
                                          .orElse(null);
                ClusterReindexing.State state = Optional.ofNullable(statusJson.get("state"))
                                                        .map(json -> ClusterReindexing.State.fromString(json.textValue()))
                                                        .orElse(null);
                String message = Optional.ofNullable(statusJson.get("message"))
                                         .map(JsonNode::textValue)
                                         .orElse(null);
                documentStatuses.put(type, new ClusterReindexing.Status(startedMillis, endedMillis, state, message, progress));
            }
            clusters.put(clusterName, new ClusterReindexing(documentStatuses));
        }
        return Map.copyOf(clusters);
    }
Retrieves reindexing status from cluster controllers over HTTP

@author bjorncs
configserver/src/main/java/com/yahoo/vespa/config/server/application/DefaultClusterReindexingStatusClient.java