Package io.debezium.connector.common
Class CdcSourceTaskContext<T extends CommonConnectorConfig>
java.lang.Object
io.debezium.connector.common.CdcSourceTaskContext<T>
Contains contextual information and objects scoped to the lifecycle of Debezium's
SourceTask implementations.- Author:
- Gunnar Morling
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfigureLoggingContext(String contextName) Configure the logger's Mapped Diagnostic Context (MDC) properties for the thread making this call.configureLoggingContext(String contextName, Partition partition) io.debezium.util.ClockgetClock()Returns a clock for obtaining the current time.io.debezium.config.ConfigurationgetRunId()voidtemporaryLoggingContext(CommonConnectorConfig connectorConfig, 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.
-
Field Details
-
connectorType
-
connectorLogicalName
-
connectorPluginName
-
taskId
-
customMetricTags
-
clock
private final io.debezium.util.Clock clock -
connectorConfig
-
rawConfig
private final io.debezium.config.Configuration rawConfig -
runId
-
-
Constructor Details
-
CdcSourceTaskContext
-
CdcSourceTaskContext
-
-
Method Details
-
configureLoggingContext
Configure the logger's Mapped Diagnostic Context (MDC) properties for the thread making this call.- Parameters:
contextName- the name of the context; may not be null- Returns:
- the previous MDC context; never null
- Throws:
IllegalArgumentException- ifcontextNameis null
-
configureLoggingContext
public LoggingContext.PreviousContext configureLoggingContext(String contextName, Partition partition) -
temporaryLoggingContext
public void temporaryLoggingContext(CommonConnectorConfig connectorConfig, 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.- Parameters:
connectorConfig- the configuration of the connector; may not be nullcontextName- the name of the context; may not be nulloperation- the function to run in the new MDC context; may not be null- Throws:
IllegalArgumentException- if any of the parameters are null
-
getClock
public io.debezium.util.Clock getClock()Returns a clock for obtaining the current time. -
getConnectorType
-
getConnectorLogicalName
-
getTaskId
-
getConnectorPluginName
-
getCustomMetricTags
-
getConfig
-
getRawConfig
public io.debezium.config.Configuration getRawConfig() -
getRunId
-