@Immutable protected static class MongoDbConnectorTask.TaskRecordQueue extends Object
| Modifier and Type | Field and Description |
|---|---|
private Consumer<List<org.apache.kafka.connect.source.SourceRecord>> |
batchConsumer |
private BooleanSupplier |
isRunning |
private int |
maxBatchSize |
private Metronome |
metronome |
private BlockingQueue<org.apache.kafka.connect.source.SourceRecord> |
records |
| Modifier | Constructor and Description |
|---|---|
protected |
TaskRecordQueue(Configuration config,
int numThreads,
BooleanSupplier isRunning,
Consumer<List<org.apache.kafka.connect.source.SourceRecord>> batchConsumer) |
| Modifier and Type | Method and Description |
|---|---|
void |
enqueue(org.apache.kafka.connect.source.SourceRecord record)
Adds the event into the queue for subsequent batch processing.
|
List<org.apache.kafka.connect.source.SourceRecord> |
poll() |
private final int maxBatchSize
private final Metronome metronome
private final BlockingQueue<org.apache.kafka.connect.source.SourceRecord> records
private final BooleanSupplier isRunning
protected TaskRecordQueue(Configuration config, int numThreads, BooleanSupplier isRunning, Consumer<List<org.apache.kafka.connect.source.SourceRecord>> batchConsumer)
public List<org.apache.kafka.connect.source.SourceRecord> poll() throws InterruptedException
InterruptedExceptionpublic void enqueue(org.apache.kafka.connect.source.SourceRecord record)
throws InterruptedException
record - a record from the MongoDB oplogInterruptedException - if the thread is interrupted while waiting to enqueue the recordCopyright © 2016 JBoss by Red Hat. All rights reserved.