Package io.debezium.connector.postgresql
Class PostgresConnectorTask
- java.lang.Object
-
- org.apache.kafka.connect.source.SourceTask
-
- io.debezium.connector.common.BaseSourceTask<PostgresPartition,PostgresOffsetContext>
-
- io.debezium.connector.postgresql.PostgresConnectorTask
-
- All Implemented Interfaces:
org.apache.kafka.connect.connector.Task
public class PostgresConnectorTask extends BaseSourceTask<PostgresPartition,PostgresOffsetContext>
Kafka connect source task which uses Postgres logical decoding over a streaming replication connection to process DB changes.- Author:
- Horia Chiorean (hchiorea@redhat.com)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.debezium.connector.common.BaseSourceTask
BaseSourceTask.State
-
-
Field Summary
Fields Modifier and Type Field Description private static StringCONTEXT_NAMEprivate PostgresConnectionheartbeatConnectionprivate PostgresConnectionjdbcConnectionprivate static org.slf4j.LoggerLOGGERprivate ChangeEventQueue<DataChangeEvent>queueprivate PostgresSchemaschemaprivate PostgresTaskContexttaskContext
-
Constructor Summary
Constructors Constructor Description PostgresConnectorTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReplicationConnectioncreateReplicationConnection(PostgresTaskContext taskContext, boolean doSnapshot, int maxRetries, Duration retryDelay)List<org.apache.kafka.connect.source.SourceRecord>doPoll()protected voiddoStop()protected Iterable<Field>getAllConfigurationFields()PostgresTaskContextgetTaskContext()ChangeEventSourceCoordinator<PostgresPartition,PostgresOffsetContext>start(Configuration config)Stringversion()-
Methods inherited from class io.debezium.connector.common.BaseSourceTask
commit, commitRecord, getPreviousOffsets, poll, start, stop
-
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
CONTEXT_NAME
private static final String CONTEXT_NAME
- See Also:
- Constant Field Values
-
taskContext
private volatile PostgresTaskContext taskContext
-
queue
private volatile ChangeEventQueue<DataChangeEvent> queue
-
jdbcConnection
private volatile PostgresConnection jdbcConnection
-
heartbeatConnection
private volatile PostgresConnection heartbeatConnection
-
schema
private volatile PostgresSchema schema
-
-
Method Detail
-
start
public ChangeEventSourceCoordinator<PostgresPartition,PostgresOffsetContext> start(Configuration config)
- Specified by:
startin classBaseSourceTask<PostgresPartition,PostgresOffsetContext>
-
createReplicationConnection
public ReplicationConnection createReplicationConnection(PostgresTaskContext taskContext, boolean doSnapshot, int maxRetries, Duration retryDelay) throws org.apache.kafka.connect.errors.ConnectException
- Throws:
org.apache.kafka.connect.errors.ConnectException
-
doPoll
public List<org.apache.kafka.connect.source.SourceRecord> doPoll() throws InterruptedException
- Specified by:
doPollin classBaseSourceTask<PostgresPartition,PostgresOffsetContext>- Throws:
InterruptedException
-
doStop
protected void doStop()
- Specified by:
doStopin classBaseSourceTask<PostgresPartition,PostgresOffsetContext>
-
version
public String version()
-
getAllConfigurationFields
protected Iterable<Field> getAllConfigurationFields()
- Specified by:
getAllConfigurationFieldsin classBaseSourceTask<PostgresPartition,PostgresOffsetContext>
-
getTaskContext
public PostgresTaskContext getTaskContext()
-
-