private void registerIdealStateChangeListener(String dcName) throws Exception {
    String zkConnectStr = dataCenterToZkAddress.get(dcName).getZkConnectStrs().get(0);
    HelixManager manager =
        helixFactory.getZkHelixManagerAndConnect(clusterMapConfig.clusterMapClusterName, selfInstanceName,
            InstanceType.SPECTATOR, zkConnectStr, clusterMapConfig);
    manager.addIdealStateChangeListener(
        (IdealStateChangeListener) (idealState, changeContext) -> clusterChangeHandler.handleIdealStateChange(
            idealState, dcName));
    logger.info("Registered ideal state change listeners for cluster {} via Helix manager at {}",
        clusterMapConfig.clusterMapClusterName, zkConnectStr);
  }
Register for ideal state changes from a given data center.
@param dcName data center for which we are interested in ideal state changes.
@throws Exception
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixAggregatedViewClusterInitializer.java