managed/src/main/java/com/yugabyte/yw/common/PlacementInfoUtil.java
/**
   * Helper API to check if the list of regions is the same in existing nodes of the placement
   * and the new userIntent's region list.
   *
   * @param cluster The current user proposed cluster.
   * @param nodes The set of nodes used to compare the current region layout.
   * @return true if the provider or region list changed. false if neither changed.
   */
Helper API to check if the list of regions is the same in existing nodes of the placement
and the new userIntent's region list.

@param cluster The current user proposed cluster.
@param nodes The set of nodes used to compare the current region layout.
@return true if the provider or region list changed. false if neither changed.
Helper API to check if the list of regions is the same in existing nodes of the placement and the new userIntent ' s region list . @param cluster The current user proposed cluster . @param nodes The set of nodes used to compare the current region layout . @return true if the provider or region list changed . false if neither changed .
private static boolean isProviderOrRegionChange(Cluster cluster, Collection<NodeDetails> nodes) {
    if (nodes.isEmpty()) {
      return false;
    }
    UUID intentProvider = getProviderUUID(nodes, cluster.uuid);
    UUID nodeProvider = cluster.placementInfo.cloudList.get(0).uuid;
    if (!intentProvider.equals(nodeProvider)) {
      LOG.info("Provider in intent {} is different from provider in existing nodes {} in cluster {}.",
              intentProvider, nodeProvider, cluster.uuid);
      return true;
    }
    Set<UUID> nodeRegionSet = getAllRegionUUIDs(nodes, cluster.uuid);
    Set<UUID> intentRegionSet = new HashSet<>(cluster.userIntent.regionList);
    LOG.info("Intended Regions {} vs existing Regions {} in cluster {}.",
            intentRegionSet, nodeRegionSet, cluster.uuid);
    return !intentRegionSet.equals(nodeRegionSet);
  }
private static boolean isProviderOrRegionChange ( Cluster cluster , Collection < NodeDetails > nodes ) { if ( nodes . isEmpty ( ) ) { return false ; } UUID intentProvider = getProviderUUID ( nodes , cluster . uuid ) ; UUID nodeProvider = cluster . placementInfo . cloudList . get ( 0 ) . uuid ; if ( ! intentProvider . equals ( nodeProvider ) ) { LOG . info ( "Provider in intent {} is different from provider in existing nodes {} in cluster {}." , intentProvider , nodeProvider , cluster . uuid ) ; return true ; } Set < UUID > nodeRegionSet = getAllRegionUUIDs ( nodes , cluster . uuid ) ; Set < UUID > intentRegionSet = new HashSet < > ( cluster . userIntent . regionList ) ; LOG . info ( "Intended Regions {} vs existing Regions {} in cluster {}." , intentRegionSet , nodeRegionSet , cluster . uuid ) ; return ! intentRegionSet . equals ( nodeRegionSet ) ; }
Helper API to check if the list of regions is the same in existing nodes of the placement
 and the new userIntent's region list.
Helper API to check if the list of regions is the same in existing nodes of the placement and the new userIntent ' s region list .
// Initial state. No nodes have been requested, so nothing has changed. // Compare Providers. // Compare Regions.