public static ReplicaMetadataResponseInfo readFrom(DataInputStream stream, FindTokenHelper helper,
      ClusterMap clusterMap, short replicaMetadataResponseVersion) throws IOException {
    PartitionId partitionId = clusterMap.getPartitionIdFromStream(stream);
    ReplicaType replicaType;
    if (replicaMetadataResponseVersion == ReplicaMetadataResponse.REPLICA_METADATA_RESPONSE_VERSION_V_6) {
      replicaType = ReplicaType.values()[stream.readShort()];
    } else {
      //before REPLICA_METADATA_RESPONSE_VERSION_V_6 there were only disk based replicas
      replicaType = ReplicaType.DISK_BACKED;
    }
    ServerErrorCode error = ServerErrorCode.values()[stream.readShort()];
    if (error != ServerErrorCode.NoError) {
      return new ReplicaMetadataResponseInfo(partitionId, replicaType, error, replicaMetadataResponseVersion);
    } else {
      FindTokenFactory findTokenFactory = helper.getFindTokenFactoryFromReplicaType(replicaType);
      FindToken token = findTokenFactory.getFindToken(stream);
      MessageInfoAndMetadataListSerde messageInfoAndMetadataList =
          MessageInfoAndMetadataListSerde.deserializeMessageInfoAndMetadataList(stream, clusterMap,
              getMessageInfoAndMetadataListSerDeVersion(replicaMetadataResponseVersion));
      long remoteReplicaLag = stream.readLong();
      return new ReplicaMetadataResponseInfo(partitionId, replicaType, token,
          messageInfoAndMetadataList.getMessageInfoList(), remoteReplicaLag, replicaMetadataResponseVersion);
    }
  }
Contains the token, messageInfoList, remoteReplicaLag for a local partition. This is used
by replica metadata response to specify information for a partition
ambry-protocol/src/main/java/com/github/ambry/protocol/ReplicaMetadataResponseInfo.java