public class TimedBlockingReader extends BlockingReader
Reader.State| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
private Duration |
timeout |
private Threads.Timer |
timer |
| Constructor and Description |
|---|
TimedBlockingReader(String name,
Duration timeout) |
| Modifier and Type | Method and Description |
|---|---|
List<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.
|
void |
start()
Start the reader and return immediately.
|
name, state, stop, uponCompletionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, initializeprotected final org.slf4j.Logger logger
private final Duration timeout
private volatile Threads.Timer timer
public void start()
ReaderSourceRecords generated by the reader can be obtained by
periodically calling Reader.poll() until that method returns null.
This method does nothing if it is already running.
start in interface Readerstart in class BlockingReaderpublic List<org.apache.kafka.connect.source.SourceRecord> poll() throws InterruptedException
BlockingReaderpoll in interface Readerpoll in class BlockingReadernull when there will be no more records
because the reader has completely Reader.State.STOPPED.InterruptedException - if this thread is interrupted while waiting for more recordsCopyright © 2018 JBoss by Red Hat. All rights reserved.