Class RecordQueue
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.RecordQueue
-
public class RecordQueue extends Object
RecordQueue is a FIFO queue ofStampedRecord
(ConsumerRecord + timestamp). It also keeps track of the partition timestamp defined as the largest timestamp seen on the partition so far; this is passed to the timestamp extractor.
-
-
Field Summary
Fields Modifier and Type Field Description static long
UNKNOWN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clear the fifo queue of its elementsLong
headRecordOffset()
long
headRecordTimestamp()
Returns the head record's timestampboolean
isEmpty()
Tests if the queue is emptyTopicPartition
partition()
Returns the partition with which this queue is associatedStampedRecord
poll()
Get the nextStampedRecord
from the queueint
size()
Returns the number of records in the queueSourceNode<?,?>
source()
Returns the corresponding source node in the topology
-
-
-
Field Detail
-
UNKNOWN
public static final long UNKNOWN
- See Also:
- Constant Field Values
-
-
Method Detail
-
source
public SourceNode<?,?> source()
Returns the corresponding source node in the topology- Returns:
- SourceNode
-
partition
public TopicPartition partition()
Returns the partition with which this queue is associated- Returns:
- TopicPartition
-
poll
public StampedRecord poll()
Get the nextStampedRecord
from the queue- Returns:
- StampedRecord
-
size
public int size()
Returns the number of records in the queue- Returns:
- the number of records
-
isEmpty
public boolean isEmpty()
Tests if the queue is empty- Returns:
- true if the queue is empty, otherwise false
-
headRecordTimestamp
public long headRecordTimestamp()
Returns the head record's timestamp- Returns:
- timestamp
-
headRecordOffset
public Long headRecordOffset()
-
clear
public void clear()
Clear the fifo queue of its elements
-
-