cmccabe commented on code in PR #12447:
URL: https://github.com/apache/kafka/pull/12447#discussion_r934829540


##########
metadata/src/main/java/org/apache/kafka/controller/QuorumController.java:
##########
@@ -882,26 +919,28 @@ public void 
handleSnapshot(SnapshotReader<ApiMessageAndVersion> reader) {
 
                         if (log.isDebugEnabled()) {
                             if (log.isTraceEnabled()) {
-                                log.trace(
-                                    "Replaying snapshot ({}) batch with last 
offset of {}: {}",
-                                    reader.snapshotId(),
-                                    offset,
-                                    messages
-                                        .stream()
-                                        .map(ApiMessageAndVersion::toString)
-                                        .collect(Collectors.joining(", "))
-                                );
+                                log.trace("Replaying snapshot ({}) batch with 
last offset of {}: {}",
+                                    reader.snapshotId(), offset, 
messages.stream().map(ApiMessageAndVersion::toString).
+                                        collect(Collectors.joining(", ")));
                             } else {
-                                log.debug(
-                                    "Replaying snapshot ({}) batch with last 
offset of {}",
-                                    reader.snapshotId(),
-                                    offset
-                                );
+                                log.debug("Replaying snapshot ({}) batch with 
last offset of {}",
+                                    reader.snapshotId(), offset);
                             }
                         }
 
-                        for (ApiMessageAndVersion messageAndVersion : 
messages) {
-                            replay(messageAndVersion.message(), 
Optional.of(reader.snapshotId()), offset);
+                        int i = 1;
+                        for (ApiMessageAndVersion message : messages) {

Review Comment:
   Yeah, but the problem is it's subtly different in each of these loops. The 
message, for example, is different, and whether the snapshot ID is passed in, 
etc. I think it would just be confusing to try to unify them (it's a single 
"for" loop after all)



-- 
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