public Map<Integer, TDataNodeLocation> getRegisteredDataNodeLocations() {
    Map<Integer, TDataNodeLocation> dataNodeLocations = new ConcurrentHashMap<>();
    nodeInfo
        .getRegisteredDataNodes()
        .forEach(
            dataNodeConfiguration ->
                dataNodeLocations.put(
                    dataNodeConfiguration.getLocation().getDataNodeId(),
                    dataNodeConfiguration.getLocation()));
    return dataNodeLocations;
  }
Only leader use this interface.

<p>Notice: The result will be an empty TDataNodeConfiguration if the specified DataNode doesn't
register

@param dataNodeId The specified DataNode's index
@return The specified registered DataNode
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java