jolshan commented on code in PR #12853:
URL: https://github.com/apache/kafka/pull/12853#discussion_r1036279657
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -1618,34 +1618,36 @@ class KafkaApis(val requestChannel: RequestChannel,
def handleListGroupsRequest(request: RequestChannel.Request): Unit = {
val listGroupsRequest = request.body[ListGroupsRequest]
- val states = if (listGroupsRequest.data.statesFilter == null)
- // Handle a null array the same as empty
- immutable.Set[String]()
- else
- listGroupsRequest.data.statesFilter.asScala.toSet
- def createResponse(throttleMs: Int, groups: List[GroupOverview], error:
Errors): AbstractResponse = {
- new ListGroupsResponse(new ListGroupsResponseData()
- .setErrorCode(error.code)
- .setGroups(groups.map { group =>
- val listedGroup = new ListGroupsResponseData.ListedGroup()
- .setGroupId(group.groupId)
- .setProtocolType(group.protocolType)
- .setGroupState(group.state)
- listedGroup
- }.asJava)
- .setThrottleTimeMs(throttleMs)
- )
+ def sendResponse(response: AbstractResponse): Unit = {
+ requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs => {
Review Comment:
We will probably want to use the helper from the SyncGroup PR here too.
--
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]