public static Collection<SchemaRecord> retrieveHistory(String engineName) {
        synchronized (HISTORY) {
            if (Boolean.TRUE.equals(HISTORY_CLEANUP_STATUS.get(engineName))) {
                throw new IllegalStateException(
                        String.format(
                                "Retrieve schema history failed, the schema records for engine %s has been removed,"
                                        + " this might because the debezium engine "
                                        + "has been shutdown due to other errors.",
                                engineName));
            } else {
                return HISTORY.getOrDefault(engineName, Collections.emptyList());
            }
        }
    }
Retrieves history of schema safely, this method firstly checks the history status of specific
engine, and then return the history of schema if the history exists(didn't clean up yet).
Returns null when the history of schema has been clean up.
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/mongodb-cdc/src/main/java/org/apache/inlong/sort/cdc/mongodb/debezium/utils/DatabaseHistoryUtil.java