Class WallclockTimestampExtractor
- java.lang.Object
-
- org.apache.kafka.streams.processor.WallclockTimestampExtractor
-
- All Implemented Interfaces:
TimestampExtractor
public class WallclockTimestampExtractor extends Object implements TimestampExtractor
Retrieves current wall clock timestamps asSystem.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 Summary
Constructors Constructor Description WallclockTimestampExtractor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
extract(ConsumerRecord<Object,Object> record, long partitionTime)
Return the current wall clock time as timestamp.
-
-
-
Method Detail
-
extract
public long extract(ConsumerRecord<Object,Object> record, long partitionTime)
Return the current wall clock time as timestamp.- Specified by:
extract
in interfaceTimestampExtractor
- Parameters:
record
- a data recordpartitionTime
- the highest extracted valid timestamp of the current record's partition˙ (could be -1 if unknown)- Returns:
- the current wall clock time, expressed in milliseconds since midnight, January 1, 1970 UTC
-
-