private void computeInitialDbLoad(
      Map<String, List<TRegionReplicaSet>> databaseAllocatedRegionGroupMap) {
    initialDbLoad = new HashMap<>();

    // Iterate over each database and count the number of regions on each data node across all its
    // replica sets.
    for (String database : databaseAllocatedRegionGroupMap.keySet()) {
      List<TRegionReplicaSet> replicaSets = databaseAllocatedRegionGroupMap.get(database);
      int[] load = new int[regionCounter.length];
      for (TRegionReplicaSet replicaSet : replicaSets) {
        for (TDataNodeLocation location : replicaSet.getDataNodeLocations()) {
          int nodeId = location.getDataNodeId();
          load[nodeId]++;
        }
      }
      initialDbLoad.put(database, load);
    }
  }
Compute the initial load for each database on each data node.

@param databaseAllocatedRegionGroupMap Mapping of each database to its list of replica sets.
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/region/GreedyCopySetRegionGroupAllocator.java