public boolean shouldSelectCrossSpaceCompactionTask() {
    // If the queue size accounts for less than 0.8 of the total capacity, select cross space
    // compaction task
    int waitingQueueRestSize =
        candidateCompactionTaskQueue.getMaxSize() - candidateCompactionTaskQueue.size();
    return 5 * waitingQueueRestSize >= candidateCompactionTaskQueue.size();
  }
CompactionMergeTaskPoolManager provides a ThreadPool tPro queue and run all compaction tasks.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/schedule/CompactionTaskManager.java