private void validate() {
    logger.trace("begin validate.");
    validateDatacenter();
    validateHostName(clusterMapConfig.clusterMapResolveHostnames, hostname);
    validatePorts(ports.get(PortType.PLAINTEXT), ports.get(PortType.SSL), ports.get(PortType.HTTP2),
        ports.containsKey(PortType.SSL) || ports.containsKey(PortType.HTTP2));
    for (Disk disk : disks) {
      disk.validate();
    }
    logger.trace("complete validate.");
  }
Returns the {@link Port} of this node to connect to. A {@link Port} will be automatically selected based on if
there is a need of establishing an SSL connection.

@return {@link Port} to which the caller can connect to.
@throws IllegalStateException Thrown if an SSL connection is needed but no SSL port exists.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/DataNode.java