mimaison commented on code in PR #17633:
URL: https://github.com/apache/kafka/pull/17633#discussion_r1822977144


##########
metadata/src/main/java/org/apache/kafka/metadata/util/SnapshotFileReader.java:
##########
@@ -130,17 +131,15 @@ private void handleControlBatch(FileChannelRecordBatch 
batch) {
             try {
                 short typeId = ControlRecordType.parseTypeId(record.key());
                 ControlRecordType type = ControlRecordType.fromTypeId(typeId);
-                switch (type) {
-                    case LEADER_CHANGE:
-                        LeaderChangeMessage message = new 
LeaderChangeMessage();
-                        message.read(new ByteBufferAccessor(record.value()), 
(short) 0);
-                        listener.handleLeaderChange(new LeaderAndEpoch(
+                if (Objects.requireNonNull(type) == 
ControlRecordType.LEADER_CHANGE) {

Review Comment:
   Right, I've reverted that change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to