@Override
  public Port getPortToConnectTo() {
    if (enableHttp2Replication) {
      return http2Port;
    }
    return sslEnabledDataCenters.contains(getDatacenterName()) ? sslPort : plainTextPort;
  }
Instantiate an {@link AmbryServerDataNode}.
@param dataCenterName the name of the dataCenter associated with this data node.
@param clusterMapConfig the {@link ClusterMapConfig} to use.
@param hostName the hostName identifying this data node.
@param portNum the port identifying this data node.
@param rackId the rack Id associated with this data node (may be null).
@param sslPortNum the ssl port associated with this data node (may be null).
@param http2PortNumber the http2 ssl port associated with this data node (may be null).
@param xid the xid associated with this data node.
@param clusterManagerQueryHelper the {@link ClusterManagerQueryHelper} to use
@throws Exception if there is an exception in instantiating the {@link ResourceStatePolicy}
ambry-clustermap/src/main/java/com/github/ambry/clustermap/AmbryServerDataNode.java