@Override
  public boolean setReplicaSealedState(ReplicaId replicaId, ReplicaSealStatus replicaSealStatus) {
    if (!(replicaId instanceof AmbryReplica)) {
      throw new IllegalArgumentException(
          "HelixParticipant only works with the AmbryReplica implementation of ReplicaId");
    }
    synchronized (helixAdministrationLock) {
      DataNodeConfig config = getDataNodeConfig();
      String partitionId = replicaId.getPartitionId().toPathString();
      boolean success = false;
      boolean configChanged;
      switch (replicaSealStatus) {
        case NOT_SEALED:
          configChanged = config.getSealedReplicas().remove(partitionId);
          configChanged = config.getPartiallySealedReplicas().remove(partitionId) || configChanged;
          if (configChanged) {
            logger.trace("Removing partition {} from sealed lists to mark it as NOT_SEALED", partitionId);
            success = dataNodeConfigSource.set(config);
          }
          break;
        case PARTIALLY_SEALED:
          configChanged = config.getPartiallySealedReplicas().add(partitionId);
          configChanged = config.getSealedReplicas().remove(partitionId) || configChanged;
          if (configChanged) {
            logger.trace("Adding the partition {} to partially sealed list to mark it as PARTIALLY_SEALED",
                partitionId);
            success = dataNodeConfigSource.set(config);
          }
          break;
        case SEALED:
          configChanged = config.getSealedReplicas().add(partitionId);
          configChanged = config.getPartiallySealedReplicas().remove(partitionId) || configChanged;
          if (configChanged) {
            logger.trace("Adding the partition {} to sealedReplicas list", partitionId);
            success = dataNodeConfigSource.set(config);
          }
          break;
      }
      logger.trace("Set sealed state of partition {} is completed", partitionId);
      return success;
    }
  }
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