chia7712 commented on a change in pull request #10234:
URL: https://github.com/apache/kafka/pull/10234#discussion_r586289230
##########
File path:
clients/src/main/java/org/apache/kafka/common/requests/LeaderAndIsrRequest.java
##########
@@ -145,24 +145,21 @@ public LeaderAndIsrResponse getErrorResponse(int
throttleTimeMs, Throwable e) {
.setErrorCode(error.code()));
}
responseData.setPartitionErrors(partitions);
- return new LeaderAndIsrResponse(responseData, version());
- }
-
- List<LeaderAndIsrTopicError> topics = new
ArrayList<>(data.topicStates().size());
- Map<String, Uuid> topicIds = topicIds();
- for (LeaderAndIsrTopicState topicState : data.topicStates()) {
- LeaderAndIsrTopicError topicError = new LeaderAndIsrTopicError();
- topicError.setTopicId(topicIds.get(topicState.topicName()));
- List<LeaderAndIsrPartitionError> partitions = new
ArrayList<>(topicState.partitionStates().size());
- for (LeaderAndIsrPartitionState partition :
topicState.partitionStates()) {
- partitions.add(new LeaderAndIsrPartitionError()
+ } else {
+ for (LeaderAndIsrTopicState topicState : data.topicStates()) {
+ List<LeaderAndIsrPartitionError> partitions = new ArrayList<>(
+ topicState.partitionStates().size());
+ for (LeaderAndIsrPartitionState partition :
topicState.partitionStates()) {
+ partitions.add(new LeaderAndIsrPartitionError()
.setPartitionIndex(partition.partitionIndex())
Review comment:
> Do you really want to add a comment for this? That seems unnecessary
to me.
I don't have strong reason for that. As you mentioned, we can read protocol
file to understand the reasons of ignoring that filed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]