RecordQueue
is a FIFO queue of StampedRecords that a StreamTask
uses for…FIXME
RecordQueue
is created along with a StreamTask exclusively.
Name | Description |
---|---|
|
Java’s java.util.ArrayDeque of StampedRecords (i.e. orderable Kafka Used when…FIXME |
|
RecordDeserializer (for the SourceNode and DeserializationExceptionHandler) Used when…FIXME |
|
Used when…FIXME |
Tip
|
Enable Add the following line to
Refer to Application Logging Using log4j. |
RecordQueue
takes the following when created:
-
Kafka TopicPartition
RecordQueue
initializes the internal registries and counters.
int addRawRecords(final Iterable<ConsumerRecord<byte[], byte[]>> rawRecords)
For every Kafka ConsumerRecord in the input rawRecords
, addRawRecords
does the following:
-
Requests the RecordDeserializer to deserialize the record (with the ProcessorContext)
-
Requests the TimestampTracker for the currently-tracked timestamp and uses it to request the TimestampExtractor to extract the timestamp of the record
-
Creates a StampedRecord for the record and the record timestamp
-
Inserts the
StampedRecord
at the end of the fifoQueue -
Requests the TimestampTracker to add the StampedRecord
While processing ConsumerRecords
, addRawRecords
prints out the following TRACE message to the logs:
Source node [name] extracted timestamp [timestamp] for record [record]
With all ConsumerRecords
processed, addRawRecords
updates the partitionTime if the currently-tracked timestamp (from the TimestampTracker) is greater.
In the end, addRawRecords
returns the number of ConsumerRecords in the queue.
Note
|
|
Note
|
addRawRecords is used exclusively when PartitionGroup is requested to add records to a RecordQueue for a Kafka partition.
|
void clear()
clear
removes all of the elements from the fifoQueue and requests the TimestampTracker to clear itself.
In the end, clear
(re)sets the partitionTime to NOT_KNOWN
.
Note
|
clear is used exclusively when PartitionGroup is requested to clear.
|
int size()
size
simply returns the number of records in the fifoQueue.
Note
|
|