@Override
  public Port getPortToConnectTo() {
    if (enableHttp2Replication) {
      return ports.get(PortType.HTTP2);
    }
    if (sslEnabledDataCenters.contains(datacenter)) {
      if (ports.containsKey(PortType.SSL)) {
        return ports.get(PortType.SSL);
      } else {
        throw new IllegalArgumentException("No SSL Port exists for the data node " + hostname + ":" + portNum);
      }
    }
    return new Port(portNum, PortType.PLAINTEXT);
  }
This datanode will always return an HTTP/2 port in {@link #getPortToConnectTo()} if enableHttp2Replication
is set to true.
@param enable http2 replication if it's true.
ambry-test-utils/src/main/java/com/github/ambry/clustermap/MockDataNodeId.java