org.apache.hadoop.hbase.util
Class Addressing

java.lang.Object
  extended by org.apache.hadoop.hbase.util.Addressing

@InterfaceAudience.Private
public class Addressing
extends Object

Utility for network addresses, resolving and naming.


Field Summary
static String HOSTNAME_PORT_SEPARATOR
           
static String VALID_PORT_REGEX
           
 
Constructor Summary
Addressing()
           
 
Method Summary
static String createHostAndPortStr(String hostname, int port)
           
static InetSocketAddress createInetSocketAddressFromHostAndPortStr(String hostAndPort)
           
static String parseHostname(String hostAndPort)
           
static int parsePort(String hostAndPort)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

Addressing

public Addressing()
Method Detail

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 hostname
port - 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 © 2013 The Apache Software Foundation. All Rights Reserved.