public CoordinatorResult<Void, CoordinatorRecord> classicGroupJoin(
        RequestContext context,
        JoinGroupRequestData request,
        CompletableFuture<JoinGroupResponseData> responseFuture
    ) {
        Group group = groups.get(request.groupId(), Long.MAX_VALUE);
        if (group != null && group.type() == CONSUMER && !group.isEmpty()) {
            // classicGroupJoinToConsumerGroup takes the join requests to non-empty consumer groups.
            // The empty consumer groups should be converted to classic groups in classicGroupJoinToClassicGroup.
            return classicGroupJoinToConsumerGroup((ConsumerGroup) group, context, request, responseFuture);
        } else {
            return classicGroupJoinToClassicGroup(context, request, responseFuture);
        }
    }
Handle a JoinGroupRequest.

@param context        The request context.
@param request        The actual JoinGroup request.
@param responseFuture The join group response future.

@return The result that contains records to append if the join group phase completes.
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java