managed/src/main/java/com/yugabyte/yw/common/PlacementInfoUtil.java
// Helper API to catch duplicated node names in the given set of nodes.
Helper API to catch duplicated node names in the given set of nodes.
Helper API to catch duplicated node names in the given set of nodes .
public static void ensureUniqueNodeNames(Collection<NodeDetails> nodes) throws RuntimeException {
    boolean foundDups = false;
    Set<String> nodeNames = new HashSet<String>();
    for (NodeDetails node : nodes) {
      if (nodeNames.contains(node.nodeName)) {
        LOG.error("Duplicate nodeName {}.", node.nodeName);
        foundDups = true;
      } else {
        nodeNames.add(node.nodeName);
      }
    }
    if (foundDups) {
      throw new RuntimeException("Found duplicated node names, error info in logs just above.");
    }
  }
public static void ensureUniqueNodeNames ( Collection < NodeDetails > nodes ) throws RuntimeException { boolean foundDups = false ; Set < String > nodeNames = new HashSet < String > ( ) ; for ( NodeDetails node : nodes ) { if ( nodeNames . contains ( node . nodeName ) ) { LOG . error ( "Duplicate nodeName {}." , node . nodeName ) ; foundDups = true ; } else { nodeNames . add ( node . nodeName ) ; } } if ( foundDups ) { throw new RuntimeException ( "Found duplicated node names, error info in logs just above." ) ; } }
Helper API to catch duplicated node names in the given set of nodes.
Helper API to catch duplicated node names in the given set of nodes .