@SuppressWarnings("squid:S1172")
  public static void writeWithReader(
      AbstractCompactionWriter writer,
      IDataBlockReader reader,
      IDeviceID device,
      int subTaskId,
      boolean isAligned)
      throws IOException {
    while (reader.hasNextBatch()) {
      TsBlock tsBlock = reader.nextBatch();
      if (isAligned) {
        writer.write(tsBlock, subTaskId);
      } else {
        IPointReader pointReader = tsBlock.getTsBlockSingleColumnIterator();
        while (pointReader.hasNextTimeValuePair()) {
          writer.write(pointReader.nextTimeValuePair(), subTaskId);
        }
      }
    }
  }
Construct series data block reader.

@param measurementIds if device is aligned, then measurementIds contain all measurements. If
    device is not aligned, then measurementIds only contain one measurement.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/performer/impl/ReadPointCompactionPerformer.java