Class CdcSourceTaskContext<T extends CommonConnectorConfig>

java.lang.Object
io.debezium.connector.common.CdcSourceTaskContext<T>

public class CdcSourceTaskContext<T extends CommonConnectorConfig> extends Object
Contains contextual information and objects scoped to the lifecycle of Debezium's SourceTask implementations.
Author:
Gunnar Morling
  • Field Details

    • connectorType

      private final String connectorType
    • connectorLogicalName

      private final String connectorLogicalName
    • connectorPluginName

      private final String connectorPluginName
    • taskId

      private final String taskId
    • customMetricTags

      private final Map<String,String> customMetricTags
    • clock

      private final io.debezium.util.Clock clock
    • connectorConfig

      private final T extends CommonConnectorConfig connectorConfig
    • rawConfig

      private final io.debezium.config.Configuration rawConfig
    • runId

      private final UUID runId
  • Constructor Details

    • CdcSourceTaskContext

      public CdcSourceTaskContext(io.debezium.config.Configuration rawConfig, T connectorConfig, String taskId, Map<String,String> customMetricTags)
    • CdcSourceTaskContext

      public CdcSourceTaskContext(io.debezium.config.Configuration rawConfig, T connectorConfig, Map<String,String> customMetricTags)
  • Method Details

    • configureLoggingContext

      public LoggingContext.PreviousContext configureLoggingContext(String contextName)
      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 - if contextName is 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 null
      contextName - the name of the context; may not be null
      operation - 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

      public String getConnectorType()
    • getConnectorLogicalName

      public String getConnectorLogicalName()
    • getTaskId

      public String getTaskId()
    • getConnectorPluginName

      public String getConnectorPluginName()
    • getCustomMetricTags

      public Map<String,String> getCustomMetricTags()
    • getConfig

      public T getConfig()
    • getRawConfig

      public io.debezium.config.Configuration getRawConfig()
    • getRunId

      public UUID getRunId()