managed/src/main/java/com/yugabyte/yw/common/PlacementInfoUtil.java
/**
   * Configures the state of the nodes that need to be created or the ones to be removed.
   *
   * @param taskParams the taskParams for the Universe to be configured.
   * @param universe   the current universe if it exists (only when called during edit universe).
   * @param mode       mode in which to configure with user specified AZ's or round-robin (default).
   *
   * @return set of node details with their placement info filled in.
   */
Configures the state of the nodes that need to be created or the ones to be removed.
@param taskParams the taskParams for the Universe to be configured.
@param universe   the current universe if it exists (only when called during edit universe).
@param mode       mode in which to configure with user specified AZ's or round-robin (default).

@return set of node details with their placement info filled in.
Configures the state of the nodes that need to be created or the ones to be removed . @param taskParams the taskParams for the Universe to be configured . @param universe the current universe if it exists ( only when called during edit universe ) . @param mode mode in which to configure with user specified AZ ' s or round - robin ( default ) . @return set of node details with their placement info filled in .
private static void configureNodeStates(UniverseDefinitionTaskParams taskParams,
                                          Universe universe,
                                          PlacementInfoUtil.ConfigureNodesMode mode,
                                          Cluster cluster) {
    switch (mode) {
      case NEW_CONFIG:
        configureDefaultNodeStates(cluster, taskParams.nodeDetailsSet, universe);
        updatePlacementInfo(taskParams.getNodesInCluster(cluster.uuid), cluster.placementInfo);
        break;
      case UPDATE_CONFIG_FROM_PLACEMENT_INFO:
        configureNodesUsingPlacementInfo(cluster, taskParams.nodeDetailsSet, universe != null);
        break;
      case UPDATE_CONFIG_FROM_USER_INTENT:
        configureNodesUsingUserIntent(cluster, taskParams.nodeDetailsSet, universe != null);
        updatePlacementInfo(taskParams.getNodesInCluster(cluster.uuid), cluster.placementInfo);
        break;
      case NEW_CONFIG_FROM_PLACEMENT_INFO:
        configureNodeEditUsingPlacementInfo(taskParams);
    }
    removeUnusedPlacementAZs(cluster.placementInfo);
    LOG.info("Set of nodes after node configure: {}.", taskParams.nodeDetailsSet);
    LOG.info("Placement info: {}.", cluster.placementInfo);
    finalSanityCheckConfigure(cluster, taskParams.getNodesInCluster(cluster.uuid));
  }
private static void configureNodeStates ( UniverseDefinitionTaskParams taskParams , Universe universe , PlacementInfoUtil . ConfigureNodesMode mode , Cluster cluster ) { switch ( mode ) { case NEW_CONFIG : configureDefaultNodeStates ( cluster , taskParams . nodeDetailsSet , universe ) ; updatePlacementInfo ( taskParams . getNodesInCluster ( cluster . uuid ) , cluster . placementInfo ) ; break ; case UPDATE_CONFIG_FROM_PLACEMENT_INFO : configureNodesUsingPlacementInfo ( cluster , taskParams . nodeDetailsSet , universe != null ) ; break ; case UPDATE_CONFIG_FROM_USER_INTENT : configureNodesUsingUserIntent ( cluster , taskParams . nodeDetailsSet , universe != null ) ; updatePlacementInfo ( taskParams . getNodesInCluster ( cluster . uuid ) , cluster . placementInfo ) ; break ; case NEW_CONFIG_FROM_PLACEMENT_INFO : configureNodeEditUsingPlacementInfo ( taskParams ) ; } removeUnusedPlacementAZs ( cluster . placementInfo ) ; LOG . info ( "Set of nodes after node configure: {}." , taskParams . nodeDetailsSet ) ; LOG . info ( "Placement info: {}." , cluster . placementInfo ) ; finalSanityCheckConfigure ( cluster , taskParams . getNodesInCluster ( cluster . uuid ) ) ; }
Configures the state of the nodes that need to be created or the ones to be removed.
Configures the state of the nodes that need to be created or the ones to be removed .
// This case covers create universe and full move edit. // The case where there are custom expand/shrink in the placement info. // Case where userIntent numNodes has to be favored - as it is different from the // sum of all per AZ node counts).