protected void checkShouldRemoveFile(PageElement pageElement)
      throws IOException, IllegalPathException {
    if (pageElement.isLastPage() && pageElement.getChunkMetadataElement().isLastChunk) {
      // finish compacting the file, remove it from list
      removeFile(pageElement.getChunkMetadataElement().fileElement);
    }
  }
Check should remove file or not. If it is the last page in the chunk and the last chunk in the
file, then it means the file has been finished compacting and needs to be removed.

@throws IOException if io errors occurred
@throws IllegalPathException if file path is illegal
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/executor/fast/SeriesCompactionExecutor.java