public static String adaptLoopbackAddress(String hostname) {
    if (LOOPBACK_ADDRESS_IPV4.equals(hostname) || LOOPBACK_ADDRESSES_IPV6.contains(hostname)) {
      // The provided address is a loopback address, return the loopback address for the active IP stack
      return resolveLoopbackAddress();
    } else {
      return hostname;
    }
  }
Adapts provided loopback address for the active IP Stack. If the provided is IPv4 loopback address, and the
active stack is IPv6, returns IPv6 loopback address, and vice versa. If the provided address is not a loopback
address, returns back provided address.
@param hostname An ip address or hostname
@return the updated wildcard address or the provided address
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/common/IPStackUtils.java