private boolean hasLogSwitchOccurred() throws SQLException {
        final List<BigInteger> newSequences = getCurrentRedoLogSequences();
        if (!newSequences.equals(currentRedoLogSequences)) {
            LOGGER.debug(
                    "Current log sequence(s) is now {}, was {}",
                    newSequences,
                    currentRedoLogSequences);

            currentRedoLogSequences = newSequences;

            final Map<String, String> logStatuses =
                    jdbcConnection.queryAndMap(
                            SqlUtils.redoLogStatusQuery(),
                            rs -> {
                                Map<String, String> results = new LinkedHashMap<>();
                                while (rs.next()) {
                                    results.put(rs.getString(1), rs.getString(2));
                                }
                                return results;
                            });

            final int logSwitchCount =
                    jdbcConnection.queryAndMap(
                            SqlUtils.switchHistoryQuery(archiveDestinationName),
                            rs -> {
                                if (rs.next()) {
                                    return rs.getInt(2);
                                }
                                return 0;
                            });

            final Set<String> fileNames = getCurrentRedoLogFiles(jdbcConnection);

            streamingMetrics.setRedoLogStatus(logStatuses);
            streamingMetrics.setSwitchCount(logSwitchCount);
            streamingMetrics.setCurrentLogFileName(fileNames);

            return true;
        }

        return false;
    }
Checks whether a database log switch has occurred and updates metrics if so.

@return {@code true} if a log switch was detected, otherwise {@code false}
@throws SQLException if a database exception occurred
inlong-sort/sort-flink/sort-flink-v1.13/sort-connectors/oracle-cdc/src/main/java/io/debezium/connector/oracle/logminer/LogMinerStreamingChangeEventSource.java