@InterfaceStability.Evolving public class WallclockTimestampExtractor extends 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 and Description |
---|
WallclockTimestampExtractor() |
Modifier and Type | Method and Description |
---|---|
long |
extract(ConsumerRecord<Object,Object> record,
long previousTimestamp)
Return the current wall clock time as timestamp.
|
public long extract(ConsumerRecord<Object,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)