[
https://issues.apache.org/jira/browse/KAFKA-19068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chia-Ping Tsai resolved KAFKA-19068.
------------------------------------
Fix Version/s: 4.1.0
Resolution: Fixed
> Eliminate the duplicate type check in creating ControlRecord
> ------------------------------------------------------------
>
> Key: KAFKA-19068
> URL: https://issues.apache.org/jira/browse/KAFKA-19068
> Project: Kafka
> Issue Type: Improvement
> Reporter: Chia-Ping Tsai
> Assignee: Nick Guo
> Priority: Minor
> Fix For: 4.1.0
>
>
> `RecordsIterator#decodeControlRecord` [0] do the type check and then
> `ControlRecord` constructor [1] does that again ...
> we should add a static method to ControlRecord to create `ControlRecord` with
> type check, and then `ControlRecord` constructor should be changed to private
> to ensure all instance is created by the static method
> [0]
> https://github.com/apache/kafka/blob/ccf2510fdda755b7a8e0900d3316fade46eb533a/raft/src/main/java/org/apache/kafka/raft/internals/RecordsIterator.java#L361
> [1]
> https://github.com/apache/kafka/blob/ccf2510fdda755b7a8e0900d3316fade46eb533a/raft/src/main/java/org/apache/kafka/raft/ControlRecord.java#L45
--
This message was sent by Atlassian Jira
(v8.20.10#820010)