@Override
  public boolean resetPartitionState(List<String> partitionNames) {
    boolean result = true;
    List<String> succeededPartitions = new ArrayList<>();
    try {
      Map<String, List<String>> resourceNameToPartitionNames = new HashMap<>();
      for (String partitionName : partitionNames) {
        String resourceName = getResourceNameOfPartition(helixAdmin, clusterName, partitionName);
        if (resourceName == null) {
          logger.error("Can't find resource for partition {} when resetting the list of partition states",
              partitionName);
          return false;
        }
        resourceNameToPartitionNames.computeIfAbsent(resourceName, k -> new ArrayList()).add(partitionName);
      }
      for (Map.Entry<String, List<String>> entry : resourceNameToPartitionNames.entrySet()) {
        String resourceName = entry.getKey();
        List<String> partitions = entry.getValue();
        helixAdmin.resetPartition(clusterName, instanceName, resourceName, partitions);
        succeededPartitions.addAll(partitions);
      }
    } catch (Exception e) {
      logger.error("Exception occurred when resetting partition {}, succeeded partitions are {}", partitionNames,
          succeededPartitions, e);
      result = false;
    }
    return result;
  }
@return a snapshot of registered state change listeners.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixParticipant.java