Class InetAddressAndPort

java.lang.Object
java.net.SocketAddress
java.net.InetSocketAddress
org.apache.cassandra.locator.InetAddressAndPort
All Implemented Interfaces:
Serializable, Comparable<InetAddressAndPort>

public final class InetAddressAndPort extends InetSocketAddress implements Comparable<InetAddressAndPort>, Serializable
A class to replace the usage of InetAddress to identify hosts in the cluster. Opting for a full replacement class so that in the future if we change the nature of the identifier the refactor will be easier in that we don't have to change the type just the methods. Because an IP might contain multiple C* instances the identification must be done using the IP + port. InetSocketAddress is undesirable for a couple of reasons. It's not comparable, it's toString() method doesn't correctly bracket IPv6, it doesn't handle optional default values, and a couple of other minor behaviors that are slightly less troublesome like handling the need to sometimes return a port and sometimes not.
See Also: