Class MariaDbConnection
java.lang.Object
io.debezium.jdbc.JdbcConnection
io.debezium.connector.mysql.strategy.AbstractConnectorConnection
io.debezium.connector.mysql.strategy.mariadb.MariaDbConnection
- All Implemented Interfaces:
AutoCloseable
An
AbstractConnectorConnection for MariaDB.- Author:
- Chris Cranford
-
Nested Class Summary
Nested classes/interfaces inherited from class io.debezium.connector.mysql.strategy.AbstractConnectorConnection
AbstractConnectorConnection.DatabaseLocalesNested classes/interfaces inherited from class io.debezium.jdbc.JdbcConnection
JdbcConnection.BlockingMultiResultSetConsumer, JdbcConnection.BlockingResultSetConsumer, JdbcConnection.CallPreparer, JdbcConnection.ConnectionFactory, JdbcConnection.LogPositionValidator, JdbcConnection.MultiResultSetConsumer, JdbcConnection.Operations, JdbcConnection.ParameterResultSetConsumer, JdbcConnection.ResultSetConsumer, JdbcConnection.ResultSetExtractor<T extends Object>, JdbcConnection.ResultSetMapper<T extends Object>, JdbcConnection.StatementFactory, JdbcConnection.StatementPreparer -
Field Summary
FieldsFields inherited from class io.debezium.jdbc.JdbcConnection
logPositionValidator -
Constructor Summary
ConstructorsConstructorDescriptionMariaDbConnection(MariaDbConnectionConfiguration connectionConfig, MySqlFieldReader fieldReader) -
Method Summary
Modifier and TypeMethodDescriptionprotected GtidSetcreateGtidSet(String gtids) filterGtidSet(Predicate<String> gtidSourceFilter, String offsetGtids, GtidSet availableServerGtidSet, GtidSet purgedServerGtidSet) Apply the include/exclude GTID source filters to the currentGTID setand merge them onto the currently available GTID set from a MySQL server.booleanDetermine whether the server has enabled GTID support.booleanReturns the most recent executed GTID set or position.Get the purged GTID values from the server.subtractGtidSet(GtidSet set1, GtidSet set2) Determines the difference between two GTID sets.Methods inherited from class io.debezium.connector.mysql.strategy.AbstractConnectorConnection
availableBinlogFiles, availableDatabases, connectionConfig, connectionString, earliestBinlogFilename, getColumnValue, getEstimatedTableSize, getQualifiedTableName, getSessionVariableForSslVersion, isBinlogFormatRow, isBinlogPositionAvailable, isBinlogRowImageFull, isTableIdCaseSensitive, nullsSortLast, quotedTableIdString, readCharsetSystemVariables, readDatabaseCollations, readSystemVariables, setStatementFor, userHasPrivileges, validateLogPositionMethods inherited from class io.debezium.jdbc.JdbcConnection
buildSelectWithRowLimits, call, chunkQueryBuilder, close, commit, config, connect, connection, connection, connectionString, createTableId, database, escapeEscapeSequence, execute, execute, executeWithoutCommitting, getAttributeDetails, getColumnsDetails, getCurrentTimestamp, isConnected, isLogPositionAvailable, isNullable, isTableType, isTableUniqueIndexIncluded, isValid, loadKeyStore, overrideColumn, parseSqlStatementString, patternBasedFactory, patternBasedFactory, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQueryAndMap, prepareQueryWithBlockingConsumer, prepareUpdate, print, print, query, query, queryAndMap, queryAndMap, querySingleValue, queryWithBlockingConsumer, quotedColumnIdString, readAllCatalogNames, readAllSchemaNames, readAllTableNames, readPrimaryKeyNames, readPrimaryKeyOrUniqueIndexNames, readSchema, readTableColumn, readTableNames, readTablePreparedStatement, readTableStatement, readTableUniqueIndices, reselectColumns, reselectColumns, resolveCatalogName, resolveJdbcType, resolveNativeType, rollback, rowToArray, setAutoCommit, setQueryColumnValue, singleResultMapper, supportedTableTypes, tableTypes, username
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
MariaDbConnection
public MariaDbConnection(MariaDbConnectionConfiguration connectionConfig, MySqlFieldReader fieldReader)
-
-
Method Details
-
isGtidModeEnabled
public boolean isGtidModeEnabled()Description copied from class:AbstractConnectorConnectionDetermine whether the server has enabled GTID support.- Specified by:
isGtidModeEnabledin classAbstractConnectorConnection- Returns:
falseif the server has not enabled GTIDs,trueotherwise
-
knownGtidSet
Description copied from class:AbstractConnectorConnectionReturns the most recent executed GTID set or position.- Specified by:
knownGtidSetin classAbstractConnectorConnection- Returns:
- the string representation of the most recent executed GTID set or position; never null but will be empty if the server does not support or has not processed any GTID
-
subtractGtidSet
Description copied from class:AbstractConnectorConnectionDetermines the difference between two GTID sets.- Specified by:
subtractGtidSetin classAbstractConnectorConnection- Parameters:
set1- the first set; should never be nullset2- the second set; should never be null- Returns:
- the subtraction of the two sets in a new GtidSet instance; never null
-
purgedGtidSet
Description copied from class:AbstractConnectorConnectionGet the purged GTID values from the server.- Specified by:
purgedGtidSetin classAbstractConnectorConnection- Returns:
- A GTID set; may be empty of GTID support is not enabled or if none have been purged
-
filterGtidSet
public GtidSet filterGtidSet(Predicate<String> gtidSourceFilter, String offsetGtids, GtidSet availableServerGtidSet, GtidSet purgedServerGtidSet) Description copied from class:AbstractConnectorConnectionApply the include/exclude GTID source filters to the currentGTID setand merge them onto the currently available GTID set from a MySQL server. The merging behavior of this method might seem a bit strange at first. It's required in order for Debezium to consume a MySQL binlog that has multi-source replication enabled, if a failover has to occur. In such a case, the server that Debezium is failed over to might have a different set of sources, but still include the sources required for Debezium to continue to function. MySQL does not allow downstream replicas to connect if the GTID set does not contain GTIDs for all channels that the server is replicating from, even if the server does have the data needed by the client. To get around this, we can have Debezium merge its GTID set with whatever is on the server, so that MySQL will allow it to connect. See DBZ-143 for details. This method does not mutate any state in the context.- Specified by:
filterGtidSetin classAbstractConnectorConnection- Parameters:
gtidSourceFilter- the source filteroffsetGtids- the gtids from the offsetsavailableServerGtidSet- the GTID set currently available in the MySQL serverpurgedServerGtidSet- the GTID set already purged by the MySQL server- Returns:
- A GTID set meant for consuming from a MySQL binlog; may return null if the SourceInfo has no GTIDs and therefore none were filtered
-
isMariaDb
public boolean isMariaDb()- Specified by:
isMariaDbin classAbstractConnectorConnection
-
createGtidSet
- Specified by:
createGtidSetin classAbstractConnectorConnection
-