public static Collection<InetAddress> toInetAddresses(Collection<String> addrs,Collection<String> hostNames) throws IgniteCheckedException {
  Set<InetAddress> res=new HashSet<>(addrs.size());
  Iterator<String> hostNamesIt=hostNames.iterator();
  for (  String addr : addrs) {
    String hostName=hostNamesIt.hasNext() ? hostNamesIt.next() : null;
    InetAddress inetAddr=null;
    if (!F.isEmpty(hostName)) {
      try {
        inetAddr=InetAddress.getByName(hostName);
      }
 catch (      UnknownHostException ignored) {
      }
    }
    if (inetAddr == null || inetAddr.isLoopbackAddress()) {
      try {
        inetAddr=InetAddress.getByName(addr);
      }
 catch (      UnknownHostException ignored) {
      }
    }
    if (inetAddr != null)     res.add(inetAddr);
  }
  if (res.isEmpty())   throw new IgniteCheckedException("Addresses can not be resolved [addr=" + addrs + ", hostNames="+ hostNames+ ']');
  return res;
}

public static Collection < InetAddress > toInetAddresses ( Collection < String > addrs , Collection < String > hostNames ) throws IgniteCheckedException { Set < InetAddress > res = new HashSet < > ( addrs . size ( ) ) ; Iterator < String > hostNamesIt = hostNames . iterator ( ) ; for ( String addr : addrs ) { String hostName = hostNamesIt . hasNext ( ) ? hostNamesIt . next ( ) : null ; InetAddress inetAddr = null ; if ( ! F . isEmpty ( hostName ) ) { try { inetAddr = InetAddress . getByName ( hostName ) ; } catch ( UnknownHostException ignored ) { } } if ( inetAddr == null || inetAddr . isLoopbackAddress ( ) ) { try { inetAddr = InetAddress . getByName ( addr ) ; } catch ( UnknownHostException ignored ) { } } if ( inetAddr != null ) res . add ( inetAddr ) ; } if ( res . isEmpty ( ) ) throw new IgniteCheckedException ( "Addresses can not be resolved [addr=" + addrs + ", hostNames=" + hostNames + ']' ) ; return res ; }
returns tha list of resolved inet addresses . first addresses are resolved by host names , if this attempt fails then the addresses are resolved by ip addresses .
