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 (Collection) HISTORY.getOrDefault(engineName, Collections.emptyList());
            }
        }
    }
Util to safely visit schema history {@link DatabaseHistory}
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/utils/DatabaseHistoryUtil.java