private int[] getCurrentMetrics(
      int[] additionalLoad, int currentScatter, int[] currentAssignment) {
    int currentMaxGlobalLoad = 0;
    // Calculate the maximum global load across all data nodes.
    for (int nodeId = 0; nodeId < additionalLoad.length; nodeId++) {
      int globalLoad = regionCounter[nodeId] + additionalLoad[nodeId];
      currentMaxGlobalLoad = Math.max(currentMaxGlobalLoad, globalLoad);
    }
    // Compute the database load squared sum using the helper method.
    int dbLoadSquaredSum =
        computeDatabaseLoadSquaredSum(currentAssignment, dfsRegionKeys, regionDatabaseMap);
    // Build current metrics in order [maxGlobalLoad, maxDatabaseLoad, scatterValue]
    return new int[] {currentMaxGlobalLoad, dbLoadSquaredSum, currentScatter};
  }
Computes the current migration metrics.

<p>This method calculates three key metrics:

<ol>
  <li><strong>Max Global Load:</strong> The maximum load among all nodes, computed as the sum
      of the initial region load (from {@code regionCounter}) and the additional load (from
      {@code additionalLoad}).
  <li><strong>Database Load Squared Sum:</strong> The squared sum of the maximum load per
      database, which is computed by {@link #computeDatabaseLoadSquaredSum(int[], List, Map)}.
  <li><strong>Scatter Value:</strong> A provided metric that reflects additional balancing
      criteria.
</ol>

The metrics are returned as an array of three integers in the order: [maxGlobalLoad,
databaseLoadSquaredSum, scatterValue].

@param additionalLoad an array representing the additional load assigned to each node during
    migration.
@param currentScatter the current scatter value metric.
@param currentAssignment an array where each element is the nodeId assigned for the
    corresponding region in {@code regionKeys}.
@return an integer array of size 3: [maxGlobalLoad, databaseLoadSquaredSum, scatterValue].
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/balancer/region/GreedyCopySetRegionGroupAllocator.java