int getLiveInstanceCount(String resource) {
    return (int) (getAllInstancesForResource(resource).stream()
        .map(instanceNameToAmbryDataNode::get)
        .filter(dn -> dn.getState() == HardwareState.AVAILABLE)
        .count());
  }
Callback method when this data node is becoming SEMI AUTO from FULL AUTO.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixClusterManager.java