private void flushChunkToFileWriter(Chunk chunk, ChunkMetadata chunkMetadata) throws IOException {
    checkAndUpdatePreviousTimestamp(chunkMetadata.getStartTime());
    if (!minStartTimestampSet || chunkMetadata.getStartTime() < minStartTimestamp) {
      minStartTimestamp = chunkMetadata.getStartTime();
      minStartTimestampSet = true;
    }
    if (!maxEndTimestampSet || chunkMetadata.getEndTime() > maxEndTimestamp) {
      maxEndTimestamp = chunkMetadata.getEndTime();
      maxEndTimestampSet = true;
    }
    fileWriter.writeChunk(chunk, chunkMetadata);
  }
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