public static BatchDeleteRequest readFrom(DataInputStream stream, ClusterMap clusterMap) throws IOException {
    Short version = stream.readShort();
    int correlationId = stream.readInt();
    String clientId = Utils.readIntString(stream);
    int totalNumberOfPartitionInfo = stream.readInt();
    ArrayList<BatchDeletePartitionRequestInfo> partitionRequestInfoList = new ArrayList<>(totalNumberOfPartitionInfo);
    for (int i = 0; i < totalNumberOfPartitionInfo; i++) {
      BatchDeletePartitionRequestInfo partitionRequestInfo =
          BatchDeletePartitionRequestInfo.readFrom(stream, clusterMap);
      partitionRequestInfoList.add(partitionRequestInfo);
    }
    long deletionTimeInMs = stream.readLong();
    return new BatchDeleteRequest(correlationId, clientId, partitionRequestInfoList, deletionTimeInMs);
  }
Constructs {@link BatchDeleteRequest} reading from a stream {@link DataInputStream}
@param stream the stream to read from
@param clusterMap the {@link ClusterMap} to use
@return the constructed {@link BatchDeleteRequest}
ambry-protocol/src/main/java/com/github/ambry/protocol/BatchDeleteRequest.java