public final class MySqlTaskContext extends MySqlJdbcContext
MySqlConnector| Modifier and Type | Field and Description |
|---|---|
private Clock |
clock |
private MySqlSchema |
dbSchema |
private Predicate<String> |
ddlFilter |
private Predicate<String> |
gtidSourceFilter |
private RecordMakers |
recordProcessor |
private SourceInfo |
source |
private boolean |
tableIdCaseInsensitive
Whether table ids are compared ingnoring letter casing.
|
private TopicSelector |
topicSelector |
config, FACTORY, jdbc, logger, MYSQL_CONNECTION_URL| Constructor and Description |
|---|
MySqlTaskContext(Configuration config) |
MySqlTaskContext(Configuration config,
Boolean tableIdCaseInsensitive) |
| Modifier and Type | Method and Description |
|---|---|
int |
bufferSizeForBinlogReader() |
Clock |
clock() |
LoggingContext.PreviousContext |
configureLoggingContext(String contextName)
Configure the logger's Mapped Diagnostic Context (MDC) properties for the thread making this call.
|
String |
connectorName() |
MySqlSchema |
dbSchema() |
Predicate<String> |
ddlFilter()
Get the predicate function that will return
true if a DDL has to be skipped over and left out of the schema history
or false when it should be processed. |
GtidSet |
filterGtidSet(GtidSet availableServerGtidSet)
Apply the include/exclude GTID source filters to the current
GTID set and merge them onto the
currently available GTID set from a MySQL server. |
String |
getSnapshotSelectOverrides() |
Predicate<String> |
gtidSourceFilter()
Get the predicate function that will return
true if a GTID source is to be included, or false if
a GTID source is to be excluded. |
boolean |
historyExists()
Return true if the database history entity exists
|
boolean |
includeSchemaChangeRecords() |
void |
initializeHistory()
Initialize the database history with any server-specific information.
|
boolean |
isInitialSnapshotOnly() |
boolean |
isSchemaOnlyRecoverySnapshot() |
boolean |
isSchemaOnlySnapshot() |
boolean |
isSnapshotAllowedWhenNeeded() |
boolean |
isSnapshotNeverAllowed() |
boolean |
isTableIdCaseInsensitive() |
void |
loadHistory(SourceInfo startingPoint)
Load the database schema information using the previously-recorded history, and stop reading the history when the
the history reaches the supplied starting point.
|
RecordMakers |
makeRecord() |
int |
maxBatchSize() |
int |
maxQueueSize() |
ObjectName |
metricName(String contextName)
Create a JMX metric name for the given metric.
|
long |
pollIntervalInMillseconds() |
long |
rowCountForLargeTable() |
long |
serverId() |
String |
serverName() |
void |
shutdown() |
protected MySqlConnectorConfig.SnapshotMode |
snapshotMode() |
SourceInfo |
source() |
void |
start() |
void |
temporaryLoggingContext(String contextName,
Runnable operation)
Run the supplied function in the temporary connector MDC context, and when complete always return the MDC context to its
state before this method was called.
|
long |
timeoutInMilliseconds() |
TopicSelector |
topicSelector() |
boolean |
useMinimalSnapshotLocking() |
close, config, connectionString, eventDeserializationFailureHandlingMode, hostname, jdbc, knownGtidSet, logger, password, port, readMySqlCharsetSystemVariables, readMySqlSystemVariables, setStatementFor, setSystemProperty, sslMode, sslModeEnabled, userHasPrivileges, usernameprivate final SourceInfo source
private final MySqlSchema dbSchema
private final TopicSelector topicSelector
private final RecordMakers recordProcessor
private final Clock clock
private final boolean tableIdCaseInsensitive
public MySqlTaskContext(Configuration config)
public MySqlTaskContext(Configuration config, Boolean tableIdCaseInsensitive)
public String connectorName()
public TopicSelector topicSelector()
public SourceInfo source()
public MySqlSchema dbSchema()
public RecordMakers makeRecord()
public Predicate<String> gtidSourceFilter()
true if a GTID source is to be included, or false if
a GTID source is to be excluded.public void initializeHistory()
public void loadHistory(SourceInfo startingPoint)
startingPoint - the source information with the current SourceInfo.partition() and offset at which the database schemas are to reflect; may not be nullpublic boolean historyExists()
public Clock clock()
public long serverId()
public String serverName()
public int maxQueueSize()
public int maxBatchSize()
public long timeoutInMilliseconds()
public long pollIntervalInMillseconds()
public long rowCountForLargeTable()
public int bufferSizeForBinlogReader()
public boolean includeSchemaChangeRecords()
public boolean isSnapshotAllowedWhenNeeded()
public boolean isSnapshotNeverAllowed()
public boolean isInitialSnapshotOnly()
public boolean isSchemaOnlySnapshot()
public boolean isSchemaOnlyRecoverySnapshot()
protected MySqlConnectorConfig.SnapshotMode snapshotMode()
public boolean useMinimalSnapshotLocking()
public String getSnapshotSelectOverrides()
public void start()
start in class MySqlJdbcContextpublic void shutdown()
shutdown in class MySqlJdbcContextpublic LoggingContext.PreviousContext configureLoggingContext(String contextName)
contextName - the name of the context; may not be nullIllegalArgumentException - if contextName is nullpublic void temporaryLoggingContext(String contextName, Runnable operation)
contextName - the name of the context; may not be nulloperation - the function to run in the new MDC context; may not be nullIllegalArgumentException - if any of the parameters are nullpublic ObjectName metricName(String contextName) throws MalformedObjectNameException
contextName - the name of the contextMalformedObjectNameException - if the name is invalidpublic GtidSet filterGtidSet(GtidSet availableServerGtidSet)
GTID set and 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.availableServerGtidSet - the GTID set currently available in the MySQL serverpublic Predicate<String> ddlFilter()
true if a DDL has to be skipped over and left out of the schema history
or false when it should be processed.public boolean isTableIdCaseInsensitive()
Copyright © 2018 JBoss by Red Hat. All rights reserved.