niket-goel commented on code in PR #12508:
URL: https://github.com/apache/kafka/pull/12508#discussion_r947220953


##########
raft/src/main/java/org/apache/kafka/raft/LeaderState.java:
##########
@@ -290,13 +318,30 @@ private ReplicaState getReplicaState(int remoteNodeId) {
         return state;
     }
 
-    Map<Integer, Long> getVoterEndOffsets() {
-        return getReplicaEndOffsets(voterStates);
+    List<DescribeQuorumResponseData.ReplicaState> 
quorumResponseVoterStates(long currentTimeMs) {
+        return quorumResponseReplicaStates(voterStates, 
OptionalInt.of(localId), currentTimeMs);
     }
 
-    Map<Integer, Long> getObserverStates(final long currentTimeMs) {
+    List<DescribeQuorumResponseData.ReplicaState> 
quorumResponseObserverStates(long currentTimeMs) {
         clearInactiveObservers(currentTimeMs);
-        return getReplicaEndOffsets(observerStates);
+        return quorumResponseReplicaStates(observerStates, 
OptionalInt.empty(), currentTimeMs);
+    }
+
+    private static <R extends ReplicaState> 
List<DescribeQuorumResponseData.ReplicaState> quorumResponseReplicaStates(
+            Map<Integer, R> state,
+            OptionalInt leaderId,
+            long currentTimeMs) {
+        Map<Integer, Long> replicaEndOffsets = getReplicaEndOffsets(state);

Review Comment:
   Makes sense! Will modify.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to