private DataNodeConfig deepCopyDataNodeConfig(DataNodeConfig dataNodeConfig) {
    String instanceName = ClusterMapUtils.getInstanceName(dataNodeConfig.getHostName(), dataNodeConfig.getPort());
    InstanceConfig instanceConfig = new InstanceConfig(instanceName);
    instanceConfig.setHostName(dataNodeConfig.getHostName());
    instanceConfig.setPort(Integer.toString(dataNodeConfig.getPort()));
    instanceConfig.getRecord().setSimpleField(DATACENTER_STR, dataNodeConfig.getDatacenterName());
    instanceConfig.getRecord().setSimpleField(RACKID_STR, dataNodeConfig.getRackId());
    instanceConfig.getRecord().setSimpleField(SCHEMA_VERSION_STR, Integer.toString(CURRENT_SCHEMA_VERSION));
    instanceConfig.getRecord().setSimpleField(SSL_PORT_STR, Integer.toString(dataNodeConfig.getSslPort()));
    instanceConfig.getRecord().setSimpleField(HTTP2_PORT_STR, Integer.toString(dataNodeConfig.getHttp2Port()));
    instanceConfig.getRecord().setSimpleField(XID_STR, Long.toString(dataNodeConfig.getXid()));
    Map<String, Map<String, String>> mountPathToDiskInfos = new TreeMap<>();
    for (Map.Entry<String, DataNodeConfig.DiskConfig> entry : dataNodeConfig.getDiskConfigs().entrySet()) {
      String mountPath = entry.getKey();
      DataNodeConfig.DiskConfig diskConfig = entry.getValue();
      StringBuilder replicaStrBuilder = new StringBuilder();
      for (Map.Entry<String, DataNodeConfig.ReplicaConfig> replicaEntry : diskConfig.getReplicaConfigs().entrySet()) {
        DataNodeConfig.ReplicaConfig replicaConfig = replicaEntry.getValue();
        replicaStrBuilder.append(replicaEntry.getKey())
            .append(REPLICAS_STR_SEPARATOR)
            .append(replicaConfig.getReplicaCapacityInBytes())
            .append(REPLICAS_STR_SEPARATOR)
            .append(replicaConfig.getPartitionClass())
            .append(REPLICAS_DELIM_STR);
      }
      Map<String, String> diskInfo = new HashMap<>();
      diskInfo.put(REPLICAS_STR, replicaStrBuilder.toString());
      diskInfo.put(DISK_CAPACITY_STR, String.valueOf(diskConfig.getDiskCapacityInBytes()));
      diskInfo.put(DISK_STATE, AVAILABLE_STR);
      mountPathToDiskInfos.put(mountPath, diskInfo);
    }
    instanceConfig.getRecord().setMapFields(mountPathToDiskInfos);
    instanceConfig.getRecord().setListField(SEALED_STR, new ArrayList<>(dataNodeConfig.getSealedReplicas()));
    instanceConfig.getRecord().setListField(PARTIALLY_SEALED_STR, new ArrayList<>(dataNodeConfig.getSealedReplicas()));
    instanceConfig.getRecord().setListField(STOPPED_REPLICAS_STR, new ArrayList<>(dataNodeConfig.getStoppedReplicas()));
    instanceConfig.getRecord()
        .setListField(DISABLED_REPLICAS_STR, new ArrayList<>(dataNodeConfig.getDisabledReplicas()));
    return instanceConfigConverter.convert(instanceConfig);
  }
Deep copy a {@link DataNodeConfig}.
@param dataNodeConfig {@link DataNodeConfig} to copy
@return {@link InstanceConfig} of given data node.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/HelixParticipantTest.java