Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
public class UsePartitionTimeOnInvalidTimestampUsePreviousTimeOnInvalidTimestamp extends ExtractRecordMetadataTimestamp {
...
}

Image Removed

Image Removed

Proposed Changes

Previously, in Kafka 2.3 we had the following methods inside 'UsePreviousTimeOnInvalidTimestamp' 

Image Removed

Image Removed


Current method signature for onInvalidTimestamp


Code Block
languagejava
public long onInvalidTimestamp(final ConsumerRecord<Object, Object> record, final long recordTimestamp, final long partitionTime)

throws StreamsException {

. . .

}


Proposed Changes

Change 'UsePartitionTimeOnInvalidTimeStamp'  to 'UsePartitionTimeOnInvalidTimestamp'

Code Block
languagejava
public class UsePreviousTimeOnInvalidTimestamp extends ExtractRecordMetadataTimestamp {
...
}


Code Block
languagejava
public class UsePartitionTimeOnInvalidTimestamp extends ExtractRecordMetadataTimestamp {
...
}

If we check the implementation of onInvalidTimestamp present in 'UsePreviousTimeOnInvalidTimestamp' but now if we see the source code 'UsePreviousTimeOnInvalidTimestamp' implementation of onInvalidTimestamp which is abstract method of super class  ExtractRecordMetadataTimestamp and the argument long previousTimestamp has been changed to long partitionTime

so it seems reasonable for us to change the class name to change as main functionality of this class is to return the valid time stamp of record's partition.

Also, there will be additional minor changes to be made if community agrees on the mentioned proposal which are listed below:

...

UsePreviousTimeOnInvalidTimestamp won't be present instead 'UsePartitionOnInvalidTimeStamp' will be there in next major version without change in the functionality but it's clear from the name that this will be used for partition time. But we might need to deprecate UsePreviousTimeOnInvalidTimeStamp first and then introduce new new one.

Rejected Alternatives

None.