Shekharrajak commented on code in PR #23974:
URL: https://github.com/apache/kafka/pull/23974#discussion_r4386924230
##########
server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:
##########
@@ -1232,52 +1244,44 @@ protected void handleRequestResponse(ClientResponse
response) {
switch (clientResponseError) {
case NONE:
- ReadShareGroupStateSummaryResponse combinedResponse =
(ReadShareGroupStateSummaryResponse) response.responseBody();
- for
(ReadShareGroupStateSummaryResponseData.ReadStateSummaryResult
readStateSummaryResult : combinedResponse.data().results()) {
- if
(readStateSummaryResult.topicId().equals(partitionKey().topicId())) {
-
Optional<ReadShareGroupStateSummaryResponseData.PartitionResult>
partitionStateData =
-
readStateSummaryResult.partitions().stream().filter(partitionResult ->
partitionResult.partition() == partitionKey().partition())
- .findFirst();
-
- if (partitionStateData.isPresent()) {
- Errors error =
Errors.forCode(partitionStateData.get().errorCode());
- String errorMessage =
partitionStateData.get().errorMessage();
- if (errorMessage == null ||
errorMessage.isEmpty()) {
- errorMessage = error.message();
- }
-
- switch (error) {
- case NONE:
-
readStateSummaryBackoff.resetAttempts();
-
ReadShareGroupStateSummaryResponseData.ReadStateSummaryResult result =
ReadShareGroupStateSummaryResponse.toResponseReadStateSummaryResult(
- partitionKey().topicId(),
- List.of(partitionStateData.get())
- );
- this.result.complete(new
ReadShareGroupStateSummaryResponse(new ReadShareGroupStateSummaryResponseData()
- .setResults(List.of(result))));
- return;
+ ReadShareGroupStateSummaryResponseData.PartitionResult
partitionResult = lookupPartitionResult(response);
Review Comment:
similar to https://github.com/apache/kafka/pull/23971
--
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]