public class SourceRecordConcurrentLinkedDeque extends ConcurrentLinkedDeque<org.apache.kafka.connect.source.SourceRecord>
| Constructor and Description |
|---|
SourceRecordConcurrentLinkedDeque()
Constructor creates a new instance of the SourceRecordConcurrentLinkedDeque with a batchSize of 1024 and timeout of 0.
|
SourceRecordConcurrentLinkedDeque(int batchSize,
int timeout)
Constructor creates a new instance of the SourceRecordConcurrentLinkedDeque
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
drain(List<org.apache.kafka.connect.source.SourceRecord> records)
Method is used to drain the records from the deque in order and add them to the supplied list.
|
boolean |
drain(List<org.apache.kafka.connect.source.SourceRecord> records,
int timeout)
Method is used to drain the records from the deque in order and add them to the supplied list.
|
add, addAll, addFirst, addLast, clear, contains, descendingIterator, element, getFirst, getLast, isEmpty, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size, spliterator, toArray, toArraycontainsAll, removeAll, retainAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCode, parallelStream, removeAll, removeIf, retainAll, streampublic SourceRecordConcurrentLinkedDeque(int batchSize,
int timeout)
batchSize - The maximum number of records to return per batch.timeout - The amount of time to wait if no batch was returned.public SourceRecordConcurrentLinkedDeque()
public boolean drain(List<org.apache.kafka.connect.source.SourceRecord> records) throws InterruptedException
records - list to add the records to.InterruptedException - Thrown if the thread is killed while sleeping.public boolean drain(List<org.apache.kafka.connect.source.SourceRecord> records, int timeout) throws InterruptedException
records - list to add the records to.timeout - amount of time to sleep if no records are added.InterruptedException - Thrown if the thread is killed while sleeping.IllegalArgumentException - Thrown if timeout is less than 0.Copyright © 2016–2017. All rights reserved.