Skip to content

ExtractRecordMetadataTimestamp

ExtractRecordMetadataTimestamp is an extension of the TimestampExtractor abstraction for timestamp extractors that use ConsumerRecords for timestamps and can handle invalid (negative) timestamps.

Contract

Handling Invalid (Negative) Timestamp

long onInvalidTimestamp(
  ConsumerRecord<Object, Object> record,
  long recordTimestamp,
  long partitionTime)

Used when:

Implementations

  • FailOnInvalidTimestamp
  • LogAndSkipOnInvalidTimestamp
  • UsePartitionTimeOnInvalidTimestamp

Extracting Timestamp

long extract(
  ConsumerRecord<Object, Object> record,
  long partitionTime)

extract requests the given ConsumerRecord for the timestamp.

In case the (extracted) timestamp is negative, extract onInvalidTimestamp.

extract is part of the TimestampExtractor abstraction.

Back to top