int getResourceTotalDiskCapacityUsage(String resource) {
    // call this method to fill up the partition capacity map from resource config
    String dcName = clusterMapConfig.clusterMapDatacenterName;
    getResourceConfig(resource, dcName);
    ExternalView externalView;
    if (clusterMapConfig.clusterMapUseAggregatedView) {
      externalView = globalResourceToExternalView.get(resource);
    } else {
      externalView = dcToResourceToExternalView.get(dcName).get(resource);
    }
    if (externalView == null) {
      return 0;
    }
    int result = 0;
    for (String partition : externalView.getPartitionSet()) {
      Map<String, String> states = externalView.getStateMap(partition);
      int weight = getPartitionDiskWeight(partition);
      if (!states.isEmpty()) {
        int numReplica;
        if (clusterMapConfig.clusterMapUseAggregatedView) {
          numReplica = (int) states.keySet().stream().filter(instance -> {
            AmbryDataNode dataNode = instanceNameToAmbryDataNode.get(instance);
            return dataNode != null && dataNode.getDatacenterName().equals(clusterMapConfig.clusterMapDatacenterName);
          }).count();
        } else {
          numReplica = states.size();
        }
        result += numReplica * weight;
      }
    }
    return result;
  }
Callback method when this data node is becoming SEMI AUTO from FULL AUTO.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixClusterManager.java