private void writeChunkIntoChunkWriter(Chunk chunk) throws IOException {
    IChunkReader chunkReader = new ChunkReader(chunk);
    while (chunkReader.hasNextSatisfiedPage()) {
      IPointReader batchIterator = chunkReader.nextPageData().getBatchDataIterator();
      while (batchIterator.hasNextTimeValuePair()) {
        TimeValuePair timeValuePair = batchIterator.nextTimeValuePair();
        checkAndUpdatePreviousTimestamp(timeValuePair.getTimestamp());
        writeTimeAndValueToChunkWriter(timeValuePair);
        if (!maxEndTimestampSet || timeValuePair.getTimestamp() > maxEndTimestamp) {
          maxEndTimestamp = timeValuePair.getTimestamp();
          maxEndTimestampSet = true;
        }
        if (!minStartTimestampSet || timeValuePair.getTimestamp() < minStartTimestamp) {
          minStartTimestamp = timeValuePair.getTimestamp();
          minStartTimestampSet = true;
        }
      }
    }
    long count = chunk.getChunkStatistic().getCount();
    pointCountInChunkWriter += count;
    summary.increaseRewritePointNum(count);
  }
Deserialize a chunk into points and write it to the chunkWriter.

@throws IOException if io errors occurred
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/readchunk/SingleSeriesCompactionExecutor.java