ijuma commented on code in PR #18464:
URL: https://github.com/apache/kafka/pull/18464#discussion_r1910473777
##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -2590,89 +2588,11 @@ class KafkaApis(val requestChannel: RequestChannel,
}
def handleAlterPartitionReassignmentsRequest(request:
RequestChannel.Request): Unit = {
- val zkSupport =
metadataSupport.requireZkOrThrow(KafkaApis.shouldAlwaysForward(request))
- authHelper.authorizeClusterOperation(request, ALTER)
- val alterPartitionReassignmentsRequest =
request.body[AlterPartitionReassignmentsRequest]
-
- def sendResponseCallback(result: Either[Map[TopicPartition, ApiError],
ApiError]): Unit = {
- val responseData = result match {
- case Right(topLevelError) =>
- new
AlterPartitionReassignmentsResponseData().setErrorMessage(topLevelError.message).setErrorCode(topLevelError.error.code)
-
- case Left(assignments) =>
- val topicResponses = assignments.groupBy(_._1.topic).map {
- case (topic, reassignmentsByTp) =>
- val partitionResponses = reassignmentsByTp.map {
- case (topicPartition, error) =>
- new
ReassignablePartitionResponse().setPartitionIndex(topicPartition.partition)
-
.setErrorCode(error.error.code).setErrorMessage(error.message)
- }
- new
ReassignableTopicResponse().setName(topic).setPartitions(partitionResponses.toList.asJava)
- }
- new
AlterPartitionReassignmentsResponseData().setResponses(topicResponses.toList.asJava)
- }
-
- requestHelper.sendResponseMaybeThrottle(request, requestThrottleMs =>
- new
AlterPartitionReassignmentsResponse(responseData.setThrottleTimeMs(requestThrottleMs))
- )
- }
-
- val reassignments =
alterPartitionReassignmentsRequest.data.topics.asScala.flatMap {
- reassignableTopic => reassignableTopic.partitions.asScala.map {
- reassignablePartition =>
- val tp = new TopicPartition(reassignableTopic.name,
reassignablePartition.partitionIndex)
- if (reassignablePartition.replicas == null)
- tp -> None // revert call
- else
- tp -> Some(reassignablePartition.replicas.asScala.map(_.toInt))
- }
- }.toMap
-
- zkSupport.controller.alterPartitionReassignments(reassignments,
sendResponseCallback)
+ throw KafkaApis.shouldNeverReceive(request)
Review Comment:
Same thing I said here:
https://github.com/apache/kafka/pull/18465/files#r1910472130
--
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]