@Override
  public PartitionId getPartitionIdFromStream(InputStream stream) throws IOException {
    DuplicatingInputStream duplicatingInputStream = new DuplicatingInputStream(stream);
    duplicatingInputStream.mark(0);
    PartitionId partitionIdDynamic = null;
    partitionIdDynamic = helixClusterManager.getPartitionIdFromStream(duplicatingInputStream);;
    if (check) {
      duplicatingInputStream.reset();
      PartitionId partitionIdStatic = staticClusterManager.getPartitionIdFromStream(duplicatingInputStream);
      if (!partitionIdStatic.toString().equals(partitionIdDynamic.toString())) {
        logger.debug("Static PartitionId does not match Helix PartitionId");
        helixClusterManagerMetrics.getPartitionIdFromStreamMismatchCount.inc();
      }
    }
    return partitionIdDynamic;
  }
Construct a CompositeClusterManager instance.
@param staticClusterManager the {@link StaticClusterManager} instance to use as the source-of-truth.
@param helixClusterManager the {@link HelixClusterManager} instance to use for comparison of views.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/CompositeClusterManager.java