org.apache.hadoop.hbase.util
Class Addressing
java.lang.Object
org.apache.hadoop.hbase.util.Addressing
@InterfaceAudience.Private
public class Addressing
- extends Object
Utility for network addresses, resolving and naming.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VALID_PORT_REGEX
public static final String VALID_PORT_REGEX
- See Also:
- Constant Field Values
HOSTNAME_PORT_SEPARATOR
public static final String HOSTNAME_PORT_SEPARATOR
- See Also:
- Constant Field Values
Addressing
public Addressing()
createInetSocketAddressFromHostAndPortStr
public static InetSocketAddress createInetSocketAddressFromHostAndPortStr(String hostAndPort)
- Parameters:
hostAndPort
- Formatted as <hostname> ':' <port>
- Returns:
- An InetSocketInstance
createHostAndPortStr
public static String createHostAndPortStr(String hostname,
int port)
- Parameters:
hostname
- Server hostnameport
- Server port
- Returns:
- Returns a concatenation of
hostname
and
port
in following
form: <hostname> ':' <port>
. For example, if hostname
is example.org
and port is 1234, this method will return
example.org:1234
parseHostname
public static String parseHostname(String hostAndPort)
- Parameters:
hostAndPort
- Formatted as <hostname> ':' <port>
- Returns:
- The hostname portion of
hostAndPort
parsePort
public static int parsePort(String hostAndPort)
- Parameters:
hostAndPort
- Formatted as <hostname> ':' <port>
- Returns:
- The port portion of
hostAndPort
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.