public synchronized void scheduleRelease(boolean force) {
    CompletableFuture.allOf(
            regionToStore.entrySet().stream()
                .map(
                    entry ->
                        CompletableFuture.runAsync(
                            () -> {
                              int regionId = entry.getKey();
                              CachedMTreeStore store = entry.getValue();
                              if (store == null) {
                                // store has been closed
                                return;
                              }
                              LockManager lockManager = store.getLockManager();
                              lockManager.globalReadLock(true);
                              if (!regionToStore.containsKey(regionId)) {
                                // double check store have not been closed
                                return;
                              }
                              try {
                                executeRelease(store, force);
                              } finally {
                                lockManager.globalReadUnlock();
                              }
                            },
                            workerPool))
                .toArray(CompletableFuture[]::new))
        .join();
  }
Keep fetching evictable nodes from memoryManager until the memory status is under safe mode or
no node could be evicted. Update the memory status after evicting each node.

@param force true if force to evict all cache
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/flush/Scheduler.java