Class RecordQueue
- java.lang.Object
-
- org.apache.kafka.streams.processor.internals.RecordQueue
-
public class RecordQueue extends java.lang.ObjectRecordQueue 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 longUNKNOWN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear the fifo queue of its elementsjava.lang.LongheadRecordOffset()longheadRecordTimestamp()Returns the head record's timestampbooleanisEmpty()Tests if the queue is emptyorg.apache.kafka.common.TopicPartitionpartition()Returns the partition with which this queue is associatedStampedRecordpoll()Get the nextStampedRecordfrom the queueintsize()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 org.apache.kafka.common.TopicPartition partition()
Returns the partition with which this queue is associated- Returns:
- TopicPartition
-
poll
public StampedRecord poll()
Get the nextStampedRecordfrom 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 java.lang.Long headRecordOffset()
-
clear
public void clear()
Clear the fifo queue of its elements
-
-