TimestampExtractor
@Evolving public class WallclockTimestampExtractor extends java.lang.Object implements TimestampExtractor
System.currentTimeMillis()
.
Using this extractor effectively provides processing-time semantics.
If you need event-time semantics, use FailOnInvalidTimestamp
with
built-in CreateTime or LogAppendTime timestamp (see KIP-32: Add timestamps to Kafka message for details).
Constructor | Description |
---|---|
WallclockTimestampExtractor() |
Modifier and Type | Method | Description |
---|---|---|
long |
extract(ConsumerRecord<java.lang.Object,java.lang.Object> record,
long previousTimestamp) |
Return the current wall clock time as timestamp.
|
public long extract(ConsumerRecord<java.lang.Object,java.lang.Object> record, long previousTimestamp)
extract
in interface TimestampExtractor
record
- a data recordpreviousTimestamp
- the latest extracted valid timestamp of the current record's partition˙ (could be -1 if unknown)