managed/src/main/java/com/yugabyte/yw/common/PlacementInfoUtil.java
/**
   * Find a node which has tservers only to decommission, from the given AZ.
   * Node should be an active T-Server and should not be Master.
   * @param nodes   the list of nodes from which to choose the victim.
   * @param targetAZUuid AZ in which the node should be present.
   */
Find a node which has tservers only to decommission, from the given AZ.
Node should be an active T-Server and should not be Master.
@param nodes   the list of nodes from which to choose the victim.
@param targetAZUuid AZ in which the node should be present.
Find a node which has tservers only to decommission from the given AZ . Node should be an active T - Server and should not be Master . @param nodes the list of nodes from which to choose the victim . @param targetAZUuid AZ in which the node should be present .
private static void decommissionNodeInAZ(Collection<NodeDetails> nodes,
                                           UUID targetAZUuid) {
    NodeDetails nodeDetails = findActiveTServerOnlyInAz(nodes, targetAZUuid);
    if (nodeDetails == null) {
      LOG.error("Could not find an active node running tservers only in AZ {}. All nodes: {}.",
                targetAZUuid, nodes);
      throw new IllegalStateException("Should find an active running tserver.");
    } else {
      nodeDetails.state = NodeDetails.NodeState.ToBeRemoved;
      LOG.debug("Removing node [{}].", nodeDetails);
    }
  }
private static void decommissionNodeInAZ ( Collection < NodeDetails > nodes , UUID targetAZUuid ) { NodeDetails nodeDetails = findActiveTServerOnlyInAz ( nodes , targetAZUuid ) ; if ( nodeDetails == null ) { LOG . error ( "Could not find an active node running tservers only in AZ {}. All nodes: {}." , targetAZUuid , nodes ) ; throw new IllegalStateException ( "Should find an active running tserver." ) ; } else { nodeDetails . state = NodeDetails . NodeState . ToBeRemoved ; LOG . debug ( "Removing node [{}]." , nodeDetails ) ; } }
Find a node which has tservers only to decommission, from the given AZ.
Find a node which has tservers only to decommission from the given AZ .