@Override
  public JSONObject getSnapshot() {
    JSONObject snapshot = new JSONObject();
    snapshot.put(DATA_NODE_HOSTNAME, getHostname());
    snapshot.put(DATA_NODE_DATACENTER, getDatacenterName());
    snapshot.put(DATA_NODE_SSL_ENABLED_DATACENTERS, new JSONArray(sslEnabledDataCenters));
    JSONObject portsJson = new JSONObject();
    portsJson.put(PortType.PLAINTEXT.name(), getPort());
    if (hasSSLPort()) {
      portsJson.put(PortType.SSL.name(), getSSLPort());
    }
    if (hasHttp2Port()) {
      portsJson.put(PortType.HTTP2.name(), getHttp2Port());
    }
    portsJson.put(DATA_NODE_PORT_CONNECT_TO, getPortToConnectTo().getPort());
    snapshot.put(DATA_NODE_PORTS, portsJson);
    snapshot.put(DATA_NODE_RACK_ID, getRackId());
    snapshot.put(DATA_NODE_XID, getXid());
    snapshot.put(LIVENESS, getLiveness());
    JSONArray disksJson = new JSONArray();
    clusterManagerQueryHelper.getDisks(this).forEach(disk -> disksJson.put(disk.getSnapshot()));
    snapshot.put(DATA_NODE_DISKS, disksJson);
    return snapshot;
  }
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