@Override
  public boolean setReplicaStoppedState(List<ReplicaId> replicaIds, boolean markStop) {
    Set<String> replicasToUpdate = new HashSet<>();
    for (ReplicaId replicaId : replicaIds) {
      if (!(replicaId instanceof AmbryReplica)) {
        throw new IllegalArgumentException(
            "HelixParticipant only works with the AmbryReplica implementation of ReplicaId");
      }
      replicasToUpdate.add(replicaId.getPartitionId().toPathString());
    }
    boolean setStoppedResult;
    synchronized (helixAdministrationLock) {
      logger.info("Getting stopped replicas from Helix");
      DataNodeConfig config = getDataNodeConfig();
      boolean stoppedSetUpdated = markStop ? config.getStoppedReplicas().addAll(replicasToUpdate)
          : config.getStoppedReplicas().removeAll(replicasToUpdate);
      if (stoppedSetUpdated) {
        logger.info("Updating the stopped list in Helix to {}", config.getStoppedReplicas());
        setStoppedResult = dataNodeConfigSource.set(config);
      } else {
        logger.info("No replicas should be added or removed, no need to update the stopped list");
        setStoppedResult = true;
      }
    }
    return setStoppedResult;
  }
Initiate the participation by registering via the {@link HelixManager} as a participant to the associated
Helix cluster.
@throws IOException if there is an error connecting to the Helix cluster.
@param ambryStatsReports {@link List} of {@link AmbryStatsReport} to be registered to the participant.
@param accountStatsStore the {@link AccountStatsStore} to retrieve and store container stats.
@param callback a callback which will be invoked when the aggregation report has been generated successfully.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixParticipant.java