static IdealState buildIdealState(String resource, Set<String> partitionSet,
      IdealStateConfigFields idealStateConfigFields) {
    FullAutoModeISBuilder builder = new FullAutoModeISBuilder(resource);
    builder.setStateModel(idealStateConfigFields.getStateModelDefRef());
    for (String partition : partitionSet) {
      builder.add(partition);
    }
    if (isDelayedRebalanceEnabled(idealStateConfigFields.getRebalancerClassName())) {
      builder.setMinActiveReplica(idealStateConfigFields.getMinActiveReplicas());
      builder.setRebalanceDelay((int) TimeUnit.MINUTES.toMillis(idealStateConfigFields.getRebalanceDelayInMins()));
      builder.setRebalancerClass(idealStateConfigFields.getRebalancerClassName());
    }
    builder.setRebalanceStrategy(idealStateConfigFields.getRebalanceStrategy());
    return builder.build();
  }
Build the IdealState for the specified resource.
@param resource the Helix resource name.
@param partitionSet the set of partitions managed by the resource.
@param idealStateConfigFields {@link IdealStateConfigFields} object containing the ideal state configs.
@return the {@link IdealState}.
ambry-commons/src/main/java/com/github/ambry/clustermap/HelixVcrUtil.java