Package io.debezium.connector.simple
Class SimpleSourceConnector
- java.lang.Object
-
- org.apache.kafka.connect.connector.Connector
-
- org.apache.kafka.connect.source.SourceConnector
-
- io.debezium.connector.simple.SimpleSourceConnector
-
- All Implemented Interfaces:
org.apache.kafka.connect.components.Versioned
public class SimpleSourceConnector extends org.apache.kafka.connect.source.SourceConnectorA very simpleSourceConnectorfor testing that reliably produces the same records in the same order, and useful for testing the infrastructure to runSourceConnectors.This connector produces messages with keys having a single monotonically-increasing integer field named
id:{ "id" : "1" }and values with abatchfield containing the 1-based batch number, arecordfield containing the 1-based record number within the batch, and an optionaltimestampfield that contains a simulated number of milliseconds past epoch computed by adding the start time of the connector task with the messageid:{ "batch" : "1", "record" : "1", "timestamp" : null }- Author:
- Randall Hauch
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleSourceConnector.SimpleConnectorTask
-
Field Summary
Fields Modifier and Type Field Description static StringBATCH_COUNTprivate Map<String,String>configstatic intDEFAULT_BATCH_COUNTstatic booleanDEFAULT_INCLUDE_TIMESTAMPstatic intDEFAULT_RECORD_COUNT_PER_BATCHstatic StringDEFAULT_TOPIC_NAMEstatic StringINCLUDE_TIMESTAMPstatic StringRECORD_COUNT_PER_BATCHstatic StringRETRIABLE_ERROR_ONstatic StringTOPIC_NAMEprotected static StringVERSION
-
Constructor Summary
Constructors Constructor Description SimpleSourceConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.kafka.common.config.ConfigDefconfig()voidstart(Map<String,String> props)voidstop()Class<? extends org.apache.kafka.connect.connector.Task>taskClass()List<Map<String,String>>taskConfigs(int maxTasks)Stringversion()
-
-
-
Field Detail
-
VERSION
protected static final String VERSION
- See Also:
- Constant Field Values
-
TOPIC_NAME
public static final String TOPIC_NAME
- See Also:
- Constant Field Values
-
RECORD_COUNT_PER_BATCH
public static final String RECORD_COUNT_PER_BATCH
- See Also:
- Constant Field Values
-
BATCH_COUNT
public static final String BATCH_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_TOPIC_NAME
public static final String DEFAULT_TOPIC_NAME
- See Also:
- Constant Field Values
-
INCLUDE_TIMESTAMP
public static final String INCLUDE_TIMESTAMP
- See Also:
- Constant Field Values
-
RETRIABLE_ERROR_ON
public static final String RETRIABLE_ERROR_ON
- See Also:
- Constant Field Values
-
DEFAULT_RECORD_COUNT_PER_BATCH
public static final int DEFAULT_RECORD_COUNT_PER_BATCH
- See Also:
- Constant Field Values
-
DEFAULT_BATCH_COUNT
public static final int DEFAULT_BATCH_COUNT
- See Also:
- Constant Field Values
-
DEFAULT_INCLUDE_TIMESTAMP
public static final boolean DEFAULT_INCLUDE_TIMESTAMP
- See Also:
- Constant Field Values
-
-
Method Detail
-
version
public String version()
-
start
public void start(Map<String,String> props)
- Specified by:
startin classorg.apache.kafka.connect.connector.Connector
-
taskClass
public Class<? extends org.apache.kafka.connect.connector.Task> taskClass()
- Specified by:
taskClassin classorg.apache.kafka.connect.connector.Connector
-
taskConfigs
public List<Map<String,String>> taskConfigs(int maxTasks)
- Specified by:
taskConfigsin classorg.apache.kafka.connect.connector.Connector
-
stop
public void stop()
- Specified by:
stopin classorg.apache.kafka.connect.connector.Connector
-
config
public org.apache.kafka.common.config.ConfigDef config()
- Specified by:
configin classorg.apache.kafka.connect.connector.Connector
-
-