void updateErrorStatsFromDistributor(int distributorIndex, ContentClusterErrorStats updatedErrorStats) {
        if (!distributors.contains(distributorIndex)) {
            return;
        }
        // This does _not_ remove the distributor from `nonUpdatedDistributors` since this
        // method will be called even if the distributor has not yet converged to the newest
        // cluster state.
        // It also does not implicitly put an entry into the `distributorToStats` mapping; error
        // stats are kept entirely separate.
        ContentClusterErrorStats prevErrorStats = distributorToErrorStats.put(distributorIndex, updatedErrorStats);
        for (var contentNodeEntry : aggregatedErrorStats.contentNodeErrorStats().entrySet()) {
            var nodeIndex   = contentNodeEntry.getKey();
            var contentNode = contentNodeEntry.getValue();
            ContentNodeErrorStats statsToAdd = updatedErrorStats.getNodeErrorStats(nodeIndex);
            if (statsToAdd != null) {
                contentNode.addErrorStatsFrom(distributorIndex, statsToAdd);
            }
            if (prevErrorStats != null) {
                ContentNodeErrorStats statsToSubtract = prevErrorStats.getNodeErrorStats(nodeIndex);
                if (statsToSubtract != null) {
                    contentNode.subtractErrorStatsFrom(distributorIndex, statsToSubtract);
                }
            }
        }
    }
Update the aggregator with the newest available stats from a distributor.
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ClusterStatsAggregator.java