Package org.apache.accumulo.core.util
Class AddressUtil
- java.lang.Object
-
- org.apache.accumulo.core.util.AddressUtil
-
public class AddressUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description AddressUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getAddressCacheNegativeTtl(UnknownHostException originalException)
Fetch the security value that determines how long DNS failures are cached.static HostAndPort
parseAddress(String address, boolean ignoreMissingPort)
static HostAndPort
parseAddress(String address, int defaultPort)
-
-
-
Method Detail
-
parseAddress
public static HostAndPort parseAddress(String address, boolean ignoreMissingPort) throws NumberFormatException
- Throws:
NumberFormatException
-
parseAddress
public static HostAndPort parseAddress(String address, int defaultPort)
-
getAddressCacheNegativeTtl
public static int getAddressCacheNegativeTtl(UnknownHostException originalException)
Fetch the security value that determines how long DNS failures are cached. Looks up the security property 'networkaddress.cache.negative.ttl'. Should that fail returns the default value used in the Oracle JVM 1.4+, which is 10 seconds.- Parameters:
originalException
- the host lookup that is the source of needing this lookup. maybe be null.- Returns:
- positive integer number of seconds
- Throws:
IllegalArgumentException
- if dns failures are cached forever- See Also:
InetAddress
-
-