@Override
  public boolean equals(Object o) {
    // xid and extraMapFields are ignored in this equality check. They are unique to specific DataNodeConfigSource
    // implementations for legacy compatibility only. Comparison between configs from different sources is required.
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DataNodeConfig that = (DataNodeConfig) o;
    return Objects.equals(instanceName, that.instanceName) && Objects.equals(hostName, that.hostName) && Objects.equals(
        datacenterName, that.datacenterName) && port == that.port && Objects.equals(sslPort, that.sslPort)
        && Objects.equals(http2Port, that.http2Port) && Objects.equals(rackId, that.rackId) && sealedReplicas.equals(
        that.sealedReplicas) && stoppedReplicas.equals(that.stoppedReplicas) && disabledReplicas.equals(
        that.disabledReplicas) && diskConfigs.equals(that.diskConfigs)
        && partiallySealedReplicas.equals(this.partiallySealedReplicas);
  }
This can be used for extra fields that are not recognized by {@link DataNodeConfigSource} but still need to be
read from or written to the source of truth. This should be used sparingly and is mainly provided for legacy
compatibility.
@return a map from field name to map-style fields.
ambry-api/src/main/java/com/github/ambry/clustermap/DataNodeConfig.java