Package io.debezium.connector.mongodb
Class MongoDbConnectorConfig
- java.lang.Object
-
- io.debezium.config.CommonConnectorConfig
-
- io.debezium.connector.mongodb.MongoDbConnectorConfig
-
public class MongoDbConnectorConfig extends CommonConnectorConfig
The configuration properties.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMongoDbConnectorConfig.CaptureModeThe set off different ways how connector can capture changes.static classMongoDbConnectorConfig.SnapshotModeThe set of predefined SnapshotMode options or aliases.-
Nested classes/interfaces inherited from class io.debezium.config.CommonConnectorConfig
CommonConnectorConfig.BinaryHandlingMode, CommonConnectorConfig.EventProcessingFailureHandlingMode, CommonConnectorConfig.Version
-
-
Field Summary
Fields Modifier and Type Field Description static Field.SetALL_FIELDSThe set ofFields defined as part of this configuration.static FieldAUTH_SOURCEstatic FieldAUTO_DISCOVER_MEMBERSstatic FieldCAPTURE_MODEprivate MongoDbConnectorConfig.CaptureModecaptureModestatic FieldCOLLECTION_BLACKLISTDeprecated.static FieldCOLLECTION_EXCLUDE_LISTA comma-separated list of regular expressions that match the fully-qualified namespaces of collections to be excluded from monitoring.static FieldCOLLECTION_INCLUDE_LISTA comma-separated list of regular expressions that match the fully-qualified namespaces of collections to be monitored.protected static StringCOLLECTION_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSGstatic FieldCOLLECTION_WHITELISTDeprecated.protected static StringCOLLECTION_WHITELIST_ALREADY_SPECIFIED_ERROR_MSGprivate static ConfigDefinitionCONFIG_DEFINITIONstatic FieldCONNECT_BACKOFF_INITIAL_DELAY_MSstatic FieldCONNECT_BACKOFF_MAX_DELAY_MSstatic FieldCONNECT_TIMEOUT_MSstatic FieldCURSOR_MAX_AWAIT_TIME_MSprivate intcursorMaxAwaitTimeMsstatic FieldDATABASE_BLACKLISTDeprecated.static FieldDATABASE_EXCLUDE_LISTA comma-separated list of regular expressions that match the databases to be excluded.static FieldDATABASE_INCLUDE_LISTA comma-separated list of regular expressions that match the databases to be monitored.protected static StringDATABASE_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSGstatic FieldDATABASE_WHITELISTDeprecated.protected static StringDATABASE_WHITELIST_ALREADY_SPECIFIED_ERROR_MSGprotected static intDEFAULT_SNAPSHOT_FETCH_SIZEprotected static Field.SetEXPOSED_FIELDSstatic FieldFIELD_BLACKLISTDeprecated.static FieldFIELD_EXCLUDE_LISTA comma-separated list of the fully-qualified names of fields that should be excluded from change event message values.protected static PatternFIELD_EXCLUDE_LIST_PATTERNstatic FieldFIELD_RENAMESA comma-separated list of the fully-qualified replacements of fields that should be used to rename fields in change event message values.protected static PatternFIELD_RENAMES_PATTERNstatic FieldHOSTSThe comma-separated list of hostname and port pairs (in the form 'host' or 'host:port') of the MongoDB servers in the replica set.private static org.slf4j.LoggerLOGGERstatic FieldLOGICAL_NAMEstatic FieldMAX_COPY_THREADSDeprecated.static FieldMAX_FAILED_CONNECTIONSstatic FieldMONGODB_POLL_INTERVAL_MSstatic FieldPASSWORDprotected static PatternPATTERN_SPILTstatic FieldPOLL_INTERVAL_SECDeprecated.protected static StringQUALIFIED_FIELD_EXCLUDE_LIST_PATTERNprotected static StringQUALIFIED_FIELD_RENAMES_PATTERNstatic FieldSERVER_SELECTION_TIMEOUT_MSstatic FieldSNAPSHOT_FILTER_QUERY_BY_COLLECTIONstatic FieldSNAPSHOT_MODEprivate intsnapshotMaxThreadsprivate MongoDbConnectorConfig.SnapshotModesnapshotModestatic FieldSOCKET_TIMEOUT_MSstatic FieldSSL_ALLOW_INVALID_HOSTNAMESstatic FieldSSL_ENABLEDprotected static FieldTASK_IDstatic FieldUSER-
Fields inherited from class io.debezium.config.CommonConnectorConfig
BINARY_HANDLING_MODE, CUSTOM_CONVERTERS, DATABASE_CONFIG_PREFIX, DEFAULT_MAX_BATCH_SIZE, DEFAULT_MAX_QUEUE_SIZE, DEFAULT_MAX_QUEUE_SIZE_IN_BYTES, DEFAULT_POLL_INTERVAL_MILLIS, DEFAULT_QUERY_FETCH_SIZE, DEFAULT_RETRIABLE_RESTART_WAIT, EVENT_PROCESSING_FAILURE_HANDLING_MODE, INCREMENTAL_SNAPSHOT_ALLOW_SCHEMA_CHANGES, INCREMENTAL_SNAPSHOT_CHUNK_SIZE, MAX_BATCH_SIZE, MAX_QUEUE_SIZE, MAX_QUEUE_SIZE_IN_BYTES, POLL_INTERVAL_MS, PROVIDE_TRANSACTION_METADATA, QUERY_FETCH_SIZE, RETRIABLE_RESTART_WAIT, SANITIZE_FIELD_NAMES, SIGNAL_DATA_COLLECTION, SKIPPED_OPERATIONS, SNAPSHOT_DELAY_MS, SNAPSHOT_FETCH_SIZE, SNAPSHOT_MAX_THREADS, SNAPSHOT_MODE_TABLES, SOURCE_STRUCT_MAKER_VERSION, TOMBSTONES_ON_DELETE, TRANSACTION_TOPIC
-
-
Constructor Summary
Constructors Constructor Description MongoDbConnectorConfig(Configuration config)
-
Method Summary
-
Methods inherited from class io.debezium.config.CommonConnectorConfig
binaryHandlingMode, customConverterRegistry, getConfig, getDataCollectionsToBeSnapshotted, getEventProcessingFailureHandlingMode, getHeartbeatInterval, getHeartbeatTopicsPrefix, getIncrementalSnashotChunkSize, getLogicalName, getMaxBatchSize, getMaxQueueSize, getMaxQueueSizeInBytes, getPollInterval, getQueryFetchSize, getRetriableRestartWait, getSanitizeFieldNames, getSignalingDataCollectionId, getSkippedOperations, getSnapshotDelay, getSnapshotFetchSize, getSourceInfoStructMaker, getTransactionTopic, isEmitTombstoneOnDelete, isIncrementalSnapshotSchemaChangesEnabled, isSchemaChangesHistoryEnabled, isSchemaCommentsHistoryEnabled, legacyGetDataCollectionsToBeSnapshotted, shouldProvideTransactionMetadata, supportsSchemaChangesDuringIncrementalSnapshot, validate, validateAndRecord, validateServerNameIsDifferentFromHistoryTopicName
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
COLLECTION_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG
protected static final String COLLECTION_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG
- See Also:
- Constant Field Values
-
COLLECTION_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG
protected static final String COLLECTION_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG
- See Also:
- Constant Field Values
-
DATABASE_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG
protected static final String DATABASE_INCLUDE_LIST_ALREADY_SPECIFIED_ERROR_MSG
- See Also:
- Constant Field Values
-
DATABASE_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG
protected static final String DATABASE_WHITELIST_ALREADY_SPECIFIED_ERROR_MSG
- See Also:
- Constant Field Values
-
PATTERN_SPILT
protected static final Pattern PATTERN_SPILT
-
FIELD_EXCLUDE_LIST_PATTERN
protected static final Pattern FIELD_EXCLUDE_LIST_PATTERN
-
QUALIFIED_FIELD_EXCLUDE_LIST_PATTERN
protected static final String QUALIFIED_FIELD_EXCLUDE_LIST_PATTERN
- See Also:
- Constant Field Values
-
FIELD_RENAMES_PATTERN
protected static final Pattern FIELD_RENAMES_PATTERN
-
QUALIFIED_FIELD_RENAMES_PATTERN
protected static final String QUALIFIED_FIELD_RENAMES_PATTERN
- See Also:
- Constant Field Values
-
DEFAULT_SNAPSHOT_FETCH_SIZE
protected static final int DEFAULT_SNAPSHOT_FETCH_SIZE
- See Also:
- Constant Field Values
-
HOSTS
public static final Field HOSTS
The comma-separated list of hostname and port pairs (in the form 'host' or 'host:port') of the MongoDB servers in the replica set.
-
LOGICAL_NAME
public static final Field LOGICAL_NAME
-
USER
public static final Field USER
-
PASSWORD
public static final Field PASSWORD
-
AUTH_SOURCE
public static final Field AUTH_SOURCE
-
POLL_INTERVAL_SEC
@Deprecated public static final Field POLL_INTERVAL_SEC
Deprecated.
-
MONGODB_POLL_INTERVAL_MS
public static final Field MONGODB_POLL_INTERVAL_MS
-
SSL_ENABLED
public static final Field SSL_ENABLED
-
SSL_ALLOW_INVALID_HOSTNAMES
public static final Field SSL_ALLOW_INVALID_HOSTNAMES
-
MAX_COPY_THREADS
@Deprecated public static final Field MAX_COPY_THREADS
Deprecated.
-
CONNECT_BACKOFF_INITIAL_DELAY_MS
public static final Field CONNECT_BACKOFF_INITIAL_DELAY_MS
-
CONNECT_BACKOFF_MAX_DELAY_MS
public static final Field CONNECT_BACKOFF_MAX_DELAY_MS
-
MAX_FAILED_CONNECTIONS
public static final Field MAX_FAILED_CONNECTIONS
-
AUTO_DISCOVER_MEMBERS
public static final Field AUTO_DISCOVER_MEMBERS
-
DATABASE_INCLUDE_LIST
public static final Field DATABASE_INCLUDE_LIST
A comma-separated list of regular expressions that match the databases to be monitored. Must not be used withDATABASE_EXCLUDE_LIST.
-
DATABASE_WHITELIST
@Deprecated public static final Field DATABASE_WHITELIST
Deprecated.Old, backwards-compatible "whitelist" property.
-
DATABASE_EXCLUDE_LIST
public static final Field DATABASE_EXCLUDE_LIST
A comma-separated list of regular expressions that match the databases to be excluded. Must not be used withDATABASE_INCLUDE_LIST.
-
DATABASE_BLACKLIST
@Deprecated public static final Field DATABASE_BLACKLIST
Deprecated.Old, backwards-compatible "blacklist" property.
-
COLLECTION_INCLUDE_LIST
public static final Field COLLECTION_INCLUDE_LIST
A comma-separated list of regular expressions that match the fully-qualified namespaces of collections to be monitored. Fully-qualified namespaces for collections are of the form<databaseName>.<collectionName>. Must not be used withCOLLECTION_EXCLUDE_LIST.
-
COLLECTION_WHITELIST
@Deprecated public static final Field COLLECTION_WHITELIST
Deprecated.Old, backwards-compatible "whitelist" property.
-
COLLECTION_EXCLUDE_LIST
public static final Field COLLECTION_EXCLUDE_LIST
A comma-separated list of regular expressions that match the fully-qualified namespaces of collections to be excluded from monitoring. Fully-qualified namespaces for collections are of the form<databaseName>.<collectionName>. Must not be used withCOLLECTION_INCLUDE_LIST.
-
COLLECTION_BLACKLIST
@Deprecated public static final Field COLLECTION_BLACKLIST
Deprecated.Old, backwards-compatible "blacklist" property.
-
FIELD_EXCLUDE_LIST
public static final Field FIELD_EXCLUDE_LIST
A comma-separated list of the fully-qualified names of fields that should be excluded from change event message values. Fully-qualified names for fields are of the form<databaseName>.<collectionName>.<fieldName>.<nestedFieldName>, where<databaseName>and<collectionName>may contain the wildcard (*) which matches any characters.
-
FIELD_BLACKLIST
@Deprecated public static final Field FIELD_BLACKLIST
Deprecated.Old, backwards-compatible "blacklist" property.
-
FIELD_RENAMES
public static final Field FIELD_RENAMES
A comma-separated list of the fully-qualified replacements of fields that should be used to rename fields in change event message values. Fully-qualified replacements for fields are of the form<databaseName>.<collectionName>.<fieldName>.<nestedFieldName>:<newNestedFieldName>, where<databaseName>and<collectionName>may contain the wildcard (*) which matches any characters, the colon character (:) is used to determine rename mapping of field.
-
SNAPSHOT_MODE
public static final Field SNAPSHOT_MODE
-
CAPTURE_MODE
public static final Field CAPTURE_MODE
-
CONNECT_TIMEOUT_MS
public static final Field CONNECT_TIMEOUT_MS
-
SERVER_SELECTION_TIMEOUT_MS
public static final Field SERVER_SELECTION_TIMEOUT_MS
-
SOCKET_TIMEOUT_MS
public static final Field SOCKET_TIMEOUT_MS
-
TASK_ID
protected static final Field TASK_ID
-
SNAPSHOT_FILTER_QUERY_BY_COLLECTION
public static final Field SNAPSHOT_FILTER_QUERY_BY_COLLECTION
-
CURSOR_MAX_AWAIT_TIME_MS
public static final Field CURSOR_MAX_AWAIT_TIME_MS
-
CONFIG_DEFINITION
private static final ConfigDefinition CONFIG_DEFINITION
-
ALL_FIELDS
public static Field.Set ALL_FIELDS
The set ofFields defined as part of this configuration.
-
EXPOSED_FIELDS
protected static Field.Set EXPOSED_FIELDS
-
snapshotMode
private final MongoDbConnectorConfig.SnapshotMode snapshotMode
-
captureMode
private MongoDbConnectorConfig.CaptureMode captureMode
-
snapshotMaxThreads
private final int snapshotMaxThreads
-
cursorMaxAwaitTimeMs
private final int cursorMaxAwaitTimeMs
-
-
Constructor Detail
-
MongoDbConnectorConfig
public MongoDbConnectorConfig(Configuration config)
-
-
Method Detail
-
configDef
public static org.apache.kafka.common.config.ConfigDef configDef()
-
validateHosts
private static int validateHosts(Configuration config, Field field, Field.ValidationOutput problems)
-
validateFieldExcludeList
private static int validateFieldExcludeList(Configuration config, Field field, Field.ValidationOutput problems)
-
validateFieldRenamesList
private static int validateFieldRenamesList(Configuration config, Field field, Field.ValidationOutput problems)
-
validateCollectionExcludeList
private static int validateCollectionExcludeList(Configuration config, Field field, Field.ValidationOutput problems)
-
validateCollectionBlacklist
private static int validateCollectionBlacklist(Configuration config, Field field, Field.ValidationOutput problems)
-
validateDatabaseExcludeList
private static int validateDatabaseExcludeList(Configuration config, Field field, Field.ValidationOutput problems)
-
validateDatabaseBlacklist
private static int validateDatabaseBlacklist(Configuration config, Field field, Field.ValidationOutput problems)
-
getSnapshotMode
public MongoDbConnectorConfig.SnapshotMode getSnapshotMode()
-
getCaptureMode
public MongoDbConnectorConfig.CaptureMode getCaptureMode()
Provides statically configured capture mode. The configured value can be overrided upon connector start if offsets stored were created by a different capture mode. SeeMongoDbTaskContext.getCaptureMode()- Returns:
- capture mode requested by configuration
-
getCursorMaxAwaitTime
public int getCursorMaxAwaitTime()
-
getSnapshotMaxThreads
public int getSnapshotMaxThreads()
- Overrides:
getSnapshotMaxThreadsin classCommonConnectorConfig
-
getSourceInfoStructMaker
protected SourceInfoStructMaker<? extends AbstractSourceInfo> getSourceInfoStructMaker(CommonConnectorConfig.Version version)
- Specified by:
getSourceInfoStructMakerin classCommonConnectorConfig
-
getSnapshotFilterQueryForCollection
public Optional<String> getSnapshotFilterQueryForCollection(CollectionId collectionId)
-
supportsOperationFiltering
public boolean supportsOperationFiltering()
- Overrides:
supportsOperationFilteringin classCommonConnectorConfig
-
getContextName
public String getContextName()
- Specified by:
getContextNamein classCommonConnectorConfig
-
getConnectorName
public String getConnectorName()
- Specified by:
getConnectorNamein classCommonConnectorConfig
-
resolveSnapshotMaxThreads
private static int resolveSnapshotMaxThreads(Configuration config)
-
parseSignallingMessage
public Optional<String[]> parseSignallingMessage(org.apache.kafka.connect.data.Struct value)
- Overrides:
parseSignallingMessagein classCommonConnectorConfig
-
isSignalDataCollection
public boolean isSignalDataCollection(DataCollectionId dataCollectionId)
- Overrides:
isSignalDataCollectionin classCommonConnectorConfig
-
-