public boolean isDataNodeContainsRegion(int dataNodeId, TConsensusGroupId regionId) {
    return getAllReplicaSets(dataNodeId).stream()
        .anyMatch(tRegionReplicaSet -> tRegionReplicaSet.getRegionId().equals(regionId));
  }
Only leader use this interface.

@param database The specified Database
@param regionGroupIds The specified RegionGroupIds
@return All Regions' RegionReplicaSet of the specified Database
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java