public synchronized boolean belongsToDataNode(int dataNodeId) {
    return replicaSet.getDataNodeLocations().stream()
        .anyMatch(dataNodeLocation -> dataNodeLocation.getDataNodeId() == dataNodeId);
  }
Check if the RegionGroup belongs to the specified DataNode.

@param dataNodeId The specified DataNodeId.
@return True if the RegionGroup belongs to the specified DataNode.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/RegionGroup.java