Class TimedBlockingReader
java.lang.Object
io.debezium.connector.mysql.legacy.BlockingReader
io.debezium.connector.mysql.legacy.TimedBlockingReader
- All Implemented Interfaces:
Reader
A component that blocks doing nothing for a specified period of time or until the connector task is stopped
- Author:
- Peter Goransson
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.debezium.connector.mysql.legacy.Reader
Reader.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Loggerprivate final Durationprivate Threads.Timer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.kafka.connect.source.SourceRecord>poll()Does nothing until the connector task is shut down, but regularly returns control back to Connect in order for being paused if requested.voidstart(MySqlPartition partition) Start the reader and return immediately.Methods inherited from class io.debezium.connector.mysql.legacy.BlockingReader
name, state, stop, uponCompletionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.debezium.connector.mysql.legacy.Reader
destroy, initialize
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
timeout
-
timer
-
-
Constructor Details
-
TimedBlockingReader
- Parameters:
name- Name of the readertimeout- Duration of time until this TimedBlockingReader should stop
-
-
Method Details
-
start
Description copied from interface:ReaderStart the reader and return immediately. Once started, theSourceRecords generated by the reader can be obtained by periodically callingReader.poll()until that method returnsnull.This method does nothing if it is already running.
- Specified by:
startin interfaceReader- Overrides:
startin classBlockingReader
-
poll
Description copied from class:BlockingReaderDoes nothing until the connector task is shut down, but regularly returns control back to Connect in order for being paused if requested.- Specified by:
pollin interfaceReader- Overrides:
pollin classBlockingReader- Returns:
- the list of source records that may or may not be empty; or
nullwhen there will be no more records because the reader has completelyReader.State.STOPPED. - Throws:
InterruptedException- if this thread is interrupted while waiting for more records
-