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
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hbase.thirdparty.com.google.common.net.HostAndPort -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAddress(org.apache.hbase.thirdparty.com.google.common.net.HostAndPort hostAndPort) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanstatic Addressstatic Addressstatic AddressfromString(String hostnameAndPort) Deprecated.Since 1.7.0, 2.4.18 and 2.5.0, will be removed in 4.0.0.intgetPort()inthashCode()static InetSocketAddresstoSocketAddress(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.Since 1.7.0, 2.4.18 and 2.5.0, will be removed in 4.0.0. 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:
compareToin interfaceComparable<Address>
-