Package org.apache.hadoop.hbase.net
Class Address
java.lang.Object
org.apache.hadoop.hbase.net.Address
- All Implemented Interfaces:
Comparable<Address>
An immutable type to hold a hostname and port combo, like an Endpoint or
java.net.InetSocketAddress (but without danger of our calling resolve -- we do NOT want a resolve
happening every time we want to hold a hostname and port combo). This class is also
Comparable
In implementation this class is a facade over Guava's HostAndPort
. We cannot have Guava
classes in our API hence this Type.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hbase.thirdparty.com.google.common.net.HostAndPort
-
Constructor Summary
ModifierConstructorDescriptionprivate
Address
(org.apache.hbase.thirdparty.com.google.common.net.HostAndPort hostAndPort) -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static Address
static Address
static Address
fromString
(String hostnameAndPort) Deprecated.int
getPort()
int
hashCode()
static InetSocketAddress
toSocketAddress
(Address addr) static InetSocketAddress[]
toSocketAddress
(Address[] addrs) toString()
If hostname is a.b.c and the port is 123, return a:123 instead of a.b.c:123.
-
Field Details
-
hostAndPort
-
-
Constructor Details
-
Address
-
-
Method Details
-
fromParts
-
fromString
-
fromSocketAddress
-
toSocketAddress
-
toSocketAddress
-
getHostName
-
getHostname
Deprecated.UsegetHostName()
instead -
getPort
-
toString
-
toStringWithoutDomain
If hostname is a.b.c and the port is 123, return a:123 instead of a.b.c:123.- Returns:
- if host looks like it is resolved -- not an IP -- then strip the domain portion
otherwise returns same as
toString()
}
-
equals
-
hashCode
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Address>
-
getHostName()
instead