int getReplicaCountForStateInResource(ReplicaState state, String resource) {
    ExternalView externalView;
    if (clusterMapConfig.clusterMapUseAggregatedView) {
      externalView = globalResourceToExternalView.get(resource);
    } else {
      externalView = dcToResourceToExternalView.get(clusterMapConfig.clusterMapDatacenterName).get(resource);
    }
    if (externalView == null) {
      return 0;
    }
    return getReplicaCountForStateInExternalView(state, externalView, clusterMapConfig.clusterMapUseAggregatedView);
  }
Callback method when this data node is becoming SEMI AUTO from FULL AUTO.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixClusterManager.java