Interface BlockingRecordQueue<K,V>
-
- Type Parameters:
K
- the record-key typeV
- the record-value type
- All Known Implementing Classes:
BasicBlockingRecordQueue
,DelegateBlockingRecordQueue
public interface BlockingRecordQueue<K,V>
A blocking queue that can be used for publishing key-value records from a Kafka Streams topology.- Since:
- 0.8.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
void
close()
Close the queue.void
drainTo(Collection<? super KV<K,V>> collection)
boolean
isEmpty()
void
open()
Open the queue.KV<K,V>
poll()
KV<K,V>
poll(Duration tmaxBlockingTimeimeout)
void
send(KV<K,V> kv)
Sends a key-value record into this queue.void
setLimitHandler(LimitHandler handler)
Sets the handler to be invoked when the limit queue is reached.void
setQueueCallback(QueueCallback callback)
Sets the callback to be executed when a new record is queued or the queue is closed.int
size()
-
-
-
Method Detail
-
setLimitHandler
void setLimitHandler(LimitHandler handler)
Sets the handler to be invoked when the limit queue is reached.- Parameters:
handler
- theLimitHandler
instance.
-
setQueueCallback
void setQueueCallback(QueueCallback callback)
Sets the callback to be executed when a new record is queued or the queue is closed.- Parameters:
callback
- theQueueCallback
to execute.
-
poll
KV<K,V> poll(Duration tmaxBlockingTimeimeout) throws InterruptedException
- Throws:
InterruptedException
- See Also:
BlockingQueue.poll(long, TimeUnit)
-
poll
KV<K,V> poll()
- See Also:
Queue.poll()
-
drainTo
void drainTo(Collection<? super KV<K,V>> collection)
- See Also:
BlockingQueue.drainTo(Collection)
-
size
int size()
- Returns:
- the number of records queued.
-
isEmpty
boolean isEmpty()
- Returns:
true
if the queue is empty.
-
open
void open()
Open the queue.
-
close
void close()
Close the queue. The records sent after the queue is closed will be ignored.
-
send
void send(KV<K,V> kv)
Sends a key-value record into this queue.- Parameters:
kv
- theKV
record.
-
clear
void clear()
- See Also:
Collection.clear()
-
-