public static void exit() {
    if (DeletionResourceManagerHolder.CONSENSU_GROUP_ID_2_INSTANCE_MAP == null) {
      return;
    }
    DeletionResourceManagerHolder.CONSENSU_GROUP_ID_2_INSTANCE_MAP.forEach(
        (groupId, resourceManager) -> {
          resourceManager.close();
        });
  }
This is a hook function, which will be automatically invoked when deletionResource's reference
count returns to 0.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/DeletionResourceManager.java