apoorvmittal10 commented on code in PR #16573:
URL: https://github.com/apache/kafka/pull/16573#discussion_r1696613548


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -2388,6 +3138,82 @@ public 
CoordinatorResult<ConsumerGroupHeartbeatResponseData, CoordinatorRecord>
         }
     }
 
+    /**
+     * Handles a ShareGroupHeartbeat request.
+     *
+     * @param context The request context.
+     * @param request The actual ShareGroupHeartbeat request.
+     *
+     * @return A Result containing the ShareGroupHeartbeat response and
+     *         a list of records to update the state machine.
+     */
+    public CoordinatorResult<ShareGroupHeartbeatResponseData, 
CoordinatorRecord> shareGroupHeartbeat(
+        RequestContext context,
+        ShareGroupHeartbeatRequestData request
+    ) throws ApiException {
+        throwIfShareGroupHeartbeatRequestIsInvalid(request);
+
+        if (request.memberEpoch() == 
ShareGroupHeartbeatRequest.LEAVE_GROUP_MEMBER_EPOCH) {
+            // -1 means that the member wants to leave the group.
+            return shareGroupLeave(
+                request.groupId(),
+                request.memberId(),
+                request.memberEpoch());
+        }
+        // Otherwise, it is a regular heartbeat.
+        return shareGroupHeartbeat(
+            request.groupId(),
+            request.memberId(),
+            request.memberEpoch(),
+            request.rackId(),
+            context.clientId(),
+            context.clientAddress.toString(),
+            request.subscribedTopicNames());
+    }
+
+    private void replay(CoordinatorRecord record) {

Review Comment:
   I see, I didn't want to change the Shard replay method to make common 
functionality in the first iteration, though thought to take it later. But I do 
understand your point about not persisting and replaying terminology. I ll 
discuss with you prior going ahead with another iteration on it.



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