public synchronized void updateDataNode(TDataNodeLocation newDataNodeLocation) {
    for (int i = 0; i < replicaSet.getDataNodeLocationsSize(); i++) {
      if (replicaSet.getDataNodeLocations().get(i).getDataNodeId()
          == newDataNodeLocation.getDataNodeId()) {
        replicaSet.getDataNodeLocations().set(i, newDataNodeLocation);
        return;
      }
    }
  }
Update the DataNodeLocation in TRegionReplicaSet if necessary.

@param newDataNodeLocation The new DataNodeLocation.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/RegionGroup.java