public static boolean containsLocalAddress(List<String> addressesOrHostNames)
      throws UnknownHostException {
    if (addressesOrHostNames == null) {
      return false;
    }

    Set<String> selfAddresses = getAllLocalAddresses();

    for (String addressOrHostName : addressesOrHostNames) {
      if (addressOrHostName == null) {
        continue;
      }
      // Unify address or hostName, converting them to addresses
      Set<String> translatedAddresses =
          Arrays.stream(InetAddress.getAllByName(addressOrHostName))
              .map(InetAddress::getHostAddress)
              .collect(Collectors.toCollection(HashSet::new));
      translatedAddresses.retainAll(selfAddresses);

      if (!translatedAddresses.isEmpty()) {
        return true;
      }
    }

    return false;
  }
Detect whether the given addresses or host names(may contain both) point to the node itself.

@param addressesOrHostNames List of the addresses or host name to check
@return true if one of the given strings point to the node itself
@throws UnknownHostException Throw when unable to parse the given addresses or host names
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/NodeUrlUtils.java